Nix Cross Compiling | 561 Members | |
| 121 Servers |
| Sender | Message | Time |
|---|---|---|
| 26 Dec 2024 | ||
| 15:26:06 | ||
| 15:26:48 | ||
| 27 Dec 2024 | ||
| I opened https://github.com/rust-lang/rust/issues/134811 against rustc while trying to debug https://github.com/NixOS/nixpkgs/pull/356769 if anyone here wants to save the rust people some pain | 00:53:53 | |
| 07:32:31 | ||
| 11:41:03 | ||
| 11:42:12 | ||
| 15:25:27 | ||
| 29 Dec 2024 | ||
| 11:03:18 | ||
| 14:29:44 | ||
| I think I discovered a fundamental issue with rust cross compilation in nixpkgs and I could use some help finding a solution. I was wondering why python bcrypt would build binaries for the build platform instead if the host platform and found out that This issue affects many packages in nixpkgs, and I would like to fix the root cause instead of working around it. The reason is that buildRustPackage consumes the non-spliced hooks via this inherit statement, and therefore them being put inside Most rust hooks have been designed with the wrong I was about to add proper splicing to those hooks and refactor most of them, but I'm questioning this approach now. Why even have splicing for hooks, as they should only ever be used inside | 14:53:33 | |
| * I think I discovered a fundamental issue with rust cross compilation in nixpkgs and I could use some help finding a solution. I was wondering why python bcrypt would build binaries for the build platform instead of the host platform and found out that This issue affects many packages in nixpkgs, and I would like to fix the root cause instead of working around it. The reason is that buildRustPackage consumes the non-spliced hooks via this inherit statement, and therefore them being put inside Most rust hooks have been designed with the wrong I was about to add proper splicing to those hooks and refactor most of them, but I'm questioning this approach now. Why even have splicing for hooks, as they should only ever be used inside | 14:53:53 | |
"Why even have splicing for hooks, as they should only ever be used inside nativeBuildInputs and nowhere else." seems wrong | 14:54:56 | |
| you might need to build a Rust program for the build platform in a derivation | 14:55:09 | |
in which case it should go in depsBuildBuild | 14:55:15 | |
(indeed this is normal to do via build.rs etc., but you can imagine e.g. Linux building a Rust tool among its other build-platform tools as a non-top-level-Cargo-driven example) | 14:55:54 | |
| OK thanks, then I guess I start refactoring | 15:11:16 | |
| if you can fix the setEnv nonsense that binds a tool chain way too early that would be great :p | 15:28:18 | |
Maybe setEnv turns out to be one of many workarounds that have been implemented just because the splicing was not applied correctly in all places. | 15:37:46 | |
| thanks for taking this on 💜 | 15:38:18 | |
| with cross-compiled glib being broken on master (it's downstream of | 16:46:25 | |
| if i PR them against master, then the reviewer can't just pull my PR branch & build it as they normally might | 16:46:57 | |
| unbound/glib is fixed in staging though | 16:47:51 | |
| so should i be PR'ing everything against staging, even if they're ordinary packages, just because that's the base branch for which all the prerequisites are building? | 16:48:42 | |
| Staging will probably be easier to keep track of | 17:12:15 | |
| 30 Dec 2024 | ||
Why is there a riscv64-unknown-linux-gnu-rustc in my dependency tree when cross compiling for riscv64? I thought rustc is platform agnostic and accepts a --target parameter. So why doe it need to be built for each cross platform? | 03:54:54 | |
* Why is there a riscv64-unknown-linux-gnu-rustc in my dependency tree when cross compiling for riscv64? I thought rustc is platform agnostic and accepts a --target parameter. So why do I need to be build it for each cross platform? | 03:55:20 | |
| Because you also need libstd | 05:38:40 | |
| Which we don't build for every target under the sun because that would make rustc massive | 05:38:56 | |
| I fixed the splicing for the rust hooks and refactored them + added tests. Review/Merge appreciated: https://github.com/NixOS/nixpkgs/pull/369424 | 15:26:16 | |
| This should improve cross compilation issues with various rust packages which are not based on buildRustPackage | 15:27:23 | |