-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow arbitrary headers to sent with Bazel Downloader #17829
Comments
cc @Wyverald |
Note, we'll need to add a workaround in rules_oci for now, however it uses a requires using another tool during the repository rule, making it require a fake toolchain resolution and also the download it makes is not cached anywhere. |
@meteorcloudy Do you see any potential issues with allowing @thesayyn Would you be interested in contributing this functionality if you get the okay from maintainers? I could help with pre-reviews and references if needed. |
Not really. @tjgq integrated credential helper for repository download, do you have any concern here? |
We already merge authentication headers from the credential helper and the argument to |
Yes, I'd be willing to do that. |
I know this may not be directly related to bazel, but this is a message for others who are directed here by the rules_oci error log. An checksum failed was throwed, and the error log looks like below:
I believe the reason that causes this problem is here. To cache the file downloaded from To workaround this, flag releate: |
Coming in 7.1.0, rctx.download will accept a headers parameter allowing arbitrary headers to be passed to the downloaders. Link to issue: bazelbuild/bazel#17829 cc: @fmeum
Is this something that will require changes to |
I don't there's a mechanism for it for remote downloaders. |
I agree - it sounds like it'll require an addition to the protocol. |
A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
I've opened #21490 which is necessary so that rulesets which adopt this feature don't break users of the remote downloader service. If it looks good, I'd appreciate it if we could pull into either 7.1.0 or 7.1.1. |
|
Related to #17829 and 2697e0c I don't love this design but according to the Remote Asset API spec, this is an intended use of qualifiers: https://docs.google.com/document/d/10ari9WtTTSv9bqB_UU-oe2gBtaAA7HyQgkpP-RFP80c/edit#heading=h.sixrlhdnkfoa. cc @Wyverald @jmillikin Closes #21490. PiperOrigin-RevId: 610688317 Change-Id: I272f63a6bc4ea432503003ee907ca012f6d641cf
Related to bazelbuild#17829 and bazelbuild@2697e0c I don't love this design but according to the Remote Asset API spec, this is an intended use of qualifiers: https://docs.google.com/document/d/10ari9WtTTSv9bqB_UU-oe2gBtaAA7HyQgkpP-RFP80c/edit#heading=h.sixrlhdnkfoa. cc @Wyverald @jmillikin Closes bazelbuild#21490. PiperOrigin-RevId: 610688317 Change-Id: I272f63a6bc4ea432503003ee907ca012f6d641cf
Related to #17829 and 2697e0c I don't love this design but according to the Remote Asset API spec, this is an intended use of qualifiers: https://docs.google.com/document/d/10ari9WtTTSv9bqB_UU-oe2gBtaAA7HyQgkpP-RFP80c/edit#heading=h.sixrlhdnkfoa. cc @Wyverald @jmillikin Closes #21490. Commit 2195baa PiperOrigin-RevId: 610688317 Change-Id: I272f63a6bc4ea432503003ee907ca012f6d641cf Co-authored-by: Sushain Cherivirala <sushain@skc.name>
@tjgq Just want to flag that
The tests in If you python src/test/shell/bazel/testing_server.py --dump_headers headers.txt always /dev/null and then curl -L http://localhost:43726/ -H "Accept: this" -H "Accept: that"
cat header.txt
{"Accept": "that"} Only the last header is captured. |
Coming in 7.1.0, rctx.download will accept a headers parameter allowing arbitrary headers to be passed to the downloaders. Link to issue: bazelbuild/bazel#17829 cc: @fmeum
Description of the feature request:
Currently, bazel sets some headers when sending an HTTP request to fetch artifacts over the internet. While this works well for most cases, it doesn't work at all when the remote server requires some HTTP headers to be set to special values.
For instance, currently bazel sets all the
Accept
header totext/html, image/gif, image/jpeg, */*
in outgoing HTTP requests. In my case, itsAccept
header that needs to be set toapplication/vnd.oci.image.manifest.v1+json
so that docker registry sees no problem responding when the image has oci manifest types.See: #16659 (comment)
Related to #16682
What underlying problem are you trying to solve with this feature?
No response
Which operating system are you running Bazel on?
darwin/arm64
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: