Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Removed bazel_latest from default dependencies #1813

Merged
merged 5 commits into from
Apr 24, 2021
Merged

Removed bazel_latest from default dependencies #1813

merged 5 commits into from
Apr 24, 2021

Conversation

UebelAndre
Copy link
Contributor

@UebelAndre UebelAndre commented Apr 23, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

The bazel_latest image takes quite a bit of time to fetch (Fetching @bazel_latest; fetching 65s or more) which causes undesired slowness when performing Bazel sync and adds a sizable dependency which is never used. To my knowledge, this image is only used for testing:

container_repro_test = rule(
attrs = dicts.add(_container.image.attrs, {
"base": attr.label(
default = "@bazel_latest//image",
allow_rules = [
"container_image_",
"container_import",
"toolchain_container_",
],
doc = "An image target compatible with the `base` attribute of " +
"the container_image rule to build and reproduce the " +
"'image' in. This image must have Bazel and docker " +
"installed and available in the PATH.",
),

Users should not be forced to include this dependency in their workspace unless it's needed for a public facing rule.

Issue Number: N/A

What is the new behavior?

The images macro is no longer called in the deps macro. This prevents the bazel_latest image from being added to users workspace when loading container_deps per the Setup documentation.

Does this PR introduce a breaking change?

  • Yes
  • No

Users who depend on this image will now have to load it explicitly via:

load("@io_bazel_rules_docker//repositories:images.bzl", rules_docker_images = "images")

rules_docker_images()

Though, it would have been in user's best interest to load this image themselves in the first place because this image does not provide a digest and therefore isn't cached as effectively as it should be.

Other information

@google-cla google-cla bot added the cla: yes label Apr 23, 2021
@UebelAndre UebelAndre marked this pull request as ready for review April 23, 2021 14:02
@UebelAndre
Copy link
Contributor Author

It's not clear to me why RBE is running into this failure

(15:21:43) WARNING: Download from http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0xEB9B1D8886F44E2A failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was 589abea78ff5784ac519b5aada2a8f4e76d06041113d4def643532dcd7437b36 but wanted e9a596d0c194a562be9fd2c2a0994d7885505a1145fed0fbd5ae4c11d56220a0
(15:21:43) ERROR: An error occurred during the fetch of repository 'launchpad_openjdk_gpg':
   Traceback (most recent call last):
	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/bazel_tools/tools/build_defs/repo/http.bzl", line 150, column 33, in _http_file_impl
		download_info = ctx.download(
Error in download: java.io.IOException: Error downloading [http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0xEB9B1D8886F44E2A] to /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/launchpad_openjdk_gpg/file/downloaded: Checksum was 589abea78ff5784ac519b5aada2a8f4e76d06041113d4def643532dcd7437b36 but wanted e9a596d0c194a562be9fd2c2a0994d7885505a1145fed0fbd5ae4c11d56220a0
(15:21:43) ERROR: Error fetching repository: Traceback (most recent call last):
	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/bazel_tools/tools/build_defs/repo/http.bzl", line 150, column 33, in _http_file_impl
		download_info = ctx.download(
Error in download: java.io.IOException: Error downloading [http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0xEB9B1D8886F44E2A] to /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/launchpad_openjdk_gpg/file/downloaded: Checksum was 589abea78ff5784ac519b5aada2a8f4e76d06041113d4def643532dcd7437b36 but wanted e9a596d0c194a562be9fd2c2a0994d7885505a1145fed0fbd5ae4c11d56220a0

I don't get this issue locally and no other build seems to have issues. Help would be greatly appreciated.

@alexeagle alexeagle merged commit 0adf8b2 into bazelbuild:master Apr 24, 2021
@UebelAndre UebelAndre deleted the images branch April 24, 2021 15:34
martaver pushed a commit to cleric-sh/rules_docker that referenced this pull request May 18, 2021
removed bazel_latest from default dependencies as it's only used for testing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants