Skip to content

Commit

Permalink
Merge pull request #278603 from emilylange/chromium
Browse files Browse the repository at this point in the history
{ungoogled-,}chromium: 120.0.6099.129 -> 120.0.6099.199, improve and move `recompressTarball`
  • Loading branch information
emilylange authored Jan 5, 2024
2 parents b7d435d + d163ea4 commit e03da10
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 46 deletions.
10 changes: 0 additions & 10 deletions pkgs/applications/networking/browsers/chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ update `upstream-info.nix`. After updates it is important to test at least
`nixosTests.chromium` (or basic manual testing) and `google-chrome` (which
reuses `upstream-info.nix`).

Note: Due to the script downloading many large tarballs it might be
necessary to adjust the available tmpfs size (it defaults to 10% of the
systems memory)

```nix
services.logind.extraConfig = ''
RuntimeDirectorySize=4G
'';
```

Note: The source tarball is often only available a few hours after the release
was announced. The CI/CD status can be tracked here:
- https://ci.chromium.org/p/infra/builders/cron/publish_tarball
Expand Down
29 changes: 1 addition & 28 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, lib, fetchurl, fetchpatch
, fetchzip, zstd
, recompressTarball
, buildPackages
, pkgsBuildBuild
, pkgsBuildTarget
Expand Down Expand Up @@ -148,33 +148,6 @@ let
else throw "no chromium Rosetta Stone entry for os: ${platform.config}";
};

recompressTarball = { version, hash ? "" }: fetchzip {
name = "chromium-${version}.tar.zstd";
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit hash;

nativeBuildInputs = [ zstd ];

postFetch = ''
echo removing unused code from tarball to stay under hydra limit
rm -r $out/third_party/{rust-src,llvm}
echo moving remains out of \$out
mv $out source
echo recompressing final contents into new tarball
# try to make a deterministic tarball
tar \
--use-compress-program "zstd -T$NIX_BUILD_CORES" \
--sort name \
--mtime 1970-01-01 \
--owner=root --group=root \
--numeric-owner --mode=go=rX,u+rw,a-s \
-cf $out source
'';
};


base = rec {
pname = "${lib.optionalString ungoogled "ungoogled-"}${packageName}-unwrapped";
inherit (upstream-info) version;
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/networking/browsers/chromium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ let
inherit (upstream-info.deps.gn) url rev hash;
};
});
recompressTarball = callPackage ./recompress-tarball.nix { };
});

browser = callPackage ./browser.nix {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ zstd
, fetchurl
}:

{ version
, hash ? ""
, ...
} @ args:

fetchurl ({
name = "chromium-${version}.tar.zstd";
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit hash;

# chromium xz tarballs are multiple gigabytes big and are sometimes downloaded multiples
# times for different versions as part of our update script.
# We originally inherited fetchzip's default for downloadToTemp (true).
# Given the size of the /run/user tmpfs used defaults to logind's RuntimeDirectorySize=,
# which in turn defaults to 10% of the total amount of physical RAM, this often lead to
# "no space left" errors, eventually resulting in its own section in our chromium
# README.md (for users wanting to run the update script).
# Nowadays, we use fetchurl instead of fetchzip, which defaults to false instead of true.
# We just want to be explicit and provide a place to document the history and reasoning
# behind this.
downloadToTemp = false;

nativeBuildInputs = [ zstd ];

postFetch = ''
cat "$downloadedFile" \
| xz -d --threads=$NIX_BUILD_CORES \
| tar xf - \
--warning=no-timestamp \
--one-top-level=source \
--exclude=third_party/llvm \
--exclude=third_party/rust-src \
--strip-components=1
tar \
--use-compress-program "zstd -T$NIX_BUILD_CORES" \
--sort name \
--mtime "1970-01-01" \
--owner=root --group=root \
--numeric-owner --mode=go=rX,u+rw,a-s \
-cf $out source
'';
} // removeAttrs args [ "version" ])
16 changes: 8 additions & 8 deletions pkgs/applications/networking/browsers/chromium/upstream-info.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
version = "2023-10-23";
};
};
hash = "sha256-+T2TOLwIwFxVDae7MFDZrjREGF+3Zx2xt/Dlu7uZggc=";
hash_deb_amd64 = "sha256-0FB1gTbsjqFRy0ocE0w5ACtD9kSJ5AMnxg+qBxqCulc=";
version = "120.0.6099.129";
hash = "sha256-lT1CCwYj0hT4tCJb689mZwNecUsEwcfn2Ot8r9LBT+M=";
hash_deb_amd64 = "sha256-4BWLn0+gYNWG4DsolbY6WlTvXWl7tZIZrnqXlrGUGjQ=";
version = "120.0.6099.199";
};
ungoogled-chromium = {
deps = {
Expand All @@ -28,12 +28,12 @@
version = "2023-10-23";
};
ungoogled-patches = {
hash = "sha256-kVhAa/+RnYEGy7McysqHsb3ysPIILnxGXe6BTLbioQk=";
rev = "120.0.6099.129-1";
hash = "sha256-B1MNo8BdjMOmTvIr4uu3kg/MO1t+YLQz2S23L4Cye3E=";
rev = "120.0.6099.199-1";
};
};
hash = "sha256-+T2TOLwIwFxVDae7MFDZrjREGF+3Zx2xt/Dlu7uZggc=";
hash_deb_amd64 = "sha256-0FB1gTbsjqFRy0ocE0w5ACtD9kSJ5AMnxg+qBxqCulc=";
version = "120.0.6099.129";
hash = "sha256-lT1CCwYj0hT4tCJb689mZwNecUsEwcfn2Ot8r9LBT+M=";
hash_deb_amd64 = "sha256-4BWLn0+gYNWG4DsolbY6WlTvXWl7tZIZrnqXlrGUGjQ=";
version = "120.0.6099.199";
};
}

0 comments on commit e03da10

Please sign in to comment.