!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

556 Members
119 Servers

Load older messages


SenderMessageTime
18 Aug 2025
@quadradical:federated.nexusQuadRadical (Ping)ill add it later21:11:33
@artturin:matrix.orgArtturinSeems like an oversight that the config can't be created by the hook without a cargoDeps attr21:13:23
@artturin:matrix.orgArtturin
In reply to @quadradical:federated.nexus
ill add it later
It hasn't needed it before
21:14:39
@artturin:matrix.orgArtturin

Try this in postPatch

cat >> .cargo/config.toml <<'EOF'
${rustPlatform.cargoSetupHook.cargoConfig}
EOF
21:19:43
@artturin:matrix.orgArtturinTry that path and /build/.cargo and the cargo-home21:20:37
@quadradical:federated.nexusQuadRadical (Ping) adding just that did nothing 21:43:52
@quadradical:federated.nexusQuadRadical (Ping) okay 21:43:57
@quadradical:federated.nexusQuadRadical (Ping)nothing worked22:36:50
@quadradical:federated.nexusQuadRadical (Ping)as far as i can see22:36:52
19 Aug 2025
@quadradical:federated.nexusQuadRadical (Ping)if anyone has an idea on how to fix this id be most appreciative :)00:38:08
@artturin:matrix.orgArtturinOn my pc now and looking at the failed 00:38:35
@artturin:matrix.orgArtturin* On my pc now and looking at the failed dir00:38:42
@artturin:matrix.orgArtturinthe src includes a vendor and .cargo dir00:39:02
@quadradical:federated.nexusQuadRadical (Ping)cargo should be picking this up00:39:15
@artturin:matrix.orgArtturinThat's why specifying cargoDeps hasn't been necessary00:39:16
@quadradical:federated.nexusQuadRadical (Ping)i see00:39:21
@artturin:matrix.orgArtturin cargoVendorDir = "vendor" is enough to fix it :P 00:53:39
@artturin:matrix.orgArtturin
diff --git a/pkgs/by-name/gl/glycin-loaders/package.nix b/pkgs/by-name/gl/glycin-loaders/package.nix
index 06bc12716d63..c0a237512fec 100644
--- a/pkgs/by-name/gl/glycin-loaders/package.nix
+++ b/pkgs/by-name/gl/glycin-loaders/package.nix
@@ -20,6 +20,7 @@
   ninja,
   pkg-config,
   rustc,
+  rustPlatform,
 }:
 
 stdenv.mkDerivation (finalAttrs: {
@@ -47,8 +48,11 @@ stdenv.mkDerivation (finalAttrs: {
     ninja
     pkg-config
     rustc
+    rustPlatform.cargoSetupHook
   ];
 
+  cargoVendorDir = "vendor";
+
   buildInputs = [
     gtk4 # for GdkTexture
     cairo
@@ -68,6 +72,13 @@ stdenv.mkDerivation (finalAttrs: {
 
   strictDeps = true;
 
+  postPatch = ''
+    substituteInPlace loaders/meson.build \
+      --replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader,"
+  '';
+
+  env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
+
   passthru = {
     updateScript = gnome.updateScript {
       attrPath = "glycin-loaders";
00:53:42
@artturin:matrix.orgArtturin * cargoVendorDir = "vendor" with the hook is enough to fix it :P 00:54:13
@quadradical:federated.nexusQuadRadical (Ping) oh awesome! 00:54:32
@quadradical:federated.nexusQuadRadical (Ping)thank you so so much for the help!00:54:48
@artturin:matrix.orgArtturinimage.png
Download image.png
00:56:59
@quadradical:federated.nexusQuadRadical (Ping)im almost there i think :)00:57:05
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/pull/43487800:59:09
@quadradical:federated.nexusQuadRadical (Ping) hmm so i added an overlay:
      glycin-loaders = super.glycin-loaders.overrideAttrs (old: {
        postPatch = lib.optionalString (super.stdenv.buildPlatform != super.stdenv.hostPlatform) ''
          substituteInPlace loaders/meson.build \
            --replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${super.stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader,"
        '';

        nativeBuildInputs = (old.nativeBuildInputs or []) ++ [super.rustPlatform.cargoSetupHook];

        cargoVendorDir = "vendor";

        env.CARGO_BUILD_TARGET = super.stdenv.hostPlatform.rust.rustcTargetSpec;
      });
But it still fails with the old error
01:02:45
@artturin:matrix.orgArtturin --keep-failed and see if /build/.cargo/config.toml matches what I sent in the SS 01:08:53
@artturin:matrix.orgArtturin * --keep-failed and see if /build/.cargo/config.toml matches what I sent in the screenshot 01:08:58
@quadradical:federated.nexusQuadRadical (Ping) /build/.cargo doesnt exist 01:10:49
@artturin:matrix.orgArtturinDoes the build log have the cargoSetupHooks at the start01:11:35
@artturin:matrix.orgArtturin
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/ics3xr1jgfmagn18jax3h5nva7g5smys-glycin-1.2.3.tar.xz
source root is glycin-1.2.3
Executing cargoSetupPostUnpackHook
Finished cargoSetupPostUnpackHook
01:11:37

Show newer messages


Back to Room ListRoom Version: 6