!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
128 Servers

Load older messages


SenderMessageTime
15 Feb 2025
@alexfmpe:matrix.orgalexfmpe ah yeah no false alarm, I was building the wrong thing, the types.h and other errors are present in staging(-next) 01:06:05
@alexfmpe:matrix.orgalexfmpefixed this one at least: https://github.com/NixOS/nixpkgs/pull/38218201:23:07
@benjb83:matrix.orgBenjB83 joined the room.10:14:34
@benjb83:matrix.orgBenjB83 changed their display name from Benjamín Buske to BenjB83.10:43:28
16 Feb 2025
@kristijan.zic:matrix.orgKristijanZic joined the room.01:07:04
@jake:hillion.co.ukJake Hillion joined the room.18:26:31
17 Feb 2025
@axman6:matrix.orgAxman6 If you're building on a x86_64-linux system and you build pkgs.pkgsCross.gnu64.foo is there a difference between what it builds and what pkgs.foo? are there any checks that a cross compile isn't actually a cross compile? 06:11:55
@axman6:matrix.orgAxman6Just wondering if there's anything that checks if buildPlatform and hostPlatform are the same and uses the top level definitions06:12:42
@k900:0upti.meK900No, there isn't07:21:10
@alexfmpe:matrix.orgalexfmpe
$ nix-build -A hello
/nix/store/p09fxxwkdj69hk4mgddk4r3nassiryzc-hello-2.12.1
$ nix-build -A pkgsCross.gnu64.hello
/nix/store/p09fxxwkdj69hk4mgddk4r3nassiryzc-hello-2.12.1
16:06:50
@alexfmpe:matrix.orgalexfmpe 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
@alexfmpe:matrix.orgalexfmpeI think it's mostly about whether test suites can be run normally, or maybe configuring cross compilers 16:09:34
@alexfmpe:matrix.orgalexfmpea good deal of cross is just proper build time vs run time separation16:09:54
@alexfmpe:matrix.orgalexfmpe* I think it's mostly about whether test suites can be run normally, configuring cross compilers, etc16:10:24
@axman6:matrix.orgAxman6Cool, looks like that covers all my curiosities.23:40:59
18 Feb 2025
@mlaga97:matrix.mlaga97.space@mlaga97:matrix.mlaga97.space left the room.03:26:00
@axman6:matrix.orgAxman6 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
@k900:0upti.meK900No can do 05:34:40
@k900:0upti.meK900Windows doesn't really do static05:34:57
@axman6:matrix.orgAxman6yeah ok - I guess I need to find out how windows packages things up06:10:01
19 Feb 2025
@axman6:matrix.orgAxman6Is there a way to have Nix run a VM or something else to run things like tests when cross compiling?01:32:21
@artturin:matrix.orgArtturin
In reply to @axman6:matrix.org
Is there a way to have Nix run a VM or something else to run things like tests when cross compiling?
No but in some cases it should be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow
01:52:04
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up stdenv.hostPlatform.emulator buildPackages somehow01:52:18
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages somehow`01:52:28
@artturin:matrix.orgArtturin* No but in some cases it might be possible to hook up `stdenv.hostPlatform.emulator buildPackages` somehow 01:52:42
@artturin:matrix.orgArtturin https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+%2F%5C.emulator%2F&type=code 01:53:27
@axman6:matrix.orgAxman6Ok, that helped me find https://nix.dev/tutorials/cross-compilation.html#real-world-cross-compiling-of-a-hello-world-example too, thanks01:57:46
@axman6:matrix.orgAxman6now to figure out how to run x86_64 wine under some VM on aarch64-darwin 😂01:59:05
@artturin:matrix.orgArtturinIf you want a linux builder https://nixcademy.com/posts/macos-linux-builder/02:00:12
@axman6:matrix.orgAxman6That looks shockingly simple. Is it possible for the VM to share the host's /nix/store?02:06:46

Show newer messages


Back to Room ListRoom Version: 6