[go: nahoru, domu]

Skip to content

Commit

Permalink
electron: fix build
Browse files Browse the repository at this point in the history
Just like with Firefox, we need to make sure there's only a single
version of LLVM involved in building Chromium, or we get errors like
this:

	ld.lld: error: Invalid record (Producer: 'LLVM18.1.7' Reader: 'LLVM 17.0.6')

Fixes: 23d4f83 ("cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0")
  • Loading branch information
alyssais committed Jun 10, 2024
1 parent a269b98 commit a717626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 4 additions & 5 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
, ninja, pkg-config
, python3, perl
, which
, llvmPackages_attrName
, libuuid
, overrideCC
# postPatch:
Expand Down Expand Up @@ -131,7 +130,7 @@ let
# https://github.com/NixOS/nixpkgs/issues/142901
buildPlatformLlvmStdenv =
let
llvmPackages = pkgsBuildBuild.${llvmPackages_attrName};
llvmPackages = pkgsBuildBuild.rustc.llvmPackages;
in
overrideCC llvmPackages.stdenv
(llvmPackages.stdenv.cc.override {
Expand Down Expand Up @@ -164,7 +163,7 @@ let
ninja pkg-config
python3WithPackages perl
which
buildPackages.${llvmPackages_attrName}.bintools
buildPackages.rustc.llvmPackages.bintools
bison gperf
];

Expand Down Expand Up @@ -381,8 +380,8 @@ let
llvmCcAndBintools = symlinkJoin {
name = "llvmCcAndBintools";
paths = [
buildPackages.${llvmPackages_attrName}.llvm
buildPackages.${llvmPackages_attrName}.stdenv.cc
buildPackages.rustc.llvmPackages.llvm
buildPackages.rustc.llvmPackages.stdenv.cc
];
};

Expand Down
8 changes: 2 additions & 6 deletions pkgs/applications/networking/browsers/chromium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}:

let
# 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_17";
stdenv = pkgs.${llvmPackages_attrName}.stdenv;
stdenv = pkgs.rustc.llvmPackages.stdenv;

# Helper functions for changes that depend on specific versions:
warnObsoleteVersionConditional = min-version: result:
Expand All @@ -48,7 +44,7 @@ let
callPackage = newScope chromium;

chromium = rec {
inherit stdenv llvmPackages_attrName upstream-info;
inherit stdenv upstream-info;

mkChromiumDerivation = callPackage ./common.nix ({
inherit channel chromiumVersionAtLeast versionRange;
Expand Down

0 comments on commit a717626

Please sign in to comment.