diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 4cd7eb485bcb..4be1512a6c22 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -1,4 +1,7 @@ { stdenv, lib, fetchurl, fetchpatch +, buildPackages +, pkgsBuildBuild +, pkgsBuildTarget # Channel data: , channel, upstream-info # Helper functions: @@ -8,7 +11,7 @@ , ninja, pkg-config , python3, perl , which -, llvmPackages +, llvmPackages_attrName , rustc # postPatch: , pkgsBuildHost @@ -130,7 +133,7 @@ let ninja pkg-config python3WithPackages perl which - llvmPackages.bintools + buildPackages.${llvmPackages_attrName}.bintools bison gperf ]; @@ -308,7 +311,7 @@ let rtc_use_pipewire = true; # Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient): chrome_pgo_phase = 0; - clang_base_path = "${llvmPackages.stdenv.cc}"; + clang_base_path = "${pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc}"; use_qt = false; # To fix the build as we don't provide libffi_pic.a # (ld.lld: error: unable to find library -l:libffi_pic.a): diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index d39b52809ed2..45327783f0b0 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -18,11 +18,15 @@ , commandLineArgs ? "" , pkgsBuildTarget , pkgsBuildBuild +, pkgs }: let - llvmPackages = pkgsBuildTarget.llvmPackages_16; - stdenv = llvmPackages.stdenv; + # Sometimes we access `llvmPackages` via `pkgs`, and other times + # via `pkgsFooBar`, so a string (attrname) is the only way to have + # a single point of control over the LLVM version used. + llvmPackages_attrName = "llvmPackages_16"; + stdenv = pkgs.${llvmPackages_attrName}.stdenv; upstream-info = (lib.importJSON ./upstream-info.json).${channel}; @@ -44,7 +48,7 @@ let callPackage = newScope chromium; chromium = rec { - inherit stdenv llvmPackages upstream-info; + inherit stdenv llvmPackages_attrName upstream-info; mkChromiumDerivation = callPackage ./common.nix ({ inherit channel chromiumVersionAtLeast versionRange;