servo: 0-unstable-2025-07-30 -> 0.0.1-unstable-2025-10-20 (#453957)

This commit is contained in:
Martin Weinelt
2025-10-22 23:18:10 +00:00
committed by GitHub
2 changed files with 30 additions and 37 deletions
+30 -9
View File
@@ -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;
@@ -167,6 +187,7 @@ rustPlatform.buildRustPackage {
hexa
supinie
];
teams = with lib.teams; [ ngi ];
mainProgram = "servo";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
-28
View File
@@ -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