-
Notifications
You must be signed in to change notification settings - Fork 84
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
build: use http_archive instead of git_repository #490
Conversation
Signed-off-by: Mike Schore <[email protected]>
FWIW |
Good points. Even if we are avoiding pulling down history (though my read of that code is that we're maybe still pulling down some unless shallow_since is set really precisely?), the main win (hopefully) here will be the built-in retry logic in http_archive helping us around the connection flakiness we've seen in azure/github actions. Good callout on the potential sha issue. Something to keep an eye out for. |
We should be setting shallow_since because otherwise Bazel warns too. But I think this is safe to test! |
@@ -40,11 +39,11 @@ http_file( | |||
urls = ["https://github.com/google/xctestrunner/releases/download/0.2.10/ios_test_runner.par"], | |||
) | |||
|
|||
git_repository( | |||
http_archive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend not switching to http_archive without updating Bazel to 0.29.x, there were important connection/stream retry fixes in 0.29.x:
- Fix retrying of SocketTimeoutExceptions in HttpConnector bazelbuild/bazel#9008
- Fallback to next urls if download fails in HttpDownloader bazelbuild/bazel#9015 (not going to help since we don't have fallback urls here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We're on 0.29.1 :)
I did consider listing the same URL multiple times, but read somewhere that it would retry (like 8 times?) regardless. (I didn't read the current source to confirm this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, didn't notice you've updated Bazel yesterday lol
Listing same URL multiple times might work, but I also haven't checked if it dedups them before attempting the download
Thank you @keith and @artem-zinnatullin! |
Description: This will hopefully allow for both faster and more reliable builds. http_archive contains built-in retry logic, and pulls down smaller artifacts (no history).
Risk Level: Low
Testing: Local and CI
Signed-off-by: Mike Schore [email protected]