Skip to content
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

[wasm] NativeLibrary doesn't include file #96864

Closed
silesmo opened this issue Jan 11, 2024 · 4 comments · Fixed by #101532
Closed

[wasm] NativeLibrary doesn't include file #96864

silesmo opened this issue Jan 11, 2024 · 4 comments · Fixed by #101532
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@silesmo
Copy link

silesmo commented Jan 11, 2024

Description

With native-aot-llvm we are able to link a component type file by adding <NativeLibrary Include=\"{world_name}_component_type.o\" /> to the csproj file. With mono this doesn't do anything.

The object file is in reality an empty Wasm module that just contains two custom sections component-type:<WORLD_NAME> and linking.

Related: #96419

@AaronRobinsonMSFT @lewing @yowl @jsturtevant

Reproduction Steps

Add <NativeLibrary Include="numbers_component_type.o" />to Numbers.csproj in example: https://github.com/silesmo/wasm-unmanaged-callers-bug/tree/main/mono-example
and build.

Expected behavior

For the custom sections from the numbers_component_type.o to be included in the produced wasm file.

Actual behavior

Does nothing.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 11, 2024
@radical
Copy link
Member

radical commented Jan 11, 2024

For mono you need to use @(NativeFileReference).

@radical radical added the arch-wasm WebAssembly architecture label Jan 11, 2024
@ghost
Copy link

ghost commented Jan 11, 2024

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

With native-aot-llvm we are able to link a component type file by adding <NativeLibrary Include=\"{world_name}_component_type.o\" /> to the csproj file. With mono this doesn't do anything.

The object file is in reality an empty Wasm module that just contains two custom sections component-type:<WORLD_NAME> and linking.

Related: #96419

@AaronRobinsonMSFT @lewing @yowl @jsturtevant

Reproduction Steps

Add <NativeLibrary Include="numbers_component_type.o" />to Numbers.csproj in example: https://github.com/silesmo/wasm-unmanaged-callers-bug/tree/main/mono-example
and build.

Expected behavior

For the custom sections from the numbers_component_type.o to be included in the produced wasm file.

Actual behavior

Does nothing.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: silesmo
Assignees: -
Labels:

arch-wasm, untriaged, area-Build-mono

Milestone: -

@lewing lewing added this to the 9.0.0 milestone Jan 26, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 26, 2024
@lewing
Copy link
Member

lewing commented Jan 26, 2024

As @radical mentioned this is because the features coevolved. For .NET9 the plan is to resolve (as much as is practical) the differences in the build.

@lewing
Copy link
Member

lewing commented Apr 1, 2024

@mkhamoyan to start this work we should add NativeLibrary items to the NativeFileReference items in the mono build.

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Apr 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants