Skip to content

Commit

Permalink
[24.05] Various Electron backports (#337776)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy authored Aug 29, 2024
2 parents 28f84c7 + 3f2a98c commit 893e9c6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2,752 deletions.
32 changes: 7 additions & 25 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,12 @@ let
"flac"
"libjpeg"
"libpng"
] ++ lib.optionals (!chromiumVersionAtLeast "124") [
# Use the vendored libwebp for M124+ until we figure out how to solve:
# Running phase: configurePhase
# ERROR Unresolved dependencies.
# //third_party/libavif:libavif_enc(//build/toolchain/linux/unbundle:default)
# needs //third_party/libwebp:libwebp_sharpyuv(//build/toolchain/linux/unbundle:default)
"libwebp"
] ++ [
# "libwebp"
"libxslt"
# "opus"
];
Expand Down Expand Up @@ -278,20 +276,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 @@ -473,10 +457,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 @@ -497,10 +477,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
3 changes: 2 additions & 1 deletion pkgs/development/tools/electron/binary/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ let
++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ]
++ optionals (versionOlder version "19.0.0") [ "i686-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
knownVulnerabilities = optional (versionOlder version "27.0.0") "Electron version ${version} is EOL";
# https://www.electronjs.org/docs/latest/tutorial/electron-timelines
knownVulnerabilities = optional (versionOlder version "30.0.0") "Electron version ${version} is EOL";
};

