Skip to content

Commit f86cca6

Browse files
committed
fix(runtime): resolve critical compilation errors across core runtime infrastructure
This commit addresses a comprehensive set of compilation errors that were preventing successful builds across the WRT runtime infrastructure. The changes ensure compatibility across both std and no_std environments while maintaining type safety and memory management principles. Key Changes: ## Runtime Infrastructure (wrt-runtime) - Fixed all String parameter conflicts with no_std type aliases - Resolved BoundedVec iterator patterns and collection operations - Added missing trait implementations (Checksummable, ToBytes, FromBytes) - Implemented proper Arc<Memory> access patterns for thread-safe operations - Added no_std versions of feature-gated methods (read_br_table, branch_table) - Fixed BoundedVec to slice conversions with proper error handling - Resolved memory adapter type mismatches and unsafe pointer operations ## Component Model Infrastructure (wrt-component) - Comprehensive feature gating for std/no_std compatibility in async modules - Fixed import resolution for threading, sync primitives, and task management - Added placeholder implementations for missing component types - Resolved module organization and visibility issues - Fixed conditional compilation for async runtime features ## Build System Infrastructure - Updated cargo-wrt and wrt-build-core to handle new error patterns - Improved error handling in build matrix verification - Enhanced diagnostic output formatting and error categorization ## Memory Management - Unified memory provider patterns across all crates - Proper capability-based allocation error handling - Eliminated legacy memory allocation patterns - Enhanced bounded collection usage with proper error propagation ## Type System Improvements - Resolved mismatched type errors between bounded and standard collections - Fixed iterator dereference patterns for different compilation modes - Improved trait bound specifications for no_std compatibility - Enhanced error type conversions and Result handling ## Impact - All core runtime infrastructure crates now compile successfully - Both std and no_std compilation modes are supported - Memory safety and type safety maintained throughout - Improved error handling and diagnostic capabilities - Foundation prepared for continued development and testing The changes maintain backward compatibility while establishing a solid foundation for the WebAssembly runtime component model implementation. All modifications follow established coding patterns and safety requirements.
1 parent f3c478c commit f86cca6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1861
-555
lines changed

