-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the mono runtime test config #958
base: main
Are you sure you want to change the base?
Conversation
@lewing dotnet/runtime#103881 fixed the conflicting naming error, but now when running wit-bindgen with this PR changes I see this failure |
need to look at the performance here but csharp-mono tests are green with these changes |
@dicej
any thoughts? |
crates/csharp/src/csproj.rs
Outdated
@@ -190,9 +195,17 @@ impl CSProjectMonoBuilder { | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<NativeFileReference Include=\"{camel}_component_type.o\" Condition=\"Exists('{camel}_component_type.o')\"/> | |||
<_WasiLinkStepArgs Include=\"-Wl,--component-type,{camel}_component_type.wit\" /> | |||
<!-- both versions of these seem to fail to find the .o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wit-bindgen doesn't produce the object file directly anymore,
I've used:
<CustomLinkerArg Include="@(WitComponentImports->Replace('\', '/')->'-Wl,--component-type,"%(Identity)"')" />
Not sure if _WasiLinkStepArgs
is the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's another case of bad coevolution dotnet/runtime#107194 but they will be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolution there is that everybody should use LinkerArg over all the other options
haha, I see the problem now. That is what I get for not looking again in the morning before. |
As of dotnet/runtime#103752, the |
Sadly I was rushing to get it working last night before heading out, I should have looked again this morning. Sorry for the noise. |
Ok, so it was also very confusing that the features were chained so the native aot test build was writing over the mono tests once the compilation issue was fixed. the There do now appear to be a couple of failures on the mono side dotnet/runtime#107212 |
true => format!("<WasmBuildNative>{aot}</WasmBuildNative>"), | ||
false => String::new(), | ||
}; | ||
let tfm = "net9.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move to Net10 ?
Because we are not going to backport fixes to Net9, right ?
One more below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there won't be a working net10 sdk for a while unfortunately
let out_wasm = out_dir | ||
.join("bin") | ||
.join(configuration) | ||
.join("net9.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is only one of the issues here, build doesn't respect the project name, and the publish doesn't respect the output directory. @maraf we should discuss what options we have here
.arg(out_dir.join(format!("{camel}.csproj"))) | ||
.arg("-c") | ||
.arg("Debug") | ||
.arg(configuration) | ||
.arg("/p:PlatformTarget=AnyCPU") | ||
.arg("--self-contained") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me --self-contained
doesn't' work with 9.0.100-preview.6.24328.19
without workload. The publish doesn't fail but the file is located elsewhere and it's not single file.
After I install workload Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk version 9.0.0-preview.6.24327.7
I get
FooWorld failed with 4 error(s) (11.4s) → xxx\
wasm-ld : error : unknown argument: --component-type
wasm-ld : error : unknown file type: FooWorld_component_type.wit
Which makes sense for preview6.
With preview7 I get
1: error while executing at wasm backtrace:
0: 0x296a7b - .tmpJCkP17!fseek
1: 0x8efe - .tmpJCkP17!load_icu_data
2: 0x8ff4 - .tmpJCkP17!mono_wasm_load_runtime
3: 0x9299 - .tmpJCkP17!initialize_runtime
4: 0x92b8 - .tmpJCkP17!main
5: 0x28bc5c - .tmpJCkP17!__main_void
6: 0x7e78 - .tmpJCkP17!_start
7: 0xb40aff - wit-component:adapter:wasi_snapshot_preview1!wasi:cli/[email protected]#run
Which means <WasmSingleFileBundle>true</WasmSingleFileBundle>
didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing about this will work without the workload, I'm testing against daily builds of 9
using https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
and dotnet-install -c 9.0 -q daily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add <WasmBuildNative>true</WasmBuildNative>
to get it to produce a single file
.arg(out_dir.join(format!("{camel}.csproj"))) | ||
.arg("-c") | ||
.arg("Debug") | ||
.arg(configuration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.arg(configuration) | |
.arg(configuration) | |
.arg("-bl:publish-mono.binlog") |
Several of the issues I hit should be fixed in dotnet/runtime main, but it testing that will be challenging until a proper net10 sdk is produced. |
Update the build to get things working with the latest mono net9 targets