From 9fc34132c4393ca387816d8a38e747219063be0e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 20 Oct 2025 21:16:22 +0200 Subject: [PATCH 1/2] servo: 0-unstable-2025-07-30 -> 0.0.1-unstable-2025-10-22 https://github.com/servo/servo/compare/e6b604a276959c218591b463f5b3b2ec8c3bcaec...efc8c0f6647e542e35bac732585bc3aef6578028 Co-authored-by: Niklas Korz --- pkgs/by-name/se/servo/package.nix | 38 +++++++++++++++++++++++-------- pkgs/by-name/se/servo/update.sh | 28 ----------------------- 2 files changed, 29 insertions(+), 37 deletions(-) delete mode 100755 pkgs/by-name/se/servo/update.sh diff --git a/pkgs/by-name/se/servo/package.nix b/pkgs/by-name/se/servo/package.nix index c6b69dc98503..851ee7fe32d1 100644 --- a/pkgs/by-name/se/servo/package.nix +++ b/pkgs/by-name/se/servo/package.nix @@ -3,6 +3,7 @@ stdenv, rustPlatform, fetchFromGitHub, + nix-update-script, # build deps cargo-deny, @@ -21,7 +22,6 @@ uv, which, yasm, - zlib, # runtime deps apple-sdk_14, @@ -36,6 +36,7 @@ vulkan-loader, wayland, xorg, + zlib, # tests nixosTests, @@ -65,13 +66,13 @@ in rustPlatform.buildRustPackage { pname = "servo"; - version = "0-unstable-2025-07-30"; + version = "0.0.1-unstable-2025-10-22"; src = fetchFromGitHub { owner = "servo"; repo = "servo"; - rev = "0e180578632facc10f0e8fb29df9084369adc600"; - hash = "sha256-4EQ15jOZNYjGmhIOJivHT8R6BeT6moGj+AI9DBq58v4="; + rev = "efc8c0f6647e542e35bac732585bc3aef6578028"; + hash = "sha256-mLXs0OaOLD12hFQ8w/3xnDV+4fhjRKToRjZZMPDJ9X8="; # Breaks reproducibility depending on whether the picked commit # has other ref-names or not, which may change over time, i.e. with # "ref-names: HEAD -> main" as long this commit is the branch HEAD @@ -81,7 +82,7 @@ rustPlatform.buildRustPackage { ''; }; - cargoHash = "sha256-fqIlN+6SEY0LVrUk47U12TuVoRte0oCGJhO7DHovzBM="; + cargoHash = "sha256-POMWoM5NVeas/t1XivqBDrhZy7qRvIL3e01Wu3893L4="; # set `HOME` to a temp dir for write access # Fix invalid option errors during linking (https://github.com/mozilla/nixpkgs-mozilla/commit/c72ff151a3e25f14182569679ed4cd22ef352328) @@ -108,11 +109,21 @@ rustPlatform.buildRustPackage { uv which yasm - zlib ]; env.UV_PYTHON = customPython.interpreter; + postPatch = '' + # mozjs-sys attempts to find the header path of the icu_capi crate through cargo-metadata at build time. + # Unfortunately, cargo-metadata also attempts to fetch optional, disabled crates in the process. + # As these are not part of servo's Cargo.lock, they are not included in our cache and cargo-metadata fails. + # We work around this by finding the header path ourselves and substituting the invocation in mozjs-sys' build.rs. + icu_capi_dir=$(find $cargoDepsCopy -maxdepth 2 -type d -name icu_capi-\*) + icu_c_include_path="$icu_capi_dir/bindings/c" + substituteInPlace $cargoDepsCopy/mozjs_sys-*/build.rs \ + --replace-fail "let icu_c_include_path = get_icu_capi_include_path();" "let icu_c_include_path = \"$icu_c_include_path\".to_string();" + ''; + buildInputs = [ fontconfig freetype @@ -124,6 +135,7 @@ rustPlatform.buildRustPackage { harfbuzz libunwind libGL + zlib ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wayland @@ -141,7 +153,16 @@ rustPlatform.buildRustPackage { "servo_allocator/use-system-allocator" ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = toString ( + [ + # mozjs-sys fails with: + # cc1plus: error: '-Wformat-security' ignored without '-Wformat' + "-Wno-error=format-security" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1" + ] + ); # copy resources into `$out` to be used during runtime # link runtime libraries @@ -154,12 +175,11 @@ rustPlatform.buildRustPackage { ''; passthru = { - updateScript = ./update.sh; + updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; tests = { inherit (nixosTests) servo; }; }; meta = { - broken = true; # cargo fetcher leaves invalid Cargo.toml around, which breaks mozjs-sys build description = "Embeddable, independent, memory-safe, modular, parallel web rendering engine"; homepage = "https://servo.org"; license = lib.licenses.mpl20; diff --git a/pkgs/by-name/se/servo/update.sh b/pkgs/by-name/se/servo/update.sh deleted file mode 100755 index ffb4265b6c70..000000000000 --- a/pkgs/by-name/se/servo/update.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p coreutils common-updater-scripts curl jq nix-update - -# This update script exists, because nix-update is unable to ignore various -# bogus tags that exist on the upstream repo e.g. -# - selectors-v0.18.0/v0.20.0/v0.21.0/v0.22.0 -# - homu-tmp -# -# Once https://github.com/Mic92/nix-update/issues/322 is resolved it can be -# removed. - -set -exuo pipefail - -# Determine latest commit id and date -TMP=$(mktemp) -curl -o "$TMP" https://api.github.com/repos/servo/servo/commits/main -COMMIT_ID=$(jq -r '.sha' "$TMP") -COMMIT_TIMESTAMP=$(jq -r '.commit.author.date' "$TMP") -COMMIT_DATE=$(date -d "$COMMIT_TIMESTAMP" +"%Y-%m-%d") -rm $TMP - -cd "$(git rev-parse --show-toplevel)" - -# Update version, src -update-source-version servo "0-unstable-${COMMIT_DATE}" --file=pkgs/by-name/se/servo/package.nix --rev="$COMMIT_ID" - -# Update cargoHash -nix-update --version=skip servo From bd66b2590a62c05c3429ce6705d65fd5beed6c9c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 23 Oct 2025 00:08:14 +0200 Subject: [PATCH 2/2] servo: add ngi team as maintainers Added with the expectation that they'll earn that role through regular updates, reviews and responding to issues. --- pkgs/by-name/se/servo/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/se/servo/package.nix b/pkgs/by-name/se/servo/package.nix index 851ee7fe32d1..96cf22b68d7e 100644 --- a/pkgs/by-name/se/servo/package.nix +++ b/pkgs/by-name/se/servo/package.nix @@ -187,6 +187,7 @@ rustPlatform.buildRustPackage { hexa supinie ]; + teams = with lib.teams; [ ngi ]; mainProgram = "servo"; platforms = lib.platforms.linux ++ lib.platforms.darwin; };