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] Setting WasmBuildNative to false produces no output wasm binary #96863

Closed
silesmo opened this issue Jan 11, 2024 · 7 comments · Fixed by #98087
Closed

[wasm] Setting WasmBuildNative to false produces no output wasm binary #96863

silesmo opened this issue Jan 11, 2024 · 7 comments · Fixed by #98087
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono
Milestone

Comments

@silesmo
Copy link

silesmo commented Jan 11, 2024

Description

Adding the following <WasmBuildNative>false</WasmBuildNative> to a property group in csproj and then building a project results in a successful build but no wasm binary is produces.

Related: #96419

@AaronRobinsonMSFT @lewing @yowl @jsturtevant

Reproduction Steps

Add <WasmBuildNative>false</WasmBuildNative> and to Numbers.csproj in example project found below and build.
https://github.com/silesmo/wasm-unmanaged-callers-bug/blob/main/mono-example/Numbers.csproj

Expected behavior

I would expect a non AoT build to be performed and a wasm binary to be outputted.

Actual behavior

Successful build but no wasm binary produced.

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

Is this with a browser-wasm or wasi-wasm project?

@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

Adding the following <WasmBuildNative>false</WasmBuildNative> to a property group in csproj and then building a project results in a successful build but no wasm binary is produces.

Related: #96419

@AaronRobinsonMSFT @lewing @yowl @jsturtevant

Reproduction Steps

Add <WasmBuildNative>false</WasmBuildNative> and to Numbers.csproj in example project found below and build.
https://github.com/silesmo/wasm-unmanaged-callers-bug/blob/main/mono-example/Numbers.csproj

Expected behavior

I would expect a non AoT build to be performed and a wasm binary to be outputted.

Actual behavior

Successful build but no wasm binary produced.

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: -

@radical
Copy link
Member

radical commented Jan 12, 2024

Is this with a browser-wasm or wasi-wasm project?

This seems to be a wasi-wasm project. What was the build output?

@radical radical self-assigned this Jan 12, 2024
@radical radical removed the untriaged New issue has not been triaged by the area owner label Jan 12, 2024
@radical
Copy link
Member

radical commented Jan 12, 2024

How did you try to build this? I can build it locally, and get:

$ ls bin/Debug/net9.0/wasi-wasm/AppBundle
csharp-wasm.runtimeconfig.json  node.mjs                        run-wasmtime.sh*
dotnet.wasm*                    run-node.sh*                    tmp/
```

Make sure you have the `wasi-experimental` workload.

@silesmo
Copy link
Author

silesmo commented Jan 12, 2024

How did you try to build this? I can build it locally, and get:

$ ls bin/Debug/net9.0/wasi-wasm/AppBundle
csharp-wasm.runtimeconfig.json  node.mjs                        run-wasmtime.sh*
dotnet.wasm*                    run-node.sh*                    tmp/

Make sure you have the wasi-experimental workload.

Yes that's what I get as well. But that's not the correct wasm file. It should be named charp-wasm.wasm. If you inspect the wasm file you have there you will see it only contains the dotnet mono runtime and not the code for the project. @radical

@radical
Copy link
Member

radical commented Jan 12, 2024

WasmBuildNative=false means we don't relink dotnet, so you get the default dotnet.wasm that you can use to run the assembly.
Don't set that if you want to get a single .wasm with everything, and use WasmSingleFileBundle=true.

@silesmo
Copy link
Author

silesmo commented Jan 12, 2024

Oh okay, that wasn't apparent from the name. I did use WasmSingleFileBundle=true at the same time but that still resulted in the same output as you got. If the settings aren't compatible with each other shouldn't that produce an error or warning or something? @radical

@lewing lewing assigned maraf and mkhamoyan and unassigned radical and maraf Feb 5, 2024
@lewing lewing added this to the 9.0.0 milestone Feb 5, 2024
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 7, 2024
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 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
Projects
None yet
5 participants