diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-03-24 18:32:59 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-05-08 22:59:50 +0200 |
commit | e32c005772c9f820780453628eb9b7cd9a51223e (patch) | |
tree | 3d0b677f6e9ee68b343f0b82f294703ca7f047d1 /pkgs/build-support | |
parent | 04248f606f4ebfe298bfbfed3680a2fd5dacf796 (diff) | |
download | nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar.gz nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar.bz2 nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar.lz nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar.xz nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.tar.zst nixlib-e32c005772c9f820780453628eb9b7cd9a51223e.zip |
rustPlatform: don't install test executables
This is done by gathering all binaries to install before running the checkPhase.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/default.nix | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 6cece0048333..9f11919974a8 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -165,6 +165,17 @@ stdenv.mkDerivation (args // { runHook postBuild ''; + postBuild = args.postBuild or "" + '' + + # This needs to be done after postBuild: packages like `cargo` do a pushd/popd in + # the pre/postBuild-hooks that need to be taken into account before gathering + # all binaries to install. + bins=$(find $releaseDir \ + -maxdepth 1 \ + -type f \ + -executable ! \( -regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" \)) + ''; + checkPhase = args.checkPhase or (let argstr = "${stdenv.lib.optionalString (buildType == "release") "--release"} --target ${rustTarget} --frozen"; in '' @@ -191,11 +202,7 @@ stdenv.mkDerivation (args // { done mkdir -p $out/bin $out/lib - find $releaseDir \ - -maxdepth 1 \ - -type f \ - -executable ! \( -regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" \) \ - -print0 | xargs -r -0 cp -t $out/bin + xargs -r cp -t $out/bin <<< $bins find $releaseDir \ -maxdepth 1 \ -regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" \ |