From 1f7186ab5c6e9a2f282941617cec79479974fd74 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 20 Aug 2022 12:51:36 +0100 Subject: [PATCH] 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`. --- pkgs/development/compilers/gcc/10/default.nix | 2 +- pkgs/development/compilers/gcc/11/default.nix | 2 +- pkgs/development/compilers/gcc/12/default.nix | 2 +- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/gcc/7/default.nix | 2 +- pkgs/development/compilers/gcc/8/default.nix | 2 +- pkgs/development/compilers/gcc/9/default.nix | 2 +- pkgs/development/compilers/gcc/common/strip-attributes.nix | 6 ++++-- 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index dbfdbb79be995..8082bef14ea72 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 792588ebf2178..35b3b84042499 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index 4cdab163bf63c..da0aac2ef1ed0 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index ffccf6686f37d..83821b9b494de 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index a51887ec54e0d..3ac8973b8f255 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 20d09da550b0b..a2acda24e19d2 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index d25b6489318ff..0332576466a8d 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 9f5c416e83245..7565c0b3f139e 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 82cb4c067a53d..0436ddf7e337f 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -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; diff --git a/pkgs/development/compilers/gcc/common/strip-attributes.nix b/pkgs/development/compilers/gcc/common/strip-attributes.nix index 9756c468b71a5..f2f0efb1264a9 100644 --- a/pkgs/development/compilers/gcc/common/strip-attributes.nix +++ b/pkgs/development/compilers/gcc/common/strip-attributes.nix @@ -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[*]}"