mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
setup.sh: avoid running the same hook twice
In strictDeps=false, we don’t want the same package hook to be run twice, otherwise we get duplicates in some flags. Fixes #41340
This commit is contained in:
parent
e3e1a53118
commit
9172c1eee2
@ -562,6 +562,10 @@ _addToEnv() {
|
||||
(( "$depHostOffset" <= "$depTargetOffset" )) || continue
|
||||
local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
|
||||
if [[ -z "${strictDeps-}" ]]; then
|
||||
|
||||
# Keep track of which packages we have visited before.
|
||||
local visitedPkgs=""
|
||||
|
||||
# Apply environment hooks to all packages during native
|
||||
# compilation to ease the transition.
|
||||
#
|
||||
@ -574,7 +578,11 @@ _addToEnv() {
|
||||
${pkgsHostTarget+"${pkgsHostTarget[@]}"} \
|
||||
${pkgsTargetTarget+"${pkgsTargetTarget[@]}"}
|
||||
do
|
||||
if [[ "$visitedPkgs" = *"$pkg"* ]]; then
|
||||
continue
|
||||
fi
|
||||
runHook "${!hookRef}" "$pkg"
|
||||
visitedPkgs+=" $pkg"
|
||||
done
|
||||
else
|
||||
local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"
|
||||
|
Loading…
Reference in New Issue
Block a user