libgccjit: don't try to enter into non-existent $lib output

Fixes build failure on `staging-next` introduced by commit c817efe6
("gcc: extend stripping of .a libraries and .o objects"):

    ...-bootstrap-stage3-stdenv-linux/setup: line 106: pushd: no other directory

Build failure happens because `libgccjit` has different `outputs` layout
compared to the rest of `gcc` derivations:

     outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";

The change carves out `$lib` lib handling part to avoid `gcc` rebuild
in `staging-next`.
This commit is contained in:
Sergei Trofimovich 2022-08-20 12:51:36 +01:00
parent bbb80bc7e9
commit 1f7186ab5c
10 changed files with 13 additions and 11 deletions

View File

@ -229,7 +229,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -237,7 +237,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -232,7 +232,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -236,7 +236,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -256,7 +256,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -268,7 +268,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -235,7 +235,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -216,7 +216,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -231,7 +231,7 @@ stdenv.mkDerivation ({
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
inherit
(import ../common/strip-attributes.nix { inherit stdenv; })
(import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
stripDebugList
stripDebugListTarget
preFixup;

View File

@ -1,4 +1,4 @@
{ stdenv }:
{ lib, stdenv, langJit }:
{
# Note [Cross-compiler stripping]
@ -48,7 +48,8 @@
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a,o,so*}
)
popd
'' + lib.optionalString (!langJit) ''
${/*keep indentation*/ ""}
pushd $lib
local -ar libHostFiles=(
lib{,32,64}/*.{a,o,so*}
@ -58,6 +59,7 @@
)
popd
'' + ''
eval "$oldOpts"
stripDebugList="$stripDebugList ''${outHostFiles[*]} ''${libHostFiles[*]}"