Make testing wasm on windows in runtimelab easier by using MSBuild IsOSPlatform not TargetOS#46105
Make testing wasm on windows in runtimelab easier by using MSBuild IsOSPlatform not TargetOS#46105yowl wants to merge 4 commits into
Conversation
|
Tagging subscribers to this area: @safern, @ViktorHofer Issue DetailsThis PR changes the switch for
|
|
What is the motivation for this? If we want to run tests on |
That's exactly the problem. The tests are hosted on Windows, |
|
I see. Shouldn't we instead do an and condition? |
Does this work today? |
|
It does if you have the runtime built on that target platform, but the tests should be platform agnostic. Not a big deal though, I don't think it is a common scenario, just trying to get the motivation behind doing this. A lot of our outputs depend on |
|
I notice some other scripts use |
|
See, runtime/src/libraries/externals.csproj Line 58 in 24a602b |
|
I have a similar problem with runtime/src/tests/Directory.Build.props Lines 140 to 143 in bbc6e7f For testing the Wasm tests on windows the properties are set: So |
|
Thanks for the feedback, I've changed it as requested, and changed https://github.com/dotnet/runtime/pull/46105/files#diff-95dbd50260986d2d3ad1a2a725d2bb0b240e8cbfd00e98f38b63bebcc2b6a64d being the other place I had an issue. |
ViktorHofer
left a comment
There was a problem hiding this comment.
I'm not a big fan of this change. Usually you only need an IsOSPlatform or $(OS) equals check if you invoke something that isn't supported on a certain OS. In my previous example, the OS condition is added as chmod is invoked which doesn't exist on Windows.
In the eng/testing/tests.targets cases, I don't see anything being invoked which would hinder cross-compiling hence I believe the existing conditions are fine as-is. Thoughts?
|
#45545 is fixing the browser/wasm build on Windows. The next step would be to also allow running the browser/wasm tests on Windows. It is where this PR is going. cc @steveisok @ViktorHofer What should be the command one uses to build and run the browser/wasm tests on Windows? Should it be something as simple as |
|
"if you invoke something that isn't supported on a certain OS". Edit: my comment above superceeded by #46105 (comment) |
|
Thanks for providing additional context on this change @jkotas.
Before wasm,
This is true for test invocation but the code path that you are touching is mainly about building the tests and preparing them for being run in CI. With your changes, we can't cross-build Unix tests anymore on Windows and vice-versa. |
|
The cross-compilation is always more advanced scenario. It does not always work, it requires special environment setup, and it is not unusual for it to need extra arguments. How about this:
|
|
I would like @safern to share his opinion regarding cross building and additional arguments as well. It's not yet clear to me, what the ideal solution would look like. |
|
@safern can you have a look? |
I think that proposal makes sense to me. (#46105 (comment)) Anyway, with that solution the current change is broken, because we have: <RunScriptInputName Condition="'$(TargetOS)' == 'Browser'">WasmRunnerTemplate.sh</RunScriptInputName>Which is at the end of the Are there any scenarios interesting to cross-compile other than |
|
@safern I notice mono added support for building on WIndows recently, I don't if the testing is enabled on Windows also? But maybe those changes have made this obsolete. I did try merging those mono changes into runtimelab (NativeAOT-LLVM branch), but haven't finished that. |
I'm not sure... @steveisok do you know? @yowl so it seems like we can close this PR on the meantime and re-visit if needed? |
|
@safern fine with me. |
@radekdoulik has been the one brining up windows and I do believe he has tests working. Unsure if it made its way up yet. |

This PR changes the switch for
.cmd/.shto be based on$([MSBuild]::IsOSPlatform('windows'))instead of'$(TargetOS)' == 'windows'This helps in running the Wasm tests on Windows in the runtimelab branch, and should be ok here in runtime. Will help with future merging.