diff options
author | Atemu <atemu.main@gmail.com> | 2024-04-09 15:18:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 15:18:15 +0200 |
commit | 44ec127d3b27741b089503bf119bafc0da1005a5 (patch) | |
tree | 91884bce21520ab5a5c07c005737aee908e15084 | |
parent | 384d967657a533a3d1795ee7f8e1556081e23abc (diff) | |
parent | 9bcd91ba09dbe6d7cb93b2774a77596d914563ca (diff) |
Merge pull request #302172 from tpwrules/bubblewrap-no-32
build-fhsenv-bubblewrap: reference 32-bit binaries only if multiArch
-rw-r--r-- | pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix | 13 | ||||
-rw-r--r-- | pkgs/build-support/build-fhsenv-bubblewrap/default.nix | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix index 81813473a8db..2ab7847926e2 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix @@ -40,12 +40,11 @@ let isMultiBuild = multiArch && stdenv.system == "x86_64-linux"; isTargetBuild = !isMultiBuild; - # list of packages (usually programs) which are only be installed for the - # host's architecture + # list of packages (usually programs) which match the host's architecture + # (which includes stuff from multiPkgs) targetPaths = targetPkgs pkgs ++ (if multiPkgs == null then [] else multiPkgs pkgs); - # list of packages which are installed for both x86 and x86_64 on x86_64 - # systems + # list of packages which are for x86 (only multiPkgs, only for x86_64 hosts) multiPaths = multiPkgs pkgsi686Linux; # base packages of the chroot @@ -76,8 +75,8 @@ let ]; ldconfig = writeShellScriptBin "ldconfig" '' - # due to a glibc bug, 64-bit ldconfig complains about patchelf'd 32-bit libraries, so we're using 32-bit ldconfig - exec ${if stdenv.system == "x86_64-linux" then pkgsi686Linux.glibc.bin else pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@" + # due to a glibc bug, 64-bit ldconfig complains about patchelf'd 32-bit libraries, so we use 32-bit ldconfig when we have them + exec ${if isMultiBuild then pkgsi686Linux.glibc.bin else pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@" ''; etcProfile = writeText "profile" '' @@ -251,7 +250,7 @@ let in runCommandLocal "${name}-fhs" { passthru = { - inherit args baseTargetPaths targetPaths baseMultiPaths ldconfig; + inherit args baseTargetPaths targetPaths baseMultiPaths ldconfig isMultiBuild; }; } '' mkdir -p $out diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index e06fb51dd4b6..c30a4dfb7ea3 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -252,7 +252,7 @@ let --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \ --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \ --remount-ro ${glibc}/etc \ - '' + optionalString (stdenv.isx86_64 && stdenv.isLinux) (indentLines '' + '' + optionalString fhsenv.isMultiBuild (indentLines '' --tmpfs ${pkgsi686Linux.glibc}/etc \ --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \ --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \ |