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

chromium: delete unused paths in source tarball #261285

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

emilylange
Copy link
Member

@emilylange emilylange commented Oct 15, 2023

Description of changes

Delete unused paths in source tarball to stay below hydra limit.

At the time of writing, the hydra.nixos.org's output limit is 3 GB.
The latest chromium tarball, however, is slightly above that.

To work around this, recompress the original tar.xz into a tar.zstd
and delete two unreasonably big and unused directories.

Bringing it down to roughtly 2.2 GB.

Unfortunately, this change breaks the update.py script.

Resolves the current channel-blocker.

The alternative would be to increase hydra.nixos.org's output limit to something like 3.5 GB.
(But the next chromium release might exceed that as well /shrug)

#260783 (comment)
https://hydra.nixos.org/build/238056551

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

cc @vcunat @K900 @networkException

@emilylange emilylange marked this pull request as ready for review October 15, 2023 21:55
@dcarosone
Copy link

Not specifically for this instance or event, but I wonder: could we have a mechanism to add --exclude=<…> args to the extraction, and so prevent these files ever being expanded and written to disk all?

@emilylange
Copy link
Member Author

Adding something like that to fetchzip would be pretty cool, yes.
The main difficulty would probably be, that we have a lot of extraction handlers/hooks for different archives.

Meaning, each one of those would need to get patched.

Maybe in the long-term? :)

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 labels Oct 15, 2023
@Artturin
Copy link
Member

Artturin commented Oct 16, 2023

There's lots of unbundling possibilities in https://source.chromium.org/chromium/chromium/src/+/main:build/linux/unbundle/

These could automatically be removed from the archive

# https://source.chromium.org/chromium/chromium/src/+/master:build/linux/unbundle/replace_gn_files.py
gnSystemLibraries = [
# TODO:
# "ffmpeg"
# "snappy"
"flac"
"libjpeg"
"libpng"
"libwebp"
"libxslt"
# "opus"
];

with a comment to remember to update the hash when a lib is added there

to stay below hydra limit.

At the time of writing, the hydra.nixos.org's output limit is 3 GB.
The latest chromium tarball, however, is slightly above that.

To work around this, recompress the original `tar.xz` into a `tar.zstd`
and delete two unreasonably big and unused directories.

Bringing it down to roughtly 2.2 GB.

Unfortunately, this change breaks the `update.py` script.

Resolves the current channel-blocker.
@yu-re-ka
Copy link
Contributor

Long-term we could also consider re-using the gclient code from electron update script to get more control over what we fetch, and share submodules across electron and several chromium versions

@emilylange
Copy link
Member Author

Successfully compiled ungoogled-chromium on x86_64-linux and validated that it runs properly manually (but also ran the VM test).

The tar.zstd is reproducible as far as I know.
I tested it on multiple different systems (including one aarch64-linux) multiple times yesterday.

And a few minutes ago again due to the zstd -T0 -> zstd -T$NIX_BUILD_CORES change.

@vcunat vcunat merged commit ca012a0 into NixOS:master Oct 16, 2023
20 of 23 checks passed
@github-actions
Copy link
Contributor

Backport failed for release-23.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-23.05
git worktree add -d .worktree/backport-261285-to-release-23.05 origin/release-23.05
cd .worktree/backport-261285-to-release-23.05
git checkout -b backport-261285-to-release-23.05
ancref=$(git merge-base bb537a38dd8f0d292c34dad12f9fd84ffa600063 97738d7a1715d8022fd9d6e11e45586a56d9bdec)
git cherry-pick -x $ancref..97738d7a1715d8022fd9d6e11e45586a56d9bdec

@vcunat
Copy link
Member

vcunat commented Oct 16, 2023

Let me merge already, so that the channel is not blocked anymore. Certainly feel free to continue discussing and improving this.

@emilylange emilylange deleted the chromium-recompress-tarball branch October 16, 2023 12:50
KoviRobi added a commit to KoviRobi/nixos-config that referenced this pull request Oct 17, 2023
It wasn't build in hyrda due to
NixOS/nixpkgs#261285 and I'm not using it
day-to-day anyway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.severity: channel blocker Blocks a channel 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants