Skip to content

Commit

Permalink
http repo rules: Make sure netrc credentials are applied for remote p…
Browse files Browse the repository at this point in the history
…atch files

Fixes #21885

PiperOrigin-RevId: 625651940
Change-Id: Id8a29c429e3b283dd0e2eecd1e13c023f0feb357
  • Loading branch information
meteorcloudy authored and Copybara-Service committed Apr 17, 2024
1 parent 1b25072 commit 445dfab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/test/tools/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tools/build_defs/repo/http.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ URLs are tried in order until one succeeds, so you should list local mirrors fir
If all downloads fail, the rule will fail."""

def _get_all_urls(ctx):
"""Returns all urls provided via the url or urls attributes.
"""Returns all urls provided via the url, urls and remote_patches attributes.
Also checks that at least one url is provided."""
if not ctx.attr.url and not ctx.attr.urls:
Expand All @@ -87,6 +87,8 @@ def _get_all_urls(ctx):
all_urls = ctx.attr.urls
if ctx.attr.url:
all_urls = [ctx.attr.url] + all_urls
if hasattr(ctx.attr, "remote_patches") and ctx.attr.remote_patches:
all_urls = all_urls + ctx.attr.remote_patches.keys()

return all_urls

Expand Down

0 comments on commit 445dfab

Please sign in to comment.