Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron-{bin,source,chromedriver}_35: init at 35.0.3 #387294

Merged
merged 8 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
@@ -294,6 +294,7 @@ let
nativeBuildInputs =
[
ninja
gnChromium
]
++ lib.optionals needsCompgen [
bashInteractive # needed for compgen in buildPhase -> process_template
@@ -793,7 +794,7 @@ let
# This is to ensure expansion of $out.
libExecPath="${libExecPath}"
${python3.pythonOnBuildForHost}/bin/python3 build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries}
${gnChromium}/bin/gn gen --args=${lib.escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt
gn gen --args=${lib.escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt

# Fail if `gn gen` contains a WARNING.
grep -o WARNING gn-gen-outputs.txt && echo "Found gn WARNING, exiting nix build" && exit 1
11 changes: 11 additions & 0 deletions pkgs/development/tools/electron/binary/info.json
Original file line number Diff line number Diff line change
@@ -31,5 +31,16 @@
"x86_64-linux": "7ddd7e64846d72f90f62c4af29ce7930859b7d2ffac256c156e5bfa36f9e9b39"
},
"version": "34.3.3"
},
"35": {
"hashes": {
"aarch64-darwin": "1f4a5d6f43de4a39b45ff2d17e2165b5ac236480eec811e0ff8e8ac78094840c",
"aarch64-linux": "b6068824cfe1f69add33320237cb994e2f9630fb568afa5c4dca6e6b74c6f6e0",
"armv7l-linux": "187b27a2db6b20fda3b0542670c9b490d246f1b7111fe71c7d6e31b2788042ce",
"headers": "0i7x7liv4dwqg4ijlgr3z28s3802hmbz6z56xvlg40jkq4g28j11",
"x86_64-darwin": "469d6f90744127e9d53ec0116c0eca94cd6f6d8c74be70b7e7e8251f047f0205",
"x86_64-linux": "44504bde889285d5798bd5921de87af492551ab1221be531a678dbb39ad58288"
},
"version": "35.0.3"
}
}
11 changes: 11 additions & 0 deletions pkgs/development/tools/electron/chromedriver/info.json
Original file line number Diff line number Diff line change
@@ -31,5 +31,16 @@
"x86_64-linux": "999fb44c5877b34da0ee6e24eb0ce74e521ed47e84db107b6037488ec51d45f1"
},
"version": "34.3.3"
},
"35": {
"hashes": {
"aarch64-darwin": "529ef74efb2222618e02a4df3004c21d61f9dfe27a2787b9111a4a00906e260d",
"aarch64-linux": "fd3d8ba3e0604cf417e373d06ece9f6abdf925dc42c68bf2a559d512f553a021",
"armv7l-linux": "728a7db1e5196e3e6330c424a633219f6f5e8297895f7f13a0971f41e96d9d65",
"headers": "0i7x7liv4dwqg4ijlgr3z28s3802hmbz6z56xvlg40jkq4g28j11",
"x86_64-darwin": "b36a45a4a70834067d338f7f3e472278c044f7a53522f9367c91ab51dde96902",
"x86_64-linux": "39c908639d5a121eb524f3fd4af3c5649f18247ddb7b4ce41438c39ad190eeeb"
},
"version": "35.0.3"
}
}
20 changes: 18 additions & 2 deletions pkgs/development/tools/electron/common.nix
Original file line number Diff line number Diff line change
@@ -64,6 +64,23 @@ in
hash = info.chromium_npm_hash;
};

env =
base.env
// {
# Hydra can fail to build electron due to clang spamming deprecation
# warnings mid-build, causing the build log to grow beyond the limit
# of 64mb and then getting killed by Hydra.
# For some reason, the log size limit appears to only be enforced on
# aarch64-linux. x86_64-linux happily succeeds to build with ~180mb. To
# unbreak the build on h.n.o, we simply disable those warnings for now.
# https://hydra.nixos.org/build/283952243
NIX_CFLAGS_COMPILE = base.env.NIX_CFLAGS_COMPILE + " -Wno-deprecated";
}
// lib.optionalAttrs (lib.versionAtLeast info.version "35") {
# Needed for header generation in electron 35 and above
ELECTRON_OUT_DIR = "Release";
};

src = null;

patches = base.patches;
@@ -178,7 +195,7 @@ in
# build/args/all.gn
is_electron_build = true;
root_extra_deps = [ "//electron" ];
node_module_version = info.modules;
node_module_version = lib.toInt info.modules;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a bit funny that you opted to use lib.toInt here. But not in a discouraging way. Feel free to do whatever floats you boat. Also, I am no longer involved in maintaining electron.
And not wanting to touch the update script feels like a common pattern. Especially because this is returned as a string by the releases API.

Rather, because I find the chain of function invocations funny:

builtins.fromJSON reads it as string -> lib.toInt -> if lib.isInt value -> toString (instead of mkGnString if it would already be a string):

mkGnFlags =
let
# Serialize Nix types into GN types according to this document:
# https://source.chromium.org/gn/gn/+/master:docs/language.md
mkGnString = value: "\"${lib.escape [ "\"" "$" "\\" ] value}\"";
sanitize =
value:
if value == true then
"true"
else if value == false then
"false"
else if lib.isList value then
"[${lib.concatMapStringsSep ", " sanitize value}]"
else if lib.isInt value then
toString value
else if lib.isString value then
mkGnString value
else
throw "Unsupported type for GN value `${value}'.";
toFlag = key: value: "${key}=${sanitize value}";
in
attrs: lib.concatStringsSep " " (lib.attrValues (lib.mapAttrs toFlag attrs));

v8_promise_internal_field_count = 1;
v8_embedder_string = "-electron.0";
v8_enable_snapshot_native_code_counters = false;
@@ -193,7 +210,6 @@ in
allow_runtime_configurable_key_storage = true;
enable_cet_shadow_stack = false;
is_cfi = false;
use_qt = false;
v8_builtins_profiling_log_file = "";
enable_dangling_raw_ptr_checks = false;
dawn_use_built_dxc = false;
Loading
Oops, something went wrong.