Merge pull request #285327 from emilylange/chromium

chromium: fix rust toolchain and remove M121 workaround, {ungoogled-,}chromium: 121.0.6167.85 -> 121.0.6167.139
This commit is contained in:
Emily 2024-02-02 17:54:13 +01:00 committed by GitHub
commit 145c58bcc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 44 additions and 21 deletions

View File

@ -238,16 +238,9 @@ let
})
] ++ lib.optionals (chromiumVersionAtLeast "121") [
# M121 is the first version to require the new rust toolchain.
# But we don't have that ready yet.
# So we have to revert the singular commit that requires rust toolchain.
# This works, because the code in question, the QR code generator, is present in
# two variants: c++ and rust. This workaround will not last.
# The c++ variant in question is deemed to be removed in a month (give or take).
(githubPatch {
revert = true;
commit = "bcf739b95713071687ff25010683248de0092f6a";
hash = "sha256-1ZPe45cc2bjnErcF3prbLMlYpU7kpuwDVcjewINQr+Q=";
})
# Partial revert of https://github.com/chromium/chromium/commit/3687976b0c6d36cf4157419a24a39f6770098d61
# allowing us to use our rustc and our clang.
./patches/chromium-121-rust.patch
];
postPatch = ''
@ -412,11 +405,15 @@ let
# (ld.lld: error: unable to find library -l:libffi_pic.a):
use_system_libffi = true;
# Use nixpkgs Rust compiler instead of the one shipped by Chromium.
# We do intentionally not set rustc_version as nixpkgs will never do incremental
# rebuilds, thus leaving this empty is fine.
rust_sysroot_absolute = "${buildPackages.rustc}";
# Building with rust is disabled for now - this matches the flags in other major distributions.
# Rust is enabled for M121+, see next section:
enable_rust = false;
} // lib.optionalAttrs (chromiumVersionAtLeast "121") {
# M121 the first version to actually require a functioning rust toolchain
enable_rust = true;
# While we technically don't need the cache-invalidation rustc_version provides, rustc_version
# is still used in some scripts (e.g. build/rust/std/find_std_rlibs.py).
rustc_version = buildPackages.rustc.version;
} // lib.optionalAttrs (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) {
# https://www.mail-archive.com/v8-users@googlegroups.com/msg14528.html
arm_control_flow_integrity = "none";
@ -431,6 +428,13 @@ let
} // lib.optionalAttrs ungoogled (lib.importTOML ./ungoogled-flags.toml)
// (extraAttrs.gnFlags or {}));
# We cannot use chromiumVersionAtLeast in mkDerivation's env attrset due
# to infinite recursion when chromium.override is used (e.g. electron).
# To work aroud this, we use export in the preConfigure phase.
preConfigure = lib.optionalString (chromiumVersionAtLeast "121") ''
export RUSTC_BOOTSTRAP=1
'';
configurePhase = ''
runHook preConfigure

View File

@ -0,0 +1,19 @@
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1629,16 +1629,6 @@
configs += [ "//build/config/c++:runtime_library" ]
}
- # Rust and C++ both provide intrinsics for LLVM to call for math operations. We
- # want to use the C++ intrinsics, not the ones in the Rust compiler_builtins
- # library. The Rust symbols are marked as weak, so that they can be replaced by
- # the C++ symbols. This config ensures the C++ symbols exist and are strong in
- # order to cause that replacement to occur by explicitly linking in clang's
- # compiler-rt library.
- if (is_clang && toolchain_has_rust) {
- configs += [ "//build/config/clang:compiler_builtins" ]
- }
-
# TODO(crbug.com/830987): Come up with a better name for is POSIX + Fuchsia
# configuration.
if (is_posix || is_fuchsia) {

View File

@ -15,9 +15,9 @@
version = "2023-11-28";
};
};
hash = "sha256-2TMTLCqoCxdy9PDlZIUa/5oXjmim1T2/LJu+3/Kf4fQ=";
hash_deb_amd64 = "sha256-9vPQAiZPw60oILm0He4Iz9lOc+WvtHCBE9CHA1ejc7s=";
version = "121.0.6167.85";
hash = "sha256-pZHa4YSJ4rK24f7dNUFeoyf6nDSQeY4MTR81YzPKCtQ=";
hash_deb_amd64 = "sha256-cMoYBCuOYzXS7OzFvvBfSL80hBY/PcEv9kWGSx3mCKw=";
version = "121.0.6167.139";
};
ungoogled-chromium = {
deps = {
@ -28,12 +28,12 @@
version = "2023-11-28";
};
ungoogled-patches = {
hash = "sha256-Fopr+SiezOs3w52juXvMyfxOAzrVXrRO8j0744oeO5k=";
rev = "223fe76bb263a216341739ce2ee333752642cf47";
hash = "sha256-W13YPijmdakEJiUd9iKH3V9LcKvL796QlyTrAb+yLMQ=";
rev = "121.0.6167.139-1";
};
};
hash = "sha256-2TMTLCqoCxdy9PDlZIUa/5oXjmim1T2/LJu+3/Kf4fQ=";
hash_deb_amd64 = "sha256-9vPQAiZPw60oILm0He4Iz9lOc+WvtHCBE9CHA1ejc7s=";
version = "121.0.6167.85";
hash = "sha256-pZHa4YSJ4rK24f7dNUFeoyf6nDSQeY4MTR81YzPKCtQ=";
hash_deb_amd64 = "sha256-cMoYBCuOYzXS7OzFvvBfSL80hBY/PcEv9kWGSx3mCKw=";
version = "121.0.6167.139";
};
}