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

Warn user when using unstable GitHub archive URL #15128

Open
alexeagle opened this issue Mar 26, 2022 · 5 comments
Open

Warn user when using unstable GitHub archive URL #15128

alexeagle opened this issue Mar 26, 2022 · 5 comments
Assignees
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@alexeagle
Copy link
Contributor

In bazel-contrib/SIG-rules-authors#11 we did a bunch of research, including reaching out to GH support.

TL;DR: http_archive should never use archive/v1.2.3.tar.gz urls as the hash cannot be guaranteed to be stable. However refs/tags/v1.2.3.tar.gz URLs are guaranteed.

Bazel should warn users when they give an unstable URL since it's a nasty surprise when the sha256 stops matching upstream suddenly.

@ckolli5 ckolli5 added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. untriaged labels Mar 30, 2022
@meteorcloudy meteorcloudy added type: feature request P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Apr 4, 2022
@meteorcloudy
Copy link
Member

Is archive/$commit.zip guaranteed to be stable? If not, what would be the alternative?

@fmeum
Copy link
Collaborator

fmeum commented Apr 21, 2022

The only thing that is guaranteed to be stable (and automatically generated) is archive/refs/tags/$tag.{zip,tar.gz}. There is no way to reference archives for individual commits in a way that is known to be safe.

@keith
Copy link
Member

keith commented Apr 21, 2022

I guess if there's a warning for this we may want an opt out because of that case.

@jwnimmer-tri
Copy link
Contributor

jwnimmer-tri commented Apr 21, 2022

For my part, I use urls = [...] plural where one of the candidates is a putatively unstable github url, but where others are my own mirrors of the same, in case GitHub is down or changes the checksum. If the unstable url is one of several choices, I'd like to request that bazel not warn in that case.

jonmeow added a commit to carbon-language/carbon-lang that referenced this issue Jan 30, 2023
I'm running a `bazel build //...` now and things look fine, so I'm guessing this is now correct. But it seems like GH changed something about their /archive/ downloads that just changed the checksums. Releases appear to be unaffected. I don't have any reference for what changed though.

bazelbuild/bazel#15128 says to use /refs/tags, but I think we can't do that when we're trying to get a specific commit.
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 26, 2023
@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) not stale Issues or PRs that are inactive but not considered stale and removed P2 We'll consider working on this in future. (Assignee optional) stale Issues or PRs that are stale (no activity for 30 days) labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

7 participants