diff --git a/pkgs/applications/networking/browsers/chromium/README.md b/pkgs/applications/networking/browsers/chromium/README.md index 9576cb486288eb..4c93daee4a36ba 100644 --- a/pkgs/applications/networking/browsers/chromium/README.md +++ b/pkgs/applications/networking/browsers/chromium/README.md @@ -29,7 +29,7 @@ - Release updates: https://chromereleases.googleblog.com/ - Available as Atom or RSS feed (filter for "Stable Channel Update for Desktop") - - Channel overview: https://omahaproxy.appspot.com/ + - Release API: https://developer.chrome.com/docs/versionhistory/guide/ - Release schedule: https://chromiumdash.appspot.com/schedule # Updating Chromium @@ -39,6 +39,16 @@ update `upstream-info.json`. After updates it is important to test at least `nixosTests.chromium` (or basic manual testing) and `google-chrome` (which reuses `upstream-info.json`). +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 diff --git a/pkgs/applications/networking/browsers/chromium/update.py b/pkgs/applications/networking/browsers/chromium/update.py index 2a370a1a33b8d2..1a38ab72e4644f 100755 --- a/pkgs/applications/networking/browsers/chromium/update.py +++ b/pkgs/applications/networking/browsers/chromium/update.py @@ -19,7 +19,7 @@ from os.path import abspath, dirname from urllib.request import urlopen -HISTORY_URL = 'https://omahaproxy.appspot.com/history?os=linux' +RELEASES_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/all/versions/all/releases' DEB_URL = 'https://dl.google.com/linux/chrome/deb/pool/main/g' BUCKET_URL = 'https://commondatastorage.googleapis.com/chromium-browser-official' @@ -103,7 +103,7 @@ def get_latest_ungoogled_chromium_build(): tag = get_latest_ungoogled_chromium_tag() version = tag.split('-')[0] return { - 'channel': 'ungoogled-chromium', + 'name': 'chrome/platforms/linux/channels/ungoogled-chromium/versions/', 'version': version, 'ungoogled_tag': tag } @@ -159,27 +159,26 @@ def print_updates(channels_old, channels_new): last_channels = load_json(JSON_PATH) -print(f'GET {HISTORY_URL}', file=sys.stderr) -with urlopen(HISTORY_URL) as resp: - builds = csv.DictReader(iterdecode(resp, 'utf-8')) - builds = list(builds) - builds.append(get_latest_ungoogled_chromium_build()) - for build in builds: - channel_name = build['channel'] +print(f'GET {RELEASES_URL}', file=sys.stderr) +with urlopen(RELEASES_URL) as resp: + releases = json.load(resp)['releases'] + releases.append(get_latest_ungoogled_chromium_build()) + for release in releases: + channel_name = re.findall("chrome\/platforms\/.*\/channels\/(.*)\/versions\/", release['name'])[0] - # If we've already found a newer build for this channel, we're + # If we've already found a newer release for this channel, we're # no longer interested in it. if channel_name in channels: continue - # If we're back at the last build we used, we don't need to + # If we're back at the last release we used, we don't need to # keep going -- there's no new version available, and we can # just reuse the info from last time. - if build['version'] == last_channels[channel_name]['version']: + if release['version'] == last_channels[channel_name]['version']: channels[channel_name] = last_channels[channel_name] continue - channel = {'version': build['version']} + channel = {'version': release['version']} if channel_name == 'dev': google_chrome_suffix = 'unstable' elif channel_name == 'ungoogled-chromium': @@ -188,13 +187,13 @@ def print_updates(channels_old, channels_new): google_chrome_suffix = channel_name try: - channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{build["version"]}.tar.xz') + channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{release["version"]}.tar.xz') channel['sha256bin64'] = nix_prefetch_url( f'{DEB_URL}/google-chrome-{google_chrome_suffix}/' + - f'google-chrome-{google_chrome_suffix}_{build["version"]}-1_amd64.deb') + f'google-chrome-{google_chrome_suffix}_{release["version"]}-1_amd64.deb') except subprocess.CalledProcessError: if (channel_name == 'ungoogled-chromium' and 'sha256' in channel and - build['version'].split('.')[0] == last_channels['stable']['version'].split('.')[0]): + release['version'].split('.')[0] == last_channels['stable']['version'].split('.')[0]): # Sometimes ungoogled-chromium is updated to a newer tag than # the latest stable Chromium version. In this case we'll set # sha256bin64 to null and the Nixpkgs code will fall back to @@ -202,7 +201,7 @@ def print_updates(channels_old, channels_new): # Widevine/DRM which is disabled by default): channel['sha256bin64'] = None else: - # This build isn't actually available yet. Continue to + # This release isn't actually available yet. Continue to # the next one. continue @@ -212,11 +211,11 @@ def print_updates(channels_old, channels_new): elif channel_name == 'ungoogled-chromium': ungoogled_repo_url = 'https://github.com/Eloston/ungoogled-chromium.git' channel['deps']['ungoogled-patches'] = { - 'rev': build['ungoogled_tag'], - 'sha256': nix_prefetch_git(ungoogled_repo_url, build['ungoogled_tag'])['sha256'] + 'rev': release['ungoogled_tag'], + 'sha256': nix_prefetch_git(ungoogled_repo_url, release['ungoogled_tag'])['sha256'] } with open(UNGOOGLED_FLAGS_PATH, 'w') as out: - out.write(get_ungoogled_chromium_gn_flags(build['ungoogled_tag'])) + out.write(get_ungoogled_chromium_gn_flags(release['ungoogled_tag'])) channels[channel_name] = channel