Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 29, 2024

Conversation

Strum355
Copy link
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

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

perezd commented May 29, 2024

Thank you!

@perezd perezd merged commit d18f127 into bufbuild:main May 29, 2024
5 checks passed
@srikrsna-buf srikrsna-buf mentioned this pull request Dec 10, 2024
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