Nix Cross Compiling | 580 Members | |
| 126 Servers |
| Sender | Message | Time |
|---|---|---|
| 17 Feb 2025 | ||
| Just wondering if there's anything that checks if buildPlatform and hostPlatform are the same and uses the top level definitions | 06:12:42 | |
| No, there isn't | 07:21:10 | |
| 16:06:50 | |
| there are some things that check whether you're doing cross, but not for the purpose of picking a different attribute path | 16:08:28 | |
| I think it's mostly about whether test suites can be run normally, or maybe configuring cross compilers | 16:09:34 | |
| a good deal of cross is just proper build time vs run time separation | 16:09:54 | |
| * I think it's mostly about whether test suites can be run normally, configuring cross compilers, etc | 16:10:24 | |
| Cool, looks like that covers all my curiosities. | 23:40:59 | |
| 18 Feb 2025 | ||
| 03:26:00 | ||
If, hypothetically, I was insane and wanted to cross compile for windows using pkgsCross.mingwW64, and I wanted to produce statically linked executables, is there any chance what could possibly work? trying pkgs.okgsCross.mingwW64.pkgsStatic.myPackage fails quite quickly, with mingw_w64-headers-static-12.0.0 quite sensibly reporting checking host system type... Invalid configuration 'x86_64-w64-windows-gnu': Kernel 'windows' not known to work with OS 'gnu'. (I assume that pkgsStatic attempts to use musl, which clearly won't work) | 05:30:23 | |
| No can do | 05:34:40 | |
| Windows doesn't really do static | 05:34:57 | |
| yeah ok - I guess I need to find out how windows packages things up | 06:10:01 | |
| 19 Feb 2025 | ||
| Is there a way to have Nix run a VM or something else to run things like tests when cross compiling? | 01:32:21 | |
In reply to @axman6:matrix.orgNo but in some cases it should be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow | 01:52:04 | |
| * No but in some cases it might be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow | 01:52:18 | |
| * No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages somehow` | 01:52:28 | |
| * No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages` somehow | 01:52:42 | |
| https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+%2F%5C.emulator%2F&type=code | 01:53:27 | |
| Ok, that helped me find https://nix.dev/tutorials/cross-compilation.html#real-world-cross-compiling-of-a-hello-world-example too, thanks | 01:57:46 | |
| now to figure out how to run x86_64 wine under some VM on aarch64-darwin 😂 | 01:59:05 | |
| If you want a linux builder https://nixcademy.com/posts/macos-linux-builder/ | 02:00:12 | |
| That looks shockingly simple. Is it possible for the VM to share the host's /nix/store? | 02:06:46 | |
| Oh actually, I assume remote builders will just do the build and pass back the results to the original build machine | 05:23:32 | |
| Let me know if there's a better place to ask (#Nix on macOS maybe?), but would bit be possible to also have a x86_64-linux VM using this? | 05:27:38 | |
In reply to @axman6:matrix.orgIt technically should be, the arch shouldn't matter too much imo. | 05:30:14 | |
| 20:06:15 | ||
| 20 Feb 2025 | ||
| 12:12:58 | ||
| 21 Feb 2025 | ||
In reply to @axman6:matrix.orgIf you are using nix-darwin Linux builder, there is a way to use Rosetta to build x86_64-linux binaries. If you’d rather, you could have a qemu VM window open up and use that. One moment, I can link you to some relevant issues and projects I’ve worked on for creating Linux VMs on MacOS. | 18:50:57 | |
| https://github.com/LnL7/nix-darwin/issues/1192 https://github.com/formthefog/lasr/blob/main/flake.nix#L217 | 18:53:57 | |