Nix Cross Compiling | 580 Members | |
| 129 Servers |
| Sender | Message | Time |
|---|---|---|
| 7 Jun 2026 | ||
| 14:19:10 | ||
Hey - I'm trying to do some cross x64 -> aarch64 and am finding some packages aren't building (RN it's tree-sitter). Is there a guide somewhere for how to go about debugging packages in the nixpkgs repo? | 14:20:24 | |
| There's really no simple answer here | 14:20:51 | |
| Very few upstreams actually test cross compilation | 14:20:59 | |
| So the process is usually "look at the build error really hard and try to figure out what's going wrong" | 14:21:17 | |
I'm happy to debug the build - I just need to figure out how to go from nixpkgs to a shell.nix or similar. | 14:21:35 | |
* I'm happy to debug the build - I just need to figure out how to go from nixpkgs/../package.nix to a shell.nix or similar. | 14:21:51 | |
In my case the error is unknown type name '__SVFloat32_t', so I suspect fixing it will involve providing some SVE symbols or perhaps turning SVE usage off when cross-compiling | 14:24:29 | |
nix-shell -A <foo> | 14:25:00 | |
Or rather, in your specific case, probably nix-shell -A pkgsCross.aarch64-multiplatform.foo | 14:25:14 | |
| Would that use my own local copy of nixpkgs, so I can start debug/run cycling? | 14:26:21 | |
oh - I think I understand - I go to the root of nixpkgs and then run that to use a particular attribute rather than the root attribute? | 14:28:20 | |
| Yes | 14:28:50 | |
| I think that was the thing I wasn't understanding. Thanks | 14:29:14 | |
| 21:07:32 | ||
| 8 Jun 2026 | ||
| 00:35:30 | ||
| 10 Jun 2026 | ||
| is there a guide for how to use windows.pthreads? I have some rust code I'm trying to cross compile from x86_64-linux to mingw-ucrt-x86_64-llvm, but hit a snag on needing pthreads. I added it but then I get the supported platform error since it doesn't include any platforms. What's the intended way of using it? Forgive my sloppy code, but here's what I currently have:
| 18:28:06 | |
| * is there a guide for how to cross compile to windows? I have some rust code I'm trying to cross compile from x86_64-linux to mingw-ucrt-x86_64-llvm, but hit a snag on needing pthreads. I added it but then I get the supported platform error since it doesn't include any platforms. What's the intended way of using it? Forgive my sloppy code, but here's what I currently have:
| 18:49:17 | |
| Ah so the pthreads problem was with libc, it hasn't even gotten to my build yet:
| 19:58:03 | |
| Is mingw just broken atm? | 19:58:57 | |
* Is mingw-ucrt-x86_64-llvm just broken atm? | 19:59:55 | |
| cross compiling is best effort as a general rule | 20:20:13 | |
| meaning that if nobody cares about a specific triple enough to compile stuff regularly with it and to contribute fixes, it will most probably be broken | 20:21:42 | |
| 11 Jun 2026 | ||
I was able to make it work with mingwW64 and some extra environment variables. mingw-ucrt-x86_64-llvm is indeed borked at the moment. | 02:54:09 | |
Yeah the ucrt code paths are not as well tested. Crane also has weird cross behavior itself, and rustPlatform is more reliable for Rust cross. If you cannot got it to cross with rustPlatform, you can open an issue on Nixpkgs with some logs and an MVP, and post in #windows:nixos.org. One of us may look into it. | 15:21:59 | |
| The crane cross story has gotten more reliable not too long ago | 15:47:46 | |
| I'll give that a try though if I get an ABI mismatch. Was trying to compile a DLL for an application. | 15:48:13 | |
| 23 May 2021 | ||
| 12:31:03 | ||
| 12:31:03 | ||
| 12:31:18 | ||