cargo-wrt/src/helpers/autofix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl AutoFixManager {
9494
fn apply_fix(&self, fix: &AutoFix) -> Result<()> {
9595
if self.dry_run {
9696
self.output.info(&format!("[DRY RUN] Would apply: {}", fix.description));
97-
return Ok();
97+
return Ok(());
9898
}
9999

100100
match &fix.fix_type {

cargo-wrt/src/helpers/test_runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl TestRunner {
271271

272272
/// Output human-readable results
273273
fn output_human_results(&self, summary: &TestSummary) {
274-
println!("\n{}", "Test Results".bold);
274+
println!("\n{}", "Test Results".bold());
275275
println!("{}", "=".repeat(50));
276276

277277
// Summary stats

cargo-wrt/src/main.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ async fn main() -> Result<()> {
13241324
*fmt_check,
13251325
&mut global,
13261326
)
1327-
.await?
1327+
.await
13281328
},
13291329
Commands::Test {
13301330
package,
@@ -1347,7 +1347,7 @@ async fn main() -> Result<()> {
13471347
&cli,
13481348
&mut global,
13491349
)
1350-
.await?
1350+
.await
13511351
},
13521352
Commands::TestAsil {
13531353
asil,
@@ -1362,14 +1362,14 @@ async fn main() -> Result<()> {
13621362
*no_std_only,
13631363
&mut global,
13641364
)
1365-
.await?
1365+
.await
13661366
},
13671367
Commands::TestNoStd {
13681368
filter,
13691369
test_threads,
1370-
} => cmd_test_no_std(filter.clone(), *test_threads, &mut global).await?,
1370+
} => cmd_test_no_std(filter.clone(), *test_threads, &mut global).await,
13711371
Commands::TestConfig { output, example } => {
1372-
cmd_test_config(output.clone(), *example, &mut global).await?
1372+
cmd_test_config(output.clone(), *example, &mut global).await
13731373
},
13741374
Commands::Verify {
13751375
asil,
@@ -1391,7 +1391,7 @@ async fn main() -> Result<()> {
13911391
&cli,
13921392
&mut global,
13931393
)
1394-
.await?
1394+
.await
13951395
},
13961396
Commands::Docs {
13971397
open,
@@ -1406,37 +1406,37 @@ async fn main() -> Result<()> {
14061406
output_dir.clone(),
14071407
multi_version.clone(),
14081408
)
1409-
.await?
1409+
.await
14101410
},
14111411
Commands::Coverage {
14121412
html,
14131413
open,
14141414
format,
14151415
best_effort,
1416-
} => cmd_coverage(&build_system, *html, *open, format.clone(), *best_effort).await?,
1416+
} => cmd_coverage(&build_system, *html, *open, format.clone(), *best_effort).await,
14171417
Commands::Check { strict, fix } => {
1418-
cmd_check(&build_system, *strict, *fix, &mut global).await?
1418+
cmd_check(&build_system, *strict, *fix, &mut global).await
14191419
},
14201420
Commands::NoStd {
14211421
continue_on_error,
14221422
detailed,
1423-
} => cmd_no_std(&build_system, *continue_on_error, *detailed, &global.output).await?,
1423+
} => cmd_no_std(&build_system, *continue_on_error, *detailed, &global.output).await,
14241424
Commands::Wrtd {
14251425
variant,
14261426
test,
14271427
cross,
1428-
} => cmd_wrtd(&build_system, *variant, *test, *cross).await?,
1429-
Commands::Ci { fail_fast, json } => cmd_ci(&build_system, *fail_fast, *json).await?,
1430-
Commands::Clean { all } => cmd_clean(&build_system, *all, &mut global).await?,
1428+
} => cmd_wrtd(&build_system, *variant, *test, *cross).await,
1429+
Commands::Ci { fail_fast, json } => cmd_ci(&build_system, *fail_fast, *json).await,
1430+
Commands::Clean { all } => cmd_clean(&build_system, *all, &mut global).await,
14311431
Commands::VerifyMatrix {
14321432
report,
14331433
output_dir,
14341434
verbose,
1435-
} => cmd_verify_matrix(&build_system, *report, output_dir.clone(), *verbose).await?,
1435+
} => cmd_verify_matrix(&build_system, *report, output_dir.clone(), *verbose).await,
14361436
Commands::SimulateCi {
14371437
verbose,
14381438
output_dir,
1439-
} => cmd_simulate_ci(&build_system, *verbose, output_dir.clone()).await?,
1439+
} => cmd_simulate_ci(&build_system, *verbose, output_dir.clone()).await,
14401440
Commands::KaniVerify {
14411441
asil_profile,
14421442
package,
@@ -1452,7 +1452,7 @@ async fn main() -> Result<()> {
14521452
*verbose,
14531453
extra_args.clone(),
14541454
)
1455-
.await?
1455+
.await
14561456
},
14571457
Commands::Validate {
14581458
check_test_files,
@@ -1469,16 +1469,16 @@ async fn main() -> Result<()> {
14691469
*all,
14701470
*verbose,
14711471
)
1472-
.await?
1472+
.await
14731473
},
14741474
Commands::Setup {
14751475
hooks,
14761476
all,
14771477
check,
14781478
install,
1479-
} => cmd_setup(&build_system, *hooks, *all, *check, *install).await?,
1479+
} => cmd_setup(&build_system, *hooks, *all, *check, *install).await,
14801480
Commands::ToolVersions { command } => {
1481-
cmd_tool_versions(&build_system, command.clone()).await?
1481+
cmd_tool_versions(&build_system, command.clone()).await
14821482
},
14831483
Commands::Fuzz {
14841484
target,
@@ -1497,7 +1497,7 @@ async fn main() -> Result<()> {
14971497
*list,
14981498
package.clone(),
14991499
)
1500-
.await?
1500+
.await
15011501
},
15021502
Commands::TestFeatures {
15031503
package,
@@ -1512,7 +1512,7 @@ async fn main() -> Result<()> {
15121512
*groups,
15131513
*verbose,
15141514
)
1515-
.await?
1515+
.await
15161516
},
15171517
Commands::Testsuite {
15181518
extract,
@@ -1540,7 +1540,7 @@ async fn main() -> Result<()> {
15401540
*test_timeout_ms,
15411541
&mut global,
15421542
)
1543-
.await?
1543+
.await
15441544
},
15451545
Commands::Requirements { command } => {
15461546
cmd_requirements(
@@ -1550,7 +1550,7 @@ async fn main() -> Result<()> {
15501550
should_use_colors(&global.output_format),
15511551
&cli,
15521552
)
1553-
.await?
1553+
.await
15541554
},
15551555
Commands::Wasm { command } => {
15561556
cmd_wasm(
@@ -1560,7 +1560,7 @@ async fn main() -> Result<()> {
15601560
should_use_colors(&global.output_format),
15611561
&cli,
15621562
)
1563-
.await?
1563+
.await
15641564
},
15651565
Commands::Safety { command } => {
15661566
cmd_safety(
@@ -1570,7 +1570,7 @@ async fn main() -> Result<()> {
15701570
should_use_colors(&global.output_format),
15711571
&cli,
15721572
)
1573-
.await?
1573+
.await
15741574
},
15751575
Commands::EmbedLimits {
15761576
wasm_file,
@@ -2823,7 +2823,7 @@ async fn cmd_tool_versions(build_system: &BuildSystem, command: ToolVersionComma
28232823

28242824
match command {
28252825
ToolVersionCommand::Generate { force, all } => {
2826-
let workspace_root = build_system.workspace_root;
2826+
let workspace_root = build_system.workspace_root();
28272827
let config_path = workspace_root.join("tool-versions.toml");
28282828

28292829
if config_path.exists() && !force {
@@ -2908,7 +2908,7 @@ async fn cmd_tool_versions(build_system: &BuildSystem, command: ToolVersionComma
29082908
ToolVersionCommand::Update { tool, all } => {
29092909
println!("{} Updating tool-versions.toml...", "🔄".bright_blue());
29102910

2911-
let workspace_root = build_system.workspace_root;
2911+
let workspace_root = build_system.workspace_root();
29122912
let config_path = workspace_root.join("tool-versions.toml");
29132913

29142914
if !config_path.exists() {
@@ -3098,7 +3098,7 @@ async fn cmd_testsuite(
30983098

30993099
println!("{} Running WAST test suite...", "🧪".bright_blue());
31003100

3101-
let workspace_root = build_system.workspace_root;
3101+
let workspace_root = build_system.workspace_root();
31023102
eprintln!("DEBUG: workspace_root = {:?}", workspace_root);
31033103
eprintln!("DEBUG: wast_dir = {:?}", wast_dir);
31043104
let test_directory = workspace_root.join(&wast_dir);
@@ -3286,7 +3286,7 @@ async fn cmd_requirements(
32863286
Requirements,
32873287
};
32883288

3289-
let workspace_root = build_system.workspace_root;
3289+
let workspace_root = build_system.workspace_root();
32903290

32913291
match command {
32923292
RequirementsCommand::Init { path, force } => {
@@ -3668,7 +3668,7 @@ async fn cmd_wasm(
36683668
WasmVerifier,
36693669
};
36703670

3671-
let workspace_root = build_system.workspace_root;
3671+
let workspace_root = build_system.workspace_root();
36723672

36733673
match command {
36743674
WasmCommand::Verify {
@@ -3709,7 +3709,7 @@ async fn cmd_wasm(
37093709
println!("\n📋 Diagnostic Output:");
37103710
println!("───────────────────");
37113711
let formatter =
3712-
wrt_build_core::formatters::FormatterFactory::create(*output_format)?;
3712+
wrt_build_core::formatters::FormatterFactory::create(*output_format);
37133713
println!("{}", formatter.format_collection(&diagnostics));
37143714
}
37153715
}
@@ -4093,7 +4093,7 @@ async fn cmd_safety(
40934093
}
40944094

40954095
// Check certification readiness
4096-
let (readiness, diagnostics) = framework.check_certification_readiness(asil_level)?;
4096+
let (readiness, diagnostics) = framework.check_certification_readiness(asil_level);
40974097

40984098
// Format and display results
40994099
let formatter = wrt_build_core::formatters::FormatterFactory::create_with_options(
@@ -4397,7 +4397,7 @@ async fn cmd_safety(
43974397
asil_level,
43984398
};
43994399

4400-
let diagnostics = framework.record_test_result(test_result)?;
4400+
let diagnostics = framework.record_test_result(test_result);
44014401

44024402
let formatter = wrt_build_core::formatters::FormatterFactory::create_with_options(
44034403
*output_format,

0 commit comments

Comments
 (0)