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

[NativeAOT-LLVM] Merge tests when targeting Wasm #2695

Open
yowl opened this issue Sep 27, 2024 · 8 comments
Open

[NativeAOT-LLVM] Merge tests when targeting Wasm #2695

yowl opened this issue Sep 27, 2024 · 8 comments
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)

Comments

@yowl
Copy link
Contributor

yowl commented Sep 27, 2024

With the nativeaot merge test wrapper, what is the intention, if any, for how it should be used to run non-host, e.g. Wasm, tests. For windows-x64 it looks like nativeaot.dll is published as a NAOT exe, but for Wasm it would appear that dotnet run nativeaot.dll would be desired, we need the writing of the results file on the host, not the target, and NAOT'ing this dll does not appear to contribute much.

Is this thinking correct, before I go off changing things?

@SingleAccretion
Copy link

@jkoritzinsky would you have any advice? The only 'custom' thing in the WASM setup is that we modify nativeaottest.cmd/sh to do ./wasm-host.exe App.wasm instead of just ./App.exe.

@jkoritzinsky
Copy link
Member

My recommendation would be to merge some of the tests in-process instead of using the out-of-process model.

Alternatively, for now you can use the BuildAllTestsAsStandalone environment variable until I get around to the last bits of cleanup here.

@SingleAccretion
Copy link

SingleAccretion commented Sep 28, 2024

My recommendation would be to merge some of the tests in-process instead of using the out-of-process model.

This would not be feasible. NAOT tests are sensitive to whole program analysis effects, they need to be compiled separately. Additionally, some tests use a JS host that can't be moved in-process even in principle.

Edit: or did you mean to have one "merged test" per each actual test?

@yowl I would not have objections to some can-down-the-road kicking on this problem...

@jkoritzinsky
Copy link
Member

Some of the smoke tests can be merged. Others can't.

I'm also okay marking each test as a merged test, marked as containing tests in the assembly, and has the wrapper generator disabled. Should get close to the experience we want.

@yowl
Copy link
Contributor Author

yowl commented Sep 28, 2024 via email

@jkoritzinsky
Copy link
Member

When building for WASM, it uses the XHarness runner and writes to stdout instead.

If you want something that doesn't go through xharness for WASM, then you'll need to build something (as that's not a scenario I had to handle in main so I didn't). I'd recommend hooking into whatever the libraries tests do (if you have those running).

@jkoritzinsky
Copy link
Member

Yes that's what I was referring to. That file IO is just deleting temp files (on iOS and Android) and no-ops on Wasm today I think (as everything is guarded by File.Exists).

Either that or it's using some sort of synthetic filesystem (which is also fine).

@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

No branches or pull requests

4 participants