-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add runtimeconfig.json support for WebAssembly #56486
Conversation
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 embedding changes LGTM. There's a couple of unnecessary things copied over from the hot reload functional test that I don't think you need.
Not sure about the Wasm infrastructure changes. @radekdoulik or @radical could oyu review those?
...ctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
Outdated
Show resolved
Hide resolved
...ctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
Outdated
Show resolved
Hide resolved
...ctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
Outdated
Show resolved
Hide resolved
src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js
Outdated
Show resolved
Hide resolved
src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/Program.cs
Outdated
Show resolved
Hide resolved
...ctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
Outdated
Show resolved
Hide resolved
...ctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
Outdated
Show resolved
Hide resolved
Does this PR mean that setting environment variables like this would work? If so, then that should be included in the Wasm.Build.Tests test being added for runtimeconfig. |
Not for this PR, but we maybe need to handle the case when you have {
"runtimeOptions": {
"configProperties": {
"System.Globalization.Invariant": true
}
}
} .. in your |
My |
|
What happens if you only set the If so, then in case of wasm, we need to link out relevant bits, IIUC, and for that wasm targets would need to read the config file. |
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 a good start but doesn't look like it will work in blazor apps
Lane |
There are some disabled tests with ActiveIssue on #38433 being fixed here, which should be enabled in this PR. |
16efe2f
to
e284581
Compare
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.
Looks good, just couple of comments
This fixes the build for ApplyUpdateReferencedAssembly.csproj, which is a support project for HotReload wasm functional test. ``` D:\workspace\_work\1\s\src\mono\wasm\build\WasmApp.targets(131,5): error : Could not find D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.runtimeconfig.json for D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.dll. [D:\workspace\_work\1\s\src\tests\FunctionalTests\WebAssembly\Browser\HotReload\ApplyUpdateReferencedAssembly\ApplyUpdateReferencedAssembly.csproj] ``` The wasm targets should be run at all for this project. But they are run because they get imported by tests.wasm.targets, which gets imported because `$(IsTestProject)=true`. The csproj has `$(IsTestProject)=false`, and `$(IsTestSupportProject)=true`, which should mean that the test.props/targets don't get imported. But the import is conditioned on `$(EnableTestSupport)`, which gets set in `src/libraries/Directory.Build.props`. And that means setting `$(IsTestProject)=true` in the csproj is too late. So, instead, set that in a `Directory.Build.props`. And also, ensure that the `Directory.Build.props` for functional tests doesn't override the value!
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.
LGTM, thanks for your patience! 👍
Added runtimeconfig.json support for WebAssembly.
Fixes #38433
Added a test for it.
Fixes #50908
Also added a test to
Wasm.Build.Tests
, thanks to @radical