[go: nahoru, domu]

Skip to content

Commit

Permalink
chromium,electron-source: remove no longer needed version conditionals
Browse files Browse the repository at this point in the history
The minimum versions for both chromium and electron-source are higher
than the version bounds of those conditionals.
As such, they can be safely removed.

This is a no-op.
  • Loading branch information
emilylange authored and yu-re-ka committed Jun 13, 2024
1 parent 268ce0e commit fb9cdbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
28 changes: 6 additions & 22 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -284,20 +284,6 @@ let
# Rebased variant of patch right above to build M126+ with LLVM 17.
# staging-next will bump LLVM to 18, so we will be able to drop this soon.
./patches/chromium-126-llvm-17.patch
] ++ lib.optionals (!chromiumVersionAtLeast "119.0.6024.0") [
# Fix build with at-spi2-core ≥ 2.49
# This version is still needed for electron.
(githubPatch {
commit = "fc09363b2278893790d131c72a4ed96ec9837624";
hash = "sha256-l60Npgs/+0ozzuKWjwiHUUV6z59ObUjAPTfXN7eXpzw=";
})
] ++ lib.optionals (!chromiumVersionAtLeast "121.0.6104.0") [
# Fix build with at-spi2-core ≥ 2.49
# https://chromium-review.googlesource.com/c/chromium/src/+/5001687
(githubPatch {
commit = "b9bef8e9555645fc91fab705bec697214a39dbc1";
hash = "sha256-CJ1v/qc8+nwaHQR9xsx08EEcuVRbyBfCZCm/G7hRY+4=";
})
] ++ lib.optionals (versionRange "121" "126") [
# M121 is the first version to require the new rust toolchain.
# Partial revert of https://github.com/chromium/chromium/commit/3687976b0c6d36cf4157419a24a39f6770098d61
Expand Down Expand Up @@ -476,10 +462,6 @@ let
use_system_libffi = true;
# Use nixpkgs Rust compiler instead of the one shipped by Chromium.
rust_sysroot_absolute = "${buildPackages.rustc}";
# 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).
Expand All @@ -498,10 +480,12 @@ 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") ''
# TODO: Migrate this to env.RUSTC_BOOTSTRAP next mass-rebuild.
# Chromium expects nightly/bleeding edge rustc features to be available.
# Our rustc in nixpkgs follows stable, but since bootstrapping rustc requires
# nightly features too, we can (ab-)use RUSTC_BOOTSTRAP here as well to
# enable those features in our stable builds.
preConfigure = ''
export RUSTC_BOOTSTRAP=1
'';

Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/tools/electron/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: {

src = null;

patches = base.patches ++ lib.optional (lib.versionAtLeast info.version "29" && lib.versionOlder info.version "30")
patches = base.patches ++ lib.optional (lib.versionOlder info.version "30")
(substituteAll {
# disable a component that requires CIPD blobs
name = "disable-screen-ai.patch";
Expand Down Expand Up @@ -172,10 +172,8 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: {
use_perfetto_client_library = false;
v8_builtins_profiling_log_file = "";
enable_dangling_raw_ptr_checks = false;
} // lib.optionalAttrs (lib.versionAtLeast info.version "28") {
dawn_use_built_dxc = false;
v8_enable_private_mapping_fork_optimization = true;
} // lib.optionalAttrs (lib.versionAtLeast info.version "29") {
v8_expose_public_symbols = true;
} // {

Expand Down

0 comments on commit fb9cdbd

Please sign in to comment.