Repository navigation
systems: rename extant wasi targets to wasip1 - #537429
Conversation
|
Also: this is definitely worth a release note because there's a bit of a chance of breakage. |
| freebsd = "FreeBSD"; | ||
| openbsd = "OpenBSD"; | ||
| wasi = "Wasi"; | ||
| wasip1 = "WasiP1"; |
There was a problem hiding this comment.
Is there any actual uname -s that supports WASI and will output this? It seems like the null default may be more honest.
There was a problem hiding this comment.
I had the same thought, but this is actually critical to set: via CMake, determines the output path of libclang_rt s.t. clang can find it.
| # For historical reasons, Nixpkgs's wasi32 (i.e., without a revision number) corresponds to WASI p1. | ||
| wasi32 = { | ||
| config = "wasm32-unknown-wasi"; | ||
| config = "wasm32-unknown-wasip1"; | ||
| useLLVM = true; | ||
| }; |
There was a problem hiding this comment.
Perhaps we should rename this to wasm32-wasip1 and alias wasi32 to it. Later we could potentially add a warning.
There was a problem hiding this comment.
Yeah, does make sense to hit this at the same time as everything else.
| isWasiP1 = { | ||
| kernel = kernels.wasip1; | ||
| }; |
There was a problem hiding this comment.
It’s probably not going to be common to condition on this specifically? Maybe a case of YAGNI, since you can always just write out the pattern explicitly.
There was a problem hiding this comment.
Have a look at the wasip2 PR, where it makes a lot more sense for parallelism purposes, maybe? It does have two in-tree uses and I expect that to grow as things need to distinguish p1 from p2.
| wasip1 = { | ||
| execFormat = wasm; | ||
| families = { }; | ||
| }; |
There was a problem hiding this comment.
Perhaps we ought to have a family for WASI, as with BSD and Darwin. Then lib.systems.inspect.isWasi can use that, and will work with newer WASI versions.
There was a problem hiding this comment.
What're the criteria for considering something a 'family'? I would actually be quite suspicious of non-trivial things claiming to not care about p1 vs p2; they really are very different. (p2 and p3 have a lot of commonality, but that's looking further ahead than this PR.)
| else if args.kernel == "wasi" then | ||
| # For historical reasons, bare 'wasi' (i.e., without a revision number) corresponds to wasip1. | ||
| kernels.wasip1 |
There was a problem hiding this comment.
getKernel will already handle this, since you added an alias for wasi there. (I don’t know whether it makes sense to express the WASIp1 vs. WASIp2 difference as an “ABI” suffix – probably not?)
There was a problem hiding this comment.
Nifty, thanks! Less conditionals is more happy.
| wasm32-wasi = { | ||
| wasm32-wasip1 = { | ||
| magicOrExtension = ''\x00asm''; | ||
| mask = ''\xff\xff\xff\xff''; | ||
| }; | ||
| wasm64-wasi = { | ||
| wasm64-wasip1 = { | ||
| magicOrExtension = ''\x00asm''; | ||
| mask = ''\xff\xff\xff\xff''; | ||
| }; |
There was a problem hiding this comment.
I guess we could add aliases for these too, although it might not be important enough to.
There was a problem hiding this comment.
Yeah, I basically just hit these because they turned up while grepping. It's awkward because wasip2 will also match these magic numbers. I'm somewhat reluctant to think too hard about this because it's unlikely anything too critical is relying on it and it can be fixed up later if it does turn out to matter.
716e88e to
3b6552f
Compare
|
Urgh, this might also want a Firefox build to make sure I'm not breaking it... |
3b6552f to
3dfeeff
Compare
3dfeeff to
3f47455
Compare
|
Breaks Firefox. |
3f47455 to
8837975
Compare
|
Thanks - actually, that's early enough, in configurePhase, that I can hit it myself, so that's fixed and now firefox-unwrapped gets into buildPhase. |
8837975 to
5c57d14
Compare
|
Tested Firefox ESR/Rapid across aarch64-linux and x86_64-linux. |
5c57d14 to
8b6815c
Compare
|
I've chucked a release note on, and this idea has suddenly gained a dependent in the LLVM 22 work. I've let this sit for a few weeks and nothing in that time's made me think it's not ready for merging. |
|
|
||
| `buildGrammar` builds a native `$out/parser`. | ||
| To build grammars as WebAssembly instead, use the `wasi32` cross package set, which installs `$out/parser.wasm`: | ||
| To build grammars as WebAssembly instead, use the `wasim32-wasip1` cross package set, which installs `$out/parser.wasm`: |
There was a problem hiding this comment.
| To build grammars as WebAssembly instead, use the `wasim32-wasip1` cross package set, which installs `$out/parser.wasm`: | |
| To build grammars as WebAssembly instead, use the `wasm32-wasip1` cross package set, which installs `$out/parser.wasm`: |
There was a problem hiding this comment.
Poor Wasim has to be denied his chance at fame.
Wasi P2 is different enough to Wasi P1 to warrant being treated entirely separately, rather than as two minor variants of the same thing. P3 will likewise want to be a different target. I've left aliases in place; maybe eventually, those can be deprecated and removed. I've tested this, but it's possible there might be breakage somewhere (e.g., the canonical doubles for P1 have changed, though I can't imagine why anyone would rely on that). Fixes NixOS#435954
|
Sadly needs merge conflicts fixed up; I'm planning on merging it after that baring a late-breaking 👎 from my collaborators. |
8b6815c to
282a7d6
Compare
|
Rebased and pushed (and I think I put the relnote in the correct file this time). |
|
I built and tested Firefox. |
|
Thanks! |
|
So, there's no eval warning? |
Hm we don't have eval warnings for any other system aliases so far... But I agree this one might be worth pointing out. |
|
A warning for the target triple could be a good idea. I doubt that |
Wasi P2 is different enough to Wasi P1 to warrant being treated entirely separately, rather than as two minor variants of the same thing. P3 will likewise want to be a different target.
I've left aliases in place; maybe eventually, those can be deprecated and removed. I've tested this, but it's possible there might be breakage somewhere (e.g., the canonical doubles for P1 have changed, though I can't imagine why anyone would rely on that).
Fixes #435954
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.