Nix Cross Compiling | 561 Members | |
| 121 Servers |
| Sender | Message | Time |
|---|---|---|
| 25 Dec 2024 | ||
In reply to @kuruczgy:matrix.orga different program im using expects unknown :/ | 23:15:11 | |
(Also it's crossSystem not crossPlatform, but hopefully that's just a typo in your message and not your code.) | 23:15:13 | |
I assume you are getting "error: Unknown kernel: unknown" when you try riscv32-unknown-elf. riscv32-unknown-none-elf does seem to work. What does this "different program" depend on exactly? Expecting crossPlatform to be a particular string sounds quite strange | 23:21:48 | |
| im trying to get riscof to work, and it asks for a specific gcc toolchain | 23:22:41 | |
| i could replace all uses of unknown with none, but im already out of my depth, i dont want to add more points of failure | 23:23:08 | |
Ah I see, it hardcodes the riscv32-unknown-elf prefix everywhere. Nixpkgs will always include the kernel name in the prefix, so you cannot have it without none: https://github.com/NixOS/nixpkgs/blob/444c1e08d4fc93dd5a53ff052397d2d2b26dfe7a/lib/systems/parse.nix#L542 | 23:38:29 | |
You probably want to define some aliases somehow. (Or just search&replace in the whole source in patchPhase -unknown-elf with -unknown-none-elf | 23:39:31 | |
* You probably want to define some aliases somehow. (Or just search&replace in the whole source in something like patchPhase -unknown-elf with -unknown-none-elf) | 23:39:52 | |
| 26 Dec 2024 | ||
| 01:41:00 | ||
| 01:41:51 | ||
| 15:21:53 | ||
| 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 | |