Repository navigation
feat: support platform-specific SHA256 verification - #766
Draft
albertocavalcante wants to merge 2 commits into
Draft
albertocavalcante wants to merge 2 commits into
albertocavalcante wants to merge 2 commits into
Conversation
albertocavalcante
force-pushed
the
feat/platform-specific-sha256-verification
branch
9 times, most recently
from
January 25, 2026 15:56
658831a to
76873b5
Compare
albertocavalcante
force-pushed
the
feat/platform-specific-sha256-verification
branch
2 times, most recently
from
January 28, 2026 20:33
f78653c to
81f96d5
Compare
fweikert
reviewed
Feb 13, 2026
Contributor
|
@albertocavalcante Do you need any help with this feature? From what I can see, you've already done most of the work. |
Contributor
Author
|
@valco1994, thank you for offering assistance. I really appreciate it. To be honest, I had some issues with GitHub recently, and as a side effect, I ended up forgetting to finish it. I'll resume and finish it today or this weekend; otherwise, I will let you know. Apologies. |
albertocavalcante
force-pushed
the
feat/platform-specific-sha256-verification
branch
from
May 1, 2026 10:10
81f96d5 to
4718ef3
Compare
Contributor
|
Wounderful, thank you for your work! |
Check the configured expectation before reusing a recorded cache digest as well as after downloads. Reject mismatches without deleting cached content or retrying a download, and preserve case-insensitive hash comparison. Cover warm and cold cache behavior with an offline downloader fixture. The warm-cache mismatch regression fails on the parent revision. Co-authored-by: Alberto Cavalcante <alberto@cavalcante.uk>
Select NOJDK, platform, and generic expectations for the resolved artifact. Use the selected raw value in custom URL hash substitution and compare it case-insensitively for both cached and downloaded content. Keep filename formatting independent of the host, document supported names and source precedence, and invoke the shell integration wrapper directly. Cover URL casing, layered config, Darwin fallback, warm-cache rejection, NOJDK downloads, and platform override behavior. Fixes bazelbuild#522 Co-authored-by: Alberto Cavalcante <alberto@cavalcante.uk>
albertocavalcante
force-pushed
the
feat/platform-specific-sha256-verification
branch
from
November 6, 2026 01:34
4718ef3 to
949097d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Multiplatform projects cannot share a single Bazel binary hash. Select the first nonempty expected hash for the resolved artifact:
BAZELISK_VERIFY_SHA256_NOJDK_<OS>_<ARCH>, when NOJDK is enabled.BAZELISK_VERIFY_SHA256_<OS>_<ARCH>.BAZELISK_VERIFY_SHA256.The README lists
DARWIN,LINUX, andWINDOWS, each withARM64andX86_64, and explains artifact architecture fallback and configuration-source precedence. No applicable hash preserves the existing behavior of skipping expected-hash verification.The same selected value drives cache/download verification and
%hin custom URLs. Comparisons ignore letter casing; URL substitution preserves the configured casing. Filename formatting uses its explicit OS argument, including Windows suffixes.Fixes #522.
Dependency and readiness
Depends on #827, which fixes existing generic expectations being ignored on cache hits. This branch currently includes that prerequisite so the complete behavior can be tested. After it lands, rebase this PR onto the merged upstream target and remove the prerequisite from the diff.
Keep this PR in draft until the prerequisite and required upstream checks are complete. The original feature head is retained locally as a backup, and the feature commit preserves its original author and author date.
Validation
go test ./...go vet ./core ./platformsgit diff --checkThe shell integration test now writes
.bazeliskrcand calls the harness function directly, replacing the failingenv ... bazeliskcalls. It covers platform-over-generic precedence and changed expectations on a warm cache. Its six pinned Bazel 9.0.0 digests match official checksum files; six native platform combinations have not been claimed as executed.Limits and rollback
Verification compares the expected value with a recorded cache digest on cache hits; it does not rehash cached binaries. Key specificity precedes source precedence, as documented and tested. Runmux was unavailable; this contribution leaves required upstream Buildkite infrastructure unchanged.
Reverting the feature removes platform-key support. Consumers using only those keys need matching generic configuration per platform and NOJDK flavor to retain verification. No cache migration or deletion is required.
Hash selection stays private and raw; comparison uses
strings.EqualFold. The generic config-normalization TODO from #767 is removed because this design does not need that broader abstraction. Reconcile that issue after the feature lands.Review evidence
Reviewed publication head:
949097d0a5668bdde737bdaf252280df4c7edf3e.Cache prerequisite:
acbfe36c8f432701cac6360c129a8450adbbb34e(#827).Independent review inspected the complete eight-file diff against upstream, including the cache prerequisite and relevant IO paths. A disposable-archive parent check failed five platform/NOJDK URL assertions; a generic-only selection mutant failed both warm-cache feature rejection assertions. Disposable review archives were removed.