Skip to content

Commit

Permalink
Tweak the output path again and attempt to resolve the component linking
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Aug 30, 2024
1 parent 43ca36b commit 1b1d549
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion crates/csharp/src/csproj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ impl CSProjectMonoBuilder {
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WasmGenerateAppBundle>true</WasmGenerateAppBundle>
<WasmBuildNative>true</WasmBuildNative>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -194,7 +195,10 @@ impl CSProjectMonoBuilder {
</PropertyGroup>
<ItemGroup>
<NativeLibrary Include=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c\" />
<_WasiLinkStepArgs Include=\"-Wl,--component-type,{camel}_component_type.wit\" />
<!-- both versions of these seem to fail to find the .o
<_WasiLinkStepArgs Include=\"-Wl,--component-type,&quot;$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '{camel}_component_type.wit').Replace('\\','/'))&quot;\" />
-->
</ItemGroup>
<Target Name=\"_FixRootAssembly\" AfterTargets=\"PrepareForILLink\">
Expand Down
5 changes: 3 additions & 2 deletions tests/runtime/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
csproj.generate()?;

let dotnet_root_env = "DOTNET_ROOT";
let configuration = "Debug";
let dotnet_cmd: PathBuf;
match env::var(dotnet_root_env) {
Ok(val) => dotnet_cmd = Path::new(&val).join("dotnet"),
Expand All @@ -566,7 +567,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
cmd.arg("publish")
.arg(out_dir.join(format!("{camel}.csproj")))
.arg("-c")
.arg("Debug")
.arg(configuration)
.arg("/p:PlatformTarget=AnyCPU")
.arg("--self-contained")
.arg("-o")
Expand All @@ -586,7 +587,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec<PathBuf>> {
panic!("failed to compile");
}

//let out_wasm = out_wasm.join(assembly_name);
let out_wasm = out_dir.join("bin").join(configuration).join("net9.0").join("AppBundle").join(assembly_name);
let mut wasm_filename = out_wasm.clone();
wasm_filename.set_extension("wasm");

Expand Down

0 comments on commit 1b1d549

Please sign in to comment.