-
Notifications
You must be signed in to change notification settings - Fork 223
Fix build and tests for wasm32-wasip2 target #599
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
Conversation
b7f29fb to
a4e718c
Compare
|
FWIW this is the configuration CI uses to test with an example log here. Can you clarify in the context of that the command you're using which is failing before and passing after? I've no doubt the makefiles could be cleaned up a bit, but at the source it'd be unexpected if p2 tests didn't work at all |
|
@alexcrichton I'll take a look. Also, I pushed some code that should have been on a different branch -- I'll fix that. |
1c71bb9 to
dcc221c
Compare
|
Starting from scratch, what I'm running is: and looking at the compile commands, I see: The build of wasi-libc does work for me if I use, as in the CI config: But the logic in the Makefile seems to suggest that this should work with just |
|
(I know there are some CI errors, which I'll also look at -- but in the meantime, would appreciate comments on whether this is the right direction.) |
|
Ok yeah that sounds reasonable to support using just
For the component-ld bits, if you're willing, my goal is to get the testing pretty close to what the toolchain does "for real" in the wasi-sdk artifacts which is to use Also, if you'd like, it might be good to land some sort of small PR first so that way your PRs will auto-trigger CI. The permissions on this repository are such that first-time-contributors need approval for workflows so it might help the feedback cycle if you get a PR landed on the side (e.g. a typo fix, add a newline somewhere, etc) |
|
Oh sure, I'll be happy to land a small PR. Will work on the rest of it once I've done that. |
|
For the various errors on CI here (sorry for the state of things, this is a lot...)
For the second point about |
As suggested by @alexcrichton in a comment on #599 , I'm submitting a small PR so that my future PRs will auto-trigger CI.
|
@alexcrichton Re: updating clang to clang-19: I noticed that in https://github.com/WebAssembly/wasi-libc/blob/45252554b765e3db11d0ef5b41d6dd290ed33382/.github/workflows/main.yml there are several different clang versions used. For MacOS, for example, it's 15.0.7 instead of 16. And I assume you don't want to break clang 11, since there's an item for that. So are you suggesting changing the clang version to 19 everywhere, or only in the section under "Test various combinations of target triples"? Basically, do you want only clang-19 to be supported? |
|
If that works yeah I think that's reasonable to upgrade across-the-board. If that runs into snags though I think it's also reasonable to just upgrade wasm32-wasip2 and leave the others for later. I'd agree though that we don't want to drop older clang support just yet (at least not while it's "easy" to retain support for older lcang), so keeping 11 in the list of versions tested is fine. |
|
@alexcrichton I've upgraded to clang-19 and fixed the Windows and threads builds. |
|
Ah good point! I'd recommend editing the setup action to download precompiled binaries of wasm-component-ld and adding them to |
|
Waiting for CI so I can verify that wasm32-wasip2 is fixed, but I think all that's left to do is:
|
|
Nice! This looks reasonable to me to land, so wanna go ahead and land this as-is? The other bits can be follow-ups as necessary. Removing |
|
Sounds good! I'll squash and mark as ready for review. |
| - name: Test wasm32-wasi-simd | ||
| os: ubuntu-24.04 | ||
| clang_version: 16 | ||
| clang_version: 19 |
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.
Why this version update? If we are bumping the min clang version needed to build libc do we also need to update the docs somewhere?
Should this be its own change, or is it related the wasip2 stuff?
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.
Alex suggested the version update in #599 (comment) . It is related to the wasip2 stuff. I thought it made the most sense to update the version for all targets (except the LLVM 11 target).
Currently the root README.md doesn't specify a minimum clang version, although maybe it should?
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.
Yeah it's required to update to work with wasm32-wasip2, and if we're updating one I figured it was fine to update them all.
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.
If we still have at least one builder on LLVM 11 then i guess that means we are still testing the same min version. SGTM.
BTW why do the other needed updating but not that one?
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.
Oh, I guess its because we don't test any of the p3 stuff with the llvm 11 clang versio. lgtm then.
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.
Updating other builders is not required, but I'd also say it's more consistent to test the same version in the "main body of tests" instead of having a random mish mash of versions which is a historical record of latest-when-someone-last-touched-this which is tough to explain.
- Fix setting of TARGET_TRIPLE in Makefile when WASI_SNAPSHOT or THREAD_MODEL is set - Run `make builtins` by default - Fix paths used when running `make builtins` on Windows - When building wasip2 tests, pass --skip-wit-component flag to linker in first step (when building the core module) - Upgrade clang to version 19 (20 on Windows as the installer for 19 didn't seem to include wasm targets) - Download wasm-component-ld when building for Linux
52c7f2c to
b2d5b3c
Compare
Trying to build wasi-libc for the
wasm32-wasip2target and run the tests, I noticed a few issues:TARGET_TRIPLEwas being used before definition, in the definition ofOBJDIR.TARGET_TRIPLEtowasm32-wasip2.This always left the target as
wasm32-wasi, since it was defined to that in a previous line.builtinswasn't being built by default, so building the tests would fail because it was unable to findlibclang_rt.builtins.a.make testdidn't take theWASI_SNAPSHOTvariable into consideration.clang --target=wasm32-wasip2was building a P2 component,which caused the subsequent
wasm-tools component newto fail because the inputwas already a component.
This PR fixes these issues. Now I'm able to run the tests with
WASI_SNAPSHOT=p2.