-
Notifications
You must be signed in to change notification settings - Fork 257
c#: Update to use latest packages incorporating WasmImportLinkage #791
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
Conversation
Remove WasmImport from csproj Move cabi-realloc to c
redo import name
crates/csharp/src/lib.rs
Outdated
| namespace {namespace}.{name}; | ||
| // temporarily add this attribute until it is available in dotnet 9 | ||
| namespace System.Runtime.InteropServices |
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.
This is in a for loop so gets printed twice in some cases (which is why CI is failing)
I think we could move put this where internal static class Intrinsics was so it only gets printed once
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.
Thanks, Yes I have some more changes pending, but until the packages are published dotnet/runtimelab#2462, then I've left this as draft
tests/runtime/main.rs
Outdated
| csproj.generate()?; | ||
|
|
||
| // generate the cabi_realloc (and TODO: release) | ||
| let mut cmd_emcc = Command::new("emcc.bat"); |
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.
maybe this can be a task in the csproj.cs that builds if that c file is present?
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.
So that it builds as part of the user dotnet publish ?
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's what I was thinking, since its a file we generate and it needs to be compiled to be usable component
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.
Thanks, added to the csproj.
|
do we need bump the dotnet AOT compiler version anywhere? |
Yes we do. Incoming, when the packages publish. |
This PR removes the
WasmImporttag from the project file now that theWasmImportLinkageAttributehas been accepted upstream and merged into Ilc. Note that it is not in the published dotnet SDK yet so we need to add the attribute to the generated code until we update to dotnet 9 SDK (and tooling which supports it).Also moves
cabi_reallocto c code, fixing #777 . I did try a few things to avoid adding C code and invoking emcc to compile that code to a wasm object file.cc @jsturtevant @silesmo