Nix Cross Compiling | 581 Members | |
| 130 Servers |
| Sender | Message | Time |
|---|---|---|
| 6 Feb 2025 | ||
| 17:47:55 | ||
| 22:20:00 | ||
Hey peeps, I'm running into an issue building a rust package derivation for wasm32-unknown-none - I opened a forum post here: https://discourse.nixos.org/t/building-a-rust-package-derivation-using-buildrustpackage-for-wasm32-unknown-unknown | 23:24:29 | |
| Any help appreciated! | 23:24:31 | |
| I only tested this with buildRustCrate/crate2nix (Im the person who made that system type in nixpkgs) | 23:57:07 | |
| You don't need it for buildRustPackags from rustPlatform | 23:57:58 | |
| I believe | 23:58:01 | |
| I think you just need to set an option to append the --target flag | 23:58:32 | |
| Because we include that wasm32 target in the rustc by default | 23:59:05 | |
| Because it doesn't require any extra deps | 23:59:17 | |
| 7 Feb 2025 | ||
| * | 00:00:00 | |
| Yeah I looked for this initially, but I wasn't able to find a way to override the flag 🤔 I originally tried something like:
but then the actual build command just ended up with two commands: one for That lead me to these docs mentioning that the target is derived from the Sidenote: I'm very curious about | 00:04:27 | |
| Don't bother with buildRustCrate and crate2nix | 00:05:11 | |
| * Yeah I looked for this initially, but I wasn't able to find a way to override the flag 🤔 I originally tried something like:
but then the actual build command just ended up with two targets: one for That lead me to these docs mentioning that the target is derived from the Sidenote: I'm very curious about | 00:05:38 | |
| If you can handle the lack of granularity of buildRustPackage stick to it | 00:05:45 | |
In reply to @kranzes:matrix.orgI think they're doomed | 00:06:00 | |
| Crane maybe fine because it's still cargo | 00:06:11 | |
| But reimplementing cargo in Nix is miserable | 00:06:31 | |
| Way too much work and practically impossible to get right | 00:06:48 | |
| Anyway, figure out how to do that cross compilation with rustPlatform | 00:08:45 | |
| Got this working! Posted a small tutorial on the forum thread: https://discourse.nixos.org/t/building-a-rust-package-derivation-using-buildrustpackage-for-wasm32-unknown-unknown/59925/2?u=mindtree | 01:05:39 | |
| 03:34:18 | ||
| 22:28:01 | ||
| 23:10:50 | ||
| 23:18:50 | ||
| 23:19:57 | ||
| 8 Feb 2025 | ||
| 01:18:22 | ||
| 02:24:24 | ||
| 02:25:00 | ||
| Update: while the above^ works on It looks like even when just building a This was kind of expected after my experience on my mac, where the same happened, however on the mac they at least complete successfully after an hour or two. On my linux build machine, rustc fails to build during the bootstrap phase with a Shouldn't If so, what would be the best way to get hydra testing and building these? Would I need to add some simple I guess working out why rustc won't build is another issue, but at least with some basic package Also, another thing I'm noticing is that regardless of what I put in | 12:34:22 | |