| 10 Mar 2025 |
loudgolem | 😅 I had to sleep | 02:53:09 |
loudgolem | is pkgsCross.wasi32.buildPackages.rustc supposed to work normally /p.q? | 02:54:52 |
loudgolem | * is pkgsCross.wasi32.buildPackages.rustc supposed to work normally /p.q\? | 02:54:55 |
loudgolem | * is pkgsCross.wasi32.buildPackages.rustc supposed to work normally? | 02:55:05 |
Andrew | In reply to @phanirithvij:matrix.org 😅 I had to sleep Understandable. | 03:34:48 |
Andrew | I did find some context for this: https://github.com/rust-lang/rust/issues/73432#issuecomment-647079886 | 03:49:21 |
Andrew | emily, so is the pkgsCross.wasi32.buildPackages.rustc broken then? | 10:13:17 |
Cathal | Andrew: I've been looking into WASI cross compilation lately. Managed to get it working, but required quite a few 'hacks'. See the overlays here: https://github.com/DuskSystems/nix-zed-extensions | 19:29:05 |
Andrew | Is this the whole hack?
final: prev: {
# Setup custom 'wasm32-wasip2' target.
# Dont touch 'wasi32', since it would trigger a Firefox recompilation.
pkgsCross = prev.pkgsCross // {
wasm32-wasip2 = import prev.path {
inherit (prev) system;
crossSystem = prev.lib.systems.examples.wasi32 // {
rust = {
rustcTarget = "wasm32-wasip2";
};
};
};
};
}
| 22:33:09 |
Andrew | * Is this the whole hack?
final: prev: {
# Setup custom 'wasm32-wasip2' target.
# Dont touch 'wasi32', since it would trigger a Firefox recompilation.
pkgsCross = prev.pkgsCross // {
wasm32-wasip2 = import prev.path {
inherit (prev) system;
crossSystem = prev.lib.systems.examples.wasi32 // {
rust = {
rustcTarget = "wasm32-wasip2";
};
};
};
};
}
| 22:33:27 |
Cathal | no, thats just creating a custom cross target, since i specifically needed wasip2, where nix defaults to wasip1 | 22:34:04 |
Cathal | the other overlay has the bulk of the hack | 22:34:23 |
Cathal | the tldr is: build a mock wasi-sdk, and setup the correct env variable to let rustc use it. then include libunwind as well. then use lld for linking | 22:36:11 |
Cathal | i can create a minimal reproduction, gimme a few mins | 22:39:16 |
Andrew | looks awful, but I see the already known libunwind and wasi-sdk packages, so I guess the truth was somewhere very close. | 22:43:32 |
Andrew | that is indeed quite a few hacks | 22:43:57 |
Andrew | I would say a lot, probably. | 22:44:16 |
Andrew | I hope this wouldn't trigger an llvm rebuild, otherwise it's joever. | 22:45:28 |
Andrew | * I hope this won't trigger an llvm rebuild, otherwise it's joever. | 22:45:39 |
Andrew | * I hope this won't trigger the llvm rebuild, otherwise it's joever. | 22:45:44 |
Cathal | this should work: https://github.com/CathalMullan/rust-wasi-nix | 22:53:31 |
Cathal | but you'll prob need to recompile llvm | 22:53:40 |
Andrew | I think at this point, it's definitely not how it supposed to work, so should be a bug. | 23:35:00 |
Andrew |  Download sadge 2x.webp | 23:35:37 |
Cathal | yeah, all of this should 'just work', but since very few people currently rely on wasi, its never really tested. hopefully one day none of these hacks will be needed | 23:37:53 |
Andrew | I mean... I'm pretty sure you can singlehandedly fix it if you make a patch to nixpkgs. | 23:46:56 |
Andrew | Though idk if these are hacks or just missing pieces of the puzzle | 23:48:23 |
| 11 Mar 2025 |
| @fxomt:we2.ee joined the room. | 05:29:52 |
| blackglasses joined the room. | 08:08:41 |
Adam Neverwas | Is anyone using Bevy? | 23:23:43 |