Skip to content

Commit

Permalink
Remove .cipd-cache and third_party/depot_tools/.cipd_bin/.cipd
Browse files Browse the repository at this point in the history
To make the build hermetic.
After this CL, on my workstation, regenerating the chrome soruce
tarball no longer results in rebuilding chromeos-chrome.

BUG=b:304441605
TEST=bazel build @portage//chromeos-base/chromeos-chrome

Change-Id: I4ac8b5dbf82460c91ed933055b8b37716dcf8b0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/bazel/+/4951533
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
  • Loading branch information
Ryo Hashimoto authored and Chromeos LUCI committed Oct 18, 2023
1 parent 958f83f commit cad9edb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions portage/repo_defs/chrome/cros_chrome_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ def _cros_chrome_repository_impl(ctx):
"--transform=flags=rSh;s,^,/home/root/chrome_root/,",
]

# Remove .cipd-cache/instances/state.db as there is no guarantee about its
# contents. CIPD will regenerate it if needed.
ctx.delete(".cipd-cache/instances/state.db")
# Remove CIPD cache files to make this hermetic.
ctx.delete("src/third_party/depot_tools/.cipd_bin/.cipd")

# We use zstd since it's way faster than gzip and should be installed by
# default on most distributions. Hopefully the compression algorithm doesn't
Expand All @@ -143,12 +142,14 @@ def _cros_chrome_repository_impl(ctx):
# Hashes of all the dependencies. Useful since we don't include the
# .git directories.
".gclient_entries",
# cipd lookup cache
".cipd-cache",
# We don't include the .vpython-root since it contains absolute
# symlinks which we can't use inside the chroot. Since we have the
# cache and pkgs we can recreate it in the chroot without network
# access.

# We don't include the .cipd-cache because it's not hermetic.
# TODO(b/304441605): Consider including it to avoid performing
# network IO when building chrome.
],
ZSTD_NBTHREADS = "0",
msg = "Tarring up Chromium src",
Expand Down

0 comments on commit cad9edb

Please sign in to comment.