Skip to content

Commit 1b1d549

Browse files
committed
Tweak the output path again and attempt to resolve the component linking
1 parent 43ca36b commit 1b1d549

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

crates/csharp/src/csproj.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl CSProjectMonoBuilder {
186186
<Nullable>enable</Nullable>
187187
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
188188
<WasmGenerateAppBundle>true</WasmGenerateAppBundle>
189+
<WasmBuildNative>true</WasmBuildNative>
189190
</PropertyGroup>
190191
191192
<PropertyGroup>
@@ -194,7 +195,10 @@ impl CSProjectMonoBuilder {
194195
</PropertyGroup>
195196
196197
<ItemGroup>
197-
<NativeLibrary Include=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c\" />
198+
<_WasiLinkStepArgs Include=\"-Wl,--component-type,{camel}_component_type.wit\" />
199+
<!-- both versions of these seem to fail to find the .o
200+
<_WasiLinkStepArgs Include=\"-Wl,--component-type,&quot;$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '{camel}_component_type.wit').Replace('\\','/'))&quot;\" />
201+
-->
198202
</ItemGroup>
199203
200204
<Target Name=\"_FixRootAssembly\" AfterTargets=\"PrepareForILLink\">

tests/runtime/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
553553
csproj.generate()?;
554554

555555
let dotnet_root_env = "DOTNET_ROOT";
556+
let configuration = "Debug";
556557
let dotnet_cmd: PathBuf;
557558
match env::var(dotnet_root_env) {
558559
Ok(val) => dotnet_cmd = Path::new(&val).join("dotnet"),
@@ -566,7 +567,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
566567
cmd.arg("publish")
567568
.arg(out_dir.join(format!("{camel}.csproj")))
568569
.arg("-c")
569-
.arg("Debug")
570+
.arg(configuration)
570571
.arg("/p:PlatformTarget=AnyCPU")
571572
.arg("--self-contained")
572573
.arg("-o")
@@ -586,7 +587,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
586587
panic!("failed to compile");
587588
}
588589

589-
//let out_wasm = out_wasm.join(assembly_name);
590+
let out_wasm = out_dir.join("bin").join(configuration).join("net9.0").join("AppBundle").join(assembly_name);
590591
let mut wasm_filename = out_wasm.clone();
591592
wasm_filename.set_extension("wasm");
592593

0 commit comments

Comments
 (0)