!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

581 Members
130 Servers

Load older messages


SenderMessageTime
3 Jun 2026
@lorne:cons.org.nzlorneturning off systemd in init was enough to boot to all the way to a shell, but I'm no further ahead. keyboard input produces squares, and networking isn't up so I can't ssh in either.16:26:30
@charles:computer.surgeryCharles left the room.20:04:00
4 Jun 2026
@callmeecho:matrix.orgEcho changed their profile picture.04:23:45
@flashonfire:lithium.ovhguillaume changed their display name from Guillaume to flashonfire.16:40:47
5 Jun 2026
@flashonfire:lithium.ovhguillaume changed their display name from flashonfire to guillaume.12:07:11
@thewholeworldisburning123:rougebordeaux.xyzkiffeuse4life67 changed their profile picture.14:17:36
@9lore:tchncs.de9lore changed their display name from 9lore to 9lore | call LORE.14:35:05
@zimward:zimward.moezimward changed their display name from zimward to zimward @GPN24.19:37:40
7 Jun 2026
@fgrsnau:matrix.org@fgrsnau:matrix.org left the room.13:42:38
@richarddodd:matrix.orgricharddodd joined the room.14:19:10
@richarddodd:matrix.orgricharddodd 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
@k900:0upti.meK900 There's really no simple answer here 14:20:51
@k900:0upti.meK900Very few upstreams actually test cross compilation14:20:59
@k900:0upti.meK900 So the process is usually "look at the build error really hard and try to figure out what's going wrong" 14:21:17
@richarddodd:matrix.orgricharddodd 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
@richarddodd:matrix.orgricharddodd * 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
@richarddodd:matrix.orgricharddodd 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
@k900:0upti.meK900 nix-shell -A <foo> 14:25:00
@k900:0upti.meK900 Or rather, in your specific case, probably nix-shell -A pkgsCross.aarch64-multiplatform.foo 14:25:14
@richarddodd:matrix.orgricharddoddWould that use my own local copy of nixpkgs, so I can start debug/run cycling?14:26:21
@richarddodd:matrix.orgricharddodd 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
@k900:0upti.meK900Yes14:28:50
@richarddodd:matrix.orgricharddoddI think that was the thing I wasn't understanding. Thanks14:29:14
@zimward:zimward.moezimward changed their display name from zimward @GPN24 to zimward.21:07:32
8 Jun 2026
@9lore:tchncs.de9lore changed their display name from 9lore | call LORE to 9lore.00:35:30
10 Jun 2026
@eureka-cpu:matrix.orgeureka-cpu

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:

          test-cargo-reaper-build-cross-windows =
            let
              inherit (pkgs.lib.systems.examples.mingw-ucrt-x86_64-llvm.rust) rustcTarget;
              crossPkgs = pkgs.pkgsCross.mingw-ucrt-x86_64-llvm;
              mingwCC = crossPkgs.stdenv.cc;
              crossCC = "${mingwCC}/bin/${mingwCC.targetPrefix}cc";
              crossCXX = "${mingwCC}/bin/${mingwCC.targetPrefix}c++";

              rustWithWindowsTarget = fenix.packages.${system}.combine [
                rustToolchain
                (fenix.packages.${system}.targets.${rustcTarget}.toolchainOf {
                  channel = "1.87.0";
                  sha256 = "sha256-KUm16pHj+cRedf8vxs/Hd2YWxpOrWZ7UOrwhILdSJBU=";
                }).rust-std
              ];
              craneLibCross =
                let
                  craneLib = (crane.mkLib pkgs).overrideToolchain rustWithWindowsTarget;
                in
                craneLib // (cargoReaper.crane { inherit craneLib; });

              crossArgs = {
                src = testFileset ./tests/plugin_manifests/package_manifest;
                strictDeps = true;

                nativeBuildInputs = [
                  mingwCC
                  pkgs.llvmPackages.bintools
                  pkgs.windows.pthreads
                ];

                CARGO_BUILD_TARGET = rustcTarget;
                CARGO_TARGET_X86_64_PC_WINDOWS_GNULLVM_LINKER =
                  "${mingwCC}/bin/${mingwCC.targetPrefix}cc";
                "CC_${rustcTarget}" = crossCC;
                "CXX_${rustcTarget}" = crossCXX;
              };
              cargoArtifactsCross = craneLibCross.buildDepsOnly crossArgs;
            in
            craneLibCross.buildReaperExtension (crossArgs // {
              cargoArtifacts = cargoArtifactsCross;
              package = "package_manifest";
              plugin = "reaper_package_ext";
              target = rustcTarget;
              doInstallCheck = true;
              installCheckPhase = ''
                test -f $out/lib/reaper_package_ext.dll
              '';
            });
18:28:06
@eureka-cpu:matrix.orgeureka-cpu *

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:

          test-cargo-reaper-build-cross-windows =
            let
              inherit (pkgs.lib.systems.examples.mingw-ucrt-x86_64-llvm.rust) rustcTarget;
              crossPkgs = pkgs.pkgsCross.mingw-ucrt-x86_64-llvm;
              mingwCC = crossPkgs.stdenv.cc;
              crossCC = "${mingwCC}/bin/${mingwCC.targetPrefix}cc";
              crossCXX = "${mingwCC}/bin/${mingwCC.targetPrefix}c++";

              rustWithWindowsTarget = fenix.packages.${system}.combine [
                rustToolchain
                (fenix.packages.${system}.targets.${rustcTarget}.toolchainOf {
                  channel = "1.87.0";
                  sha256 = "sha256-KUm16pHj+cRedf8vxs/Hd2YWxpOrWZ7UOrwhILdSJBU=";
                }).rust-std
              ];
              craneLibCross =
                let
                  craneLib = (crane.mkLib pkgs).overrideToolchain rustWithWindowsTarget;
                in
                craneLib // (cargoReaper.crane { inherit craneLib; });

              crossArgs = {
                src = testFileset ./tests/plugin_manifests/package_manifest;
                strictDeps = true;

                nativeBuildInputs = [
                  mingwCC
                  pkgs.llvmPackages.bintools
                  pkgs.windows.pthreads
                ];

                CARGO_BUILD_TARGET = rustcTarget;
                CARGO_TARGET_X86_64_PC_WINDOWS_GNULLVM_LINKER =
                  "${mingwCC}/bin/${mingwCC.targetPrefix}cc";
                "CC_${rustcTarget}" = crossCC;
                "CXX_${rustcTarget}" = crossCXX;
              };
              cargoArtifactsCross = craneLibCross.buildDepsOnly crossArgs;
            in
            craneLibCross.buildReaperExtension (crossArgs // {
              cargoArtifacts = cargoArtifactsCross;
              package = "package_manifest";
              plugin = "reaper_package_ext";
              target = rustcTarget;
              doInstallCheck = true;
              installCheckPhase = ''
                test -f $out/lib/reaper_package_ext.dll
              '';
            });
18:49:17
@eureka-cpu:matrix.orgeureka-cpu

Ah so the pthreads problem was with libc, it hasn't even gotten to my build yet:

Cannot build '/nix/store/2qixrw546lxpxqkwyglhzhhnf2m7kv2b-compiler-rt-libc-x86_64-w64-mingw32-21.1.8.drv'
19:58:03
@eureka-cpu:matrix.orgeureka-cpuIs mingw just broken atm?19:58:57
@eureka-cpu:matrix.orgeureka-cpu * Is mingw-ucrt-x86_64-llvm just broken atm? 19:59:55

Show newer messages


Back to Room ListRoom Version: 6