fetcher = vers: tag: hash: fetchurl {
Expand Down
28 changes: 14 additions & 14 deletions pkgs/development/tools/electron/binary/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
},
"29": {
"hashes": {
"aarch64-darwin": "c4b1024ef77d3a6380541b3ae3b6cc60748ebdbeed17277cc2dc4b72944c1ddc",
"aarch64-linux": "b27d87b8d0da41cab3c683ac7fa71af84492fe5f9bcd5970da0c73901d18c5f8",
"armv7l-linux": "1f8681870ffda20a4f45afffd850619a55e711b3f6a033a5ac4a659540f7b339",
"headers": "0yzwc2d8hfrsrpg4m7234cyvcx9ch3psx9rsywbli1avzb8rkjdi",
"x86_64-darwin": "e3cf8e623049f18a0d7a7871fb5f14a9150352d7b1c5d59dca8388b3a9b42cb1",
"x86_64-linux": "b81bac1ffa3b0d82837d05212e988854ca9db0350c571857e0851f34443a5ecd"
"aarch64-darwin": "077c7abc2c8f1117863141fb5662684fc1320823e0e0aab6c42ad97bcfcceace",
"aarch64-linux": "14d5b54ef561cea2ca28c55a877bc1a1a3e360ca2f9e69ab3aa719054eca8552",
"armv7l-linux": "9007e44a5cb5b7645455e7895d2039d3264cab2eb0ecf8dbb4295344d392ca74",
"headers": "0swfh30yilw6w0qi6cl6ccm3rdvdmpr5s2vaxy5bbmizc88a4jkv",
"x86_64-darwin": "9f367006b67a923903e27b0be72a1a578b97936ca36cd91856adf4a278076d67",
"x86_64-linux": "2346338e2ffa12276f5b3bc6d63ff357c39f42d260ad45f19471ef7bbf18a389"
},
"version": "29.4.5"
"version": "29.4.6"
},
"30": {
"hashes": {
"aarch64-darwin": "9d7b31185ef61628e6f3abda32517953518f68d9f71a8fa29f2a0a17b9d3b9bb",
"aarch64-linux": "5f2326631080cc4a5f6231a83e492d8d75d9ccdd3bd41f56f6a1090e790d2a2a",
"armv7l-linux": "ef7be229a610cee357cba2f790618b239aab82fc2b26e0645c4cf4600dffb1c4",
"headers": "1s6cl0am8rv262s7ycixv3rjwry0s1ssimm109fh5xn2m808swn9",
"x86_64-darwin": "a66dbe01006fee9319f19c16ef08d4d72ecbb79bd35fffece32b36b8afe2ea47",
"x86_64-linux": "94d7470d9dae2dd2376612c804068ea6514e5efe342de8946f49f93bf0ed50de"
"aarch64-darwin": "2238c45a85b2c78aed00aeaf15bbfa2f64b4d13e48cc6b9bc330f24c4d214595",
"aarch64-linux": "aa422122373b84f4eb8ce937937b1b6fe8fb3975c3edafb9df85f7fba449afd4",
"armv7l-linux": "3643857e1eec3037ad6f07e755bffc64f033a7196307ff0386bf67c9cc3ec31e",
"headers": "1zpl51g8d0j6xw4h2pw1wy6qlwgxj37x4lsj377kg27y809rf5ah",
"x86_64-darwin": "6e633bf87be9f8bf46dff9733cfd0d611e018ae5df75f30735747721f91fcf43",
"x86_64-linux": "b365aac23c61dc0b18002c60937c4842e814cbe6d8e6a34e4dc211774ebaec01"
},
"version": "30.3.1"
"version": "30.4.0"
},
"31": {
"hashes": {
Expand Down
28 changes: 14 additions & 14 deletions pkgs/development/tools/electron/chromedriver/info.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"29": {
"hashes": {
"aarch64-darwin": "d2d4874957d6cf5b27168d9d1c96ef15cf333799b010dbee3bb6f64c16c228fb",
"aarch64-linux": "5bef9d44e32b853c31a11140c46304cfe2ba821e403beb55f14b9aa875ae1488",
"armv7l-linux": "128b6312f8677da8e133fc7878c7a476bd80f89d7002968e5f3d5946979c33a9",
"headers": "0yzwc2d8hfrsrpg4m7234cyvcx9ch3psx9rsywbli1avzb8rkjdi",
"x86_64-darwin": "f01ce2d13f6d3cdd957c06c90fc81ff1deb24b5d9084864bc0147acecaba2ea1",
"x86_64-linux": "4b305c3b0ce7b67316143162ba78bf217a95aa255c0cc847b2553551b0296790"
"aarch64-darwin": "8a100f4e7a84862847ab0804446ee805fbba0a68657420b369f80db417c1c87a",
"aarch64-linux": "232c375e4789b887a7f8712a64ac5849cf41904808b9aa00f6f6fbbf6621105d",
"armv7l-linux": "2c639a32c9436f135ef69db9640dcf4489b2dea30e865a0f63a87bb92d9ccf88",
"headers": "0swfh30yilw6w0qi6cl6ccm3rdvdmpr5s2vaxy5bbmizc88a4jkv",
"x86_64-darwin": "4364c264c932099d09fe67cc0072e6071739ad67ca1fecf5bfd7e8c1fdcc8671",
"x86_64-linux": "1c2b450b99929b49269a56db2dc60920f027ec92ae01a4620fa3f64473539caa"
},
"version": "29.4.5"
"version": "29.4.6"
},
"30": {
"hashes": {
"aarch64-darwin": "65621c6968832b604d1b81b65c2a4fdc56baafe167e76d22c55afa4c67c840f1",
"aarch64-linux": "c7767da210b8d4f084576e308570fcf15268c7f6a1182a621ce90788fe45d458",
"armv7l-linux": "509197b47830f31b715f3ab8940279c5b2c7f473c2059148efd86dffb58b895d",
"headers": "1s6cl0am8rv262s7ycixv3rjwry0s1ssimm109fh5xn2m808swn9",
"x86_64-darwin": "28001491af5805d8975f59edcee644f93e425b7e59f1fe94915ce9a286f7cd9e",
"x86_64-linux": "f4f6a66323b1180045321c779eacb88b48c8969e3ddf95d1d0aab92eb26ff071"
"aarch64-darwin": "3e432bd550279c2d58c6a02b0bda048fa2a9a89aef9752e22c39a518a83fe96f",
"aarch64-linux": "338f2a361448e78aa8c319cd582f2dd6d891d6c0c66b676c628e50511c27514f",
"armv7l-linux": "8cffae19618fe5f0eaff40378c40084e18f9747bbbe2d87390203a3012c98367",
"headers": "1zpl51g8d0j6xw4h2pw1wy6qlwgxj37x4lsj377kg27y809rf5ah",
"x86_64-darwin": "4d38f40ec33955dd0aef5cc0053b2b07c4744abb9f2614a44780280c4678aca9",
"x86_64-linux": "7ff1b75defc522f327c0f1bf6f4d13938b041cf5de1d7417b9dc5d1e7026e93c"
},
"version": "30.3.1"
"version": "30.4.0"
},
"31": {
"hashes": {
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 @@ -171,10 +171,8 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: {
use_qt = 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;
} // lib.optionalAttrs (lib.versionOlder info.version "31") {
use_perfetto_client_library = false;
Expand Down
Loading

0 comments on commit 893e9c6

Please sign in to comment.