Open sbourdeauducq opened 2 years ago
Workaround:
--- a/pkgs/build-support/rust/build-rust-package/default.nix
+++ b/pkgs/build-support/rust/build-rust-package/default.nix
@@ -119,7 +119,6 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoLock" ]) // lib.o
nativeBuildInputs = nativeBuildInputs ++ [
cacert
- git
cargoBuildHook
cargoCheckHook
cargoInstallHook
It fails during the check phase and it seems 85c63a515d21c8fa27a561a9b8a1db5b18118e39 is what broke it. @risicle
It depends what you mean by cross-compiling. If you mean building using the binfmt_misc
qemu method then yes, I ran into this yesterday. LD_PRELOAD
doesn't appear to work with it. But if that's a problem, we should review all uses of libredirect
because they will have the same issue.
If by cross-compiling you mean having a different stdenv.hostPlatform
and stdenv.targetPlatform
, I'm surprised this doesn't already automatically disable the checkPhase
and if not, it would surely be fairly easy to detect at eval-time and disable the tests.
Conditionally disabling the tests for the binfmt_misc
case would be tricky and would introduce an impurity.
It depends what you mean by cross-compiling.
With the repro nix-build -A pkgsCross.mingwW64.rink
it means having a different stdenv.hostPlatform
and stdenv.targetPlatform
I believe.
Oh just looking at the docs now looks like I've misunderstood what hostPlatform
is all along. I think what I meant was buildPlatform
.
Anyway, looks like it doesn't disable it by default: https://nixos.org/manual/nixpkgs/stable/#cross-testsuite-runs-host-code
Which surprises me because I would have expected most packages' checkPhase
s would need to run host-native code. But it should be a simple fix..
Turns out it actually does? https://github.com/NixOS/nixpkgs/blob/e03cb37982e485aa7fe89490dfdea471288bd31c/pkgs/stdenv/generic/make-derivation.nix#L103
But it gets more confusing because when I try building nix-build -A pkgsCross.mingwW64.rink
even with doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
explicitly set for openssh, it still tries to run the tests. So in this case, it does appear stdenv.hostPlatform == stdenv.buildPlatform
.
For reasons that I do not understand,
buildRustPackage
attempts to buildopenssh
when cross-compiling. This now fails as of currentmaster
andrelease-21.11
. It used to work on nixpkgs 0f4b4b85d959200f52c16bbb74036994e7db5f74. I'm not sure ifopenssh
should be fixed, or ifbuildRustPackage
should not attempt to cross-compileopenssh
in the first place.Issue can be reproduced with:
(Note that it builds correctly and runs with 0f4b4b85d959200f52c16bbb74036994e7db5f74 despite marked as "unsupported")