!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

563 Members
117 Servers

Load older messages


SenderMessageTime
2 Mar 2026
@spikespaz:envs.net@spikespaz:envs.net left the room.08:12:07
@cassette_futurismkraitfloof1564:matrix.orgWill Wood joined the room.20:38:23
3 Mar 2026
@genericnerdyusername:matrix.org@genericnerdyusername:matrix.org left the room.00:18:35
@rosssmyth:matrix.org@rosssmyth:matrix.org changed their display name from rosssmyth to treefroog.00:39:56
@rosssmyth:matrix.org@rosssmyth:matrix.org removed their display name treefroog.00:42:17
4 Mar 2026
@skarmux:matrix.org@skarmux:matrix.org left the room.12:36:59
5 Mar 2026
@mtheil:scs.ems.host@mtheil:scs.ems.host changed their display name from Markus Theil to Markus Theil (SCS).09:33:37
@maximilian.bosch:matrix-pub-stage.factory.secunet.comMaximilian Bosch joined the room.10:14:47
6 Mar 2026
@niklas.foerster:scs.ems.host@niklas.foerster:scs.ems.host changed their display name from Niklas Förster to Niklas Förster (SCS).13:23:25
8 Mar 2026
@slushee:crabsin.spaceSlushee changed their profile picture.00:28:00
@ani_kurup:matrix.orgAni joined the room.18:05:00
@aoinoikaz:matrix.orgAoinoikazhttps://hackage.haskell.org/package/nova-nix-0.1.8.0/changelog18:57:48
@ss:someonex.netSomeoneSerge (matrix works sometimes) changed their display name from SomeoneSerge (back on matrix) to SomeoneSerge (matrix works sometimes).23:36:14
9 Mar 2026
@stas:mainframe.lvStas

as of today I started to get errors cross-compiling gnutls on armv7:

./errcodes: line 117: /build/gnutls-3.8.12/doc/.libs/lt-errcodes: cannot execute binary file: Exec format error
15:22:33
@stas:mainframe.lvStasit is some recent change, as it compiled fine until now15:23:06
@blitz:chat.x86.lol@blitz:chat.x86.lol left the room.15:23:15
@artturin:matrix.orgArtturinFrom what nixpkgs rev to what 16:16:49
@sandro:supersandro.deSandro 🐧https://github.com/NixOS/nixpkgs/pull/49770122:45:24
10 Mar 2026
@amaan:amaanq.comamaan joined the room.06:51:52
@mtheil:scs.ems.host@mtheil:scs.ems.host left the room.14:26:07
11 Mar 2026
@niklas.foerster:scs.ems.host@niklas.foerster:scs.ems.host left the room.08:26:45
17 Mar 2026
@eureka-cpu:matrix.orgeureka-cpu

hey hi howdy, I'm trying to cross compile to wasm32-wasi using rust with the fenix and crane libraries but getting errors in the build and devshell. any tips?

Here's my expression:

let
  inherit (pkgs) lib stdenv;

  sources = import ./npins;
  system = builtins.currentSystem;

  pkgs =
    let
      pkgs = import sources.nixpkgs {
        localSystem = { inherit system; };
      };
    in
    pkgs.pkgsCross.wasi32;

  fenix = import sources.fenix {
    inherit system pkgs;
  };
  toolchain = with fenix; combine [
    (stable.withComponents [
      "rust-analyzer"
      "rust-src"
      "cargo"
      "rustc"
      "rustfmt"
      "clippy"
    ])
    targets.wasm32-unknown-unknown.latest.rust-std
  ];
  crane =
    let
      crane = import sources.crane {
        inherit pkgs;
      };
    in
    crane.overrideToolchain toolchain;

  lathe =
    { lib
    , stdenv
    , libiconv
    , autoPatchelfHook
    }:
    crane.buildPackage {
      src = crane.cleanCargoSource ./.;
      strictDeps = true;

      nativeBuildInputs = [
        # Additional compile time deps
      ] ++ lib.optionals stdenv.isDarwin [
        # macOS only compile time deps
        libiconv
      ] ++ lib.optionals stdenv.isLinux [
        # linux only compile time deps
        autoPatchelfHook
      ];

      buildInputs = with pkgs; [
        # runtime dependencies
      ];
    };
