From 6972fda528b1463303ee2ea455fc503586afb3b5 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 10 Dec 2025 23:58:19 +0000 Subject: [PATCH] build-fhsenv-bubblewrap: use `hostPlatform.is64bit` for `$out/usr/lib` Follow-up to d151f99d0f0c460b2f5344c58a4e1b759b7dffcd Compute the `$out/usr/lib` target using `hostPlatform.is64bit` and `is32bit` instead of explicitly listing supported systems. Note: `hostPlatform.libDir` is not used because it doesn't handle non-linux systems and does not match the FHS expectations for aarch64 in this context. --- .../build-fhsenv-bubblewrap/buildFHSEnv.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix index fb6fcc815c9b..de9afda8d1bb 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix @@ -46,14 +46,14 @@ let # "use of glibc_multi is only supported on x86_64-linux" isMultiBuild = multiArch && stdenv.system == "x86_64-linux"; - # What should lib be linked to: lib32 or lib64? + # What should $out/usr/lib be linked to: lib32 or lib64? defaultLib = - { - "i686-linux" = "lib32"; - "x86_64-linux" = "lib64"; - "aarch64-linux" = "lib64"; - } - .${stdenv.system} or (throw "Please expand list of system with defaultLib for '${stdenv.system}'"); + if stdenv.hostPlatform.is64bit then + "lib64" + else if stdenv.hostPlatform.is32bit then + "lib32" + else + throw "buildFHSEnvBubblewrap: defaultLib cannot handle system ${stdenv.hostPlatform.system} (expected 64bit or 32bit)"; # list of packages (usually programs) which match the host's architecture # (which includes stuff from multiPkgs)