Skip to content

Add fallback to default url#1

Open
zerunz wants to merge 22 commits intomasterfrom
addFallbackToDefaultUrl
Open

Add fallback to default url#1
zerunz wants to merge 22 commits intomasterfrom
addFallbackToDefaultUrl

Conversation

@zerunz
Copy link
Copy Markdown
Owner

@zerunz zerunz commented Mar 3, 2023

When BAZELISK_BASE_URL is set and bazelisk fails to download Bazel from that URL, it would either throw an HTTPError or exit with 22. It should instead fallback to the default releases.bazel.build url.
Fixes bazelbuild#431

fweikert and others added 22 commits March 20, 2023 13:39
Due to a bug Bazelisk never read any binaries from the cache, thus resulting in severe runtime penalties.
The new BAZELISK_VERIFY_SHA256 variable can be set to the expected SHA256
hash of the downloaded Bazel binary.  If set, then the binary is required
to match the hash before it is used.

This is important for cases where provenance of the artifact cannot be
asserted purely via the HTTPS trust chain (such as what happens in a
mutable artifact repository with lax access controls).
…azelbuild#451)

* Support bisecting Bazel to find which Bazel change breaks your build

- Use --bisect=<BASE>..<HEAD> to specify the bisecting range, Bazelisk
  uses the GitHub API to get the list of commits to bisect. You may need
  to set `BAZELISK_GITHUB_TOKEN` to get around GitHub rate limit.
- BAZELISK_SHUTDOWN, BAZELISK_CLEAN can be used to run `bazel shutdown`
  or `bazel clean --expunge` between builds.

* Add doc

* Remove unused struct

* small fixes

* Fix --strict
…#447)

Bumps [github.com/bazelbuild/rules_go](https://github.com/bazelbuild/rules_go) from 0.38.1 to 0.39.1.
- [Release notes](https://github.com/bazelbuild/rules_go/releases)
- [Commits](bazel-contrib/rules_go@v0.38.1...v0.39.1)

---
updated-dependencies:
- dependency-name: github.com/bazelbuild/rules_go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This new configuration setting provides a format-like string to compute the
URL from which to fetch Bazel.  Takes precedence over BAZELISK_BASE_URL as
this is a more general concept.

Fixes bazelbuild#423.
Duplicated `go_tests` can result in compilation actions failing due to bazel-contrib/rules_go#3558.
Before this change, changing which mirror you were downloading from
would change the $PATH environment variable bazel is run with, even
though the bazel binaries being pointed to are identical. This can cause
repository rules to invalidate and re-run.

Instead, store downloaded bazels in directories keyed off of the sha256
of the bazel binary itself, and track the metadata of a mirror+version
-> sha256.

This avoid spurious rebuilds when only changing the URL bazelisk would
use to download bazel.
My goal here is to be able to pass my own config implementation when
calling RunBazelisk from code without setting environment variables,
because they cause repository rule cache invalidations.

As a side-effect, it helps towards the TODO in core.go to split
functionality into packages.
@zerunz zerunz force-pushed the addFallbackToDefaultUrl branch from 3b8682f to 2e46381 Compare July 5, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add fallback to default releases.bazel.build url

7 participants