in
{
  default = pkgs.callPackage lathe { };

  devshell = crane.devShell {
    packages = with pkgs; [
      npins
    ];
  };
}

nix-build:

error: Cannot build '/nix/store/6111pp5flbhl8g7xc074byz2x32g6j8v-lathe-deps-static-wasm32-unknown-wasi-0.1.0.drv'.
       Reason: builder failed with exit code 127.
       Output paths:
         /nix/store/nn7dlx8vgjnc4ng7z88nly1vazp70lw0-lathe-deps-static-wasm32-unknown-wasi-0.1.0
       Last 25 log lines:
       > AR_WASM32_WASIP1=wasm32-unknown-wasi-ar
       > AR_X86_64_UNKNOWN_LINUX_GNU=ar
       > CARGO_BUILD_TARGET=wasm32-wasip1
       > CARGO_TARGET_WASM32_WASIP1_LINKER=wasm32-unknown-wasi-cc
       > CARGO_TARGET_WASM32_WASIP1_RUNNER=/nix/store/fry49nv1w7x3w3pd4srd9dk5kk6id7zd-wasmtime-42.0.1/bin/wasmtime
       > CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=cc
       > CC_WASM32_WASIP1=wasm32-unknown-wasi-cc
       > CC_X86_64_UNKNOWN_LINUX_GNU=cc
       > CXX_WASM32_WASIP1=wasm32-unknown-wasi-c++
       > CXX_X86_64_UNKNOWN_LINUX_GNU=c++
       > HOST_AR=ar
       > HOST_CC=cc
       > HOST_CXX=c++
       > TARGET_AR=wasm32-unknown-wasi-ar
       > TARGET_CC=wasm32-unknown-wasi-cc
       > TARGET_CXX=wasm32-unknown-wasi-c++
       > ----------------------------------------------------------------------------------
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > will append /build/source/.cargo-home/config.toml with contents of /nix/store/p44r6zirc60p8kw3nqs3hfbiqym8gimj-vendor-cargo-deps/config.toml
       > default configurePhase, nothing to do
       > Running phase: buildPhase
       > +++ command cargo --version
       > /nix/store/7hbjid69agb2b8ag195psng3blw2aqw1-cargoHelperFunctionsHook/nix-support/setup-hook: line 6: /nix/store/mf0539n7iwza5minf75fwzi9bv4bs34i-rust-mixed/bin/cargo: cannot execute: required file not found
       For full logs, run:
         nix log /nix/store/6111pp5flbhl8g7xc074byz2x32g6j8v-lathe-deps-static-wasm32-unknown-wasi-0.1.0.drv
error: Cannot build '/nix/store/jrmy0iwqnaakimm8h8qybhkpvv2v70d3-lathe-static-wasm32-unknown-wasi-0.1.0.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/kb43j9gyhgm1w9hn358ss5dqprk7rnnz-lathe-static-wasm32-unknown-wasi-0.1.0
error: Build failed due to failed dependency
FAIL

nix-shell:

Could not start dynamically linked executable: cargo
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
FAIL
19:32:25
@eureka-cpu:matrix.orgeureka-cpumy issue was that I was using pkgsCross, apparently just using pkgs was the right move in this case20:59:14
19 Mar 2026
@emma:rory.gay@emma:rory.gay left the room.06:22:52
@noamraph:matrix.orgNoam Raphael changed their display name from Noam Yorav-Raphael to Noam Raphael.14:38:41
@technicus:matrix.orgMiles Dyson set a profile picture.18:06:18
23 Mar 2026
@limwa:matrix.orgAndré Lima Is there any guidance on when to use makeScope vs makeScopeWithSplicing'? Also, what would be the proper way to use makeScopeWithSplicing' in the pkgs/by-name folder? I can't use generateSplicesForMkScope because the scope is not propagated to the top-level 13:35:35
@limwa:matrix.orgAndré LimaIf there isn't, would it be worth it to create an issue where this would be discussed? Then, maybe we can add more information to the reference manual on this matter16:17:51
@limwa:matrix.orgAndré LimaI've posted a comment on https://github.com/NixOS/nixpkgs/issues/354198#issuecomment-4113385099 about those questions. You're welcome to join the discussion if it interests you.20:21:09
@limwa:matrix.orgAndré Lima * 20:21:20

There are no newer messages yet.


Back to Room ListRoom Version: 6