Skip to content

Use canonical_id in rctx.download and use the latest github release version#62

Merged
perezd merged 1 commit intobufbuild:mainfrom
Strum355:nsc/download-with-canonical-id
May 29, 2024
Merged

Use canonical_id in rctx.download and use the latest github release version#62
perezd merged 1 commit intobufbuild:mainfrom
Strum355:nsc/download-with-canonical-id

Conversation

@Strum355
Copy link
Copy Markdown
Contributor

From the docs: default is ''. If set, restrict cache hits to those cases where the file was added to the cache with the same canonical id

With http_archive, the default is the value of the url(s) provided, for the following reason: This helps catch the common mistake of updating the URLs without also updating the hash, resulting in builds that succeed locally but fail on machines without the file in the cache.

The lack of this default for rctx.download resulted in the exact issue described by http_archive to us recently. As such, this PR updates uses of rctx.download to mimic that behaviour to avoid this footgun.

Also addresses a ~2yr old TODO around using https://api.github.com/repos/bufbuild/buf/releases/latest once v1 is hit

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 16, 2024

CLA assistant check
All committers have signed the CLA.

@srikrsna-buf srikrsna-buf changed the title use canonical_id in rctx.download Use canonical_id in rctx.download and use the latest github release version May 22, 2024
@perezd perezd force-pushed the nsc/download-with-canonical-id branch from eaa7833 to 8863878 Compare May 29, 2024 00:17
@perezd
Copy link
Copy Markdown

perezd commented May 29, 2024

Thank you!

@perezd perezd merged commit d18f127 into bufbuild:main May 29, 2024
@srikrsna-buf srikrsna-buf mentioned this pull request Dec 10, 2024
@srikrsna-buf srikrsna-buf mentioned this pull request May 7, 2025
srikrsna-buf added a commit that referenced this pull request May 7, 2025
## What's Changed
* Use canonical_id in rctx.download and use the latest github release
version by @Strum355 in #62
* Fix running tests in Windows by @jchadwick-buf in
#79
* Update bzlmod example to be able to use toolchain by @sfroment in
#81
* Fix extensions.bzl to allow for multiple versions by @filippobrizzi in
#88
* Add repository_url to reproducible attributes by @styurin in
#94
* Sort targets in the buf_breaking rules by @dspencer12 in
#100
* Add `buf_format` rule by @srikrsna-buf in
#105

## New Contributors
* @Strum355 made their first contribution in
#62
* @jchadwick-buf made their first contribution in
#79
* @sfroment made their first contribution in
#81
* @filippobrizzi made their first contribution in
#88
* @dspencer12 made their first contribution in
#101
* @styurin made their first contribution in
#94

**Full Changelog**:
v0.3.0...v0.4.0
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.

3 participants