Skip to content

Commit

Permalink
chore(third_party/crate2nix): apply patches to fix cross
Browse files Browse the repository at this point in the history
Together with temporarily pointing nixpkgs past
b10994c38c61038970a19fa60bfbec21a61755cc, this now fixes cross-
compilation for tvix.

This incorporates the changes proposed in https://cl.tvl.fyi/9888 and
https://cl.tvl.fyi/9889, but by fixing it in crate2nix, and using the
(re-)generated version of it.

Changes were sent upstream at
nix-community/crate2nix#309,
this pulls in a minimal patch for now.

Change-Id: I70bb6f003bbc3e89de9c4eb4985ea4708ac3a9fd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9890
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
  • Loading branch information
flokli committed Nov 2, 2023
1 parent dbe4208 commit 4266f5c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11413,7 +11413,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -11443,10 +11443,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down

0 comments on commit 4266f5c

Please sign in to comment.