-
Notifications
You must be signed in to change notification settings - Fork 233
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
coursier: prefer the primary_url over mirrors #743
Conversation
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.
FYI, I am assuming there will be tests to update, and that will help me figure out a new test to write as well.
@@ -1043,6 +1043,10 @@ def _coursier_fetch_impl(repository_ctx): | |||
primary_artifact_path = infer_artifact_path_from_primary_and_repos(primary_url, repository_urls) | |||
|
|||
mirror_urls = [url + "/" + primary_artifact_path for url in repository_urls] | |||
if primary_url in mirror_urls: |
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.
It wasn't obvious to me that this is guaranteed to be the case, but I also didn't see how it couldn't be.
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.
Ahh, auth makes it not true. <-- never mind this was wrong.
1421102
to
6f96a40
Compare
@@ -2175,34 +2175,34 @@ | |||
"url": "https://repo1.maven.org/maven2/com/microsoft/azure/adal4j/1.6.0/adal4j-1.6.0.jar" | |||
}, | |||
{ | |||
"coord": "com.nimbusds:lang-tag:1.6", | |||
"coord": "com.nimbusds:lang-tag:1.7", |
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.
FYI repinning just did this upgrade to 1.7. I can add another version set to fix if preferred.
This is for bazelbuild#349 and tangentially for bazelbuild#723. Users are often confused by (expected) 404s when using multiple Maven repositories. These 404s can be safely ignored (Bazel's repository fetching logic gracefully tries all mirrors), but they are chatty and there is as of yet no way to silence them. See also: bazelbuild/bazel#13394 While we cannot solve the issue, we can reduce its impact by ordering the URLs: `http_file` is documented to try them in order: https://bazel.build/rules/lib/repo/http#http_file-urls
6f96a40
to
9d2d9e8
Compare
Nice! |
This is for #349 and tangentially for #723.
Users are often confused by (expected) 404s when using multiple Maven repositories. These 404s can be safely ignored (Bazel's repository fetching logic gracefully tries all mirrors), but they are chatty and there is as of yet no way to silence them.
See also: bazelbuild/bazel#13394
While we cannot solve the issue, we can reduce its impact by ordering the URLs:
http_file
is documented to try them in order:https://bazel.build/rules/lib/repo/http#http_file-urls