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
Add support for remote_files for http_archive #22155
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@@ -139,6 +140,8 @@ def _http_archive_impl(ctx): | |||
auth = get_auth(ctx, all_urls) | |||
|
|||
download_info = ctx.download_and_extract( | |||
# TODO(fzakaria): all_urls here has the remote_patch URL which is incorrect |
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.
@fmeum I think this is a bug -- should I cut one?
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.
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.
Filed #22201 for tracking.
This issue adds support necessary to tackle bazelbuild/bazel-central-registry#1566 Add two new attributes to http_archive: remote_file_urls and remote_file_integrity. The purpose of these two attributes is to allow files to effectively be overlaid ontop of an http_archive. The goal of such functionality would be useful for BCR since the BUILD & WORKSPACE files need no longer be stored as patch files. This means we could probably deprecate `build_file` since that could be referenced as a file:// url in the remote_file_urls attribute. Co-authored-by: Mark Williams <markrwilliams@google.com>
* Added async download for remote_file for http-archive via block param * Added validation to check that there is no relative paths present
* Added disallow relative path * Added disallow absolute path * Added test for missing integrity
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.
LGTM with minor comments
* Fixup comments * Add test that verifies remote_files works with more than 1 segment
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.
@Wyverald Could you do the owner's review?
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.
very nice! just a few docs nits.
@bazel-io fork 7.2.0 |
This issue adds support necessary to tackle bazelbuild/bazel-central-registry#1566 Add two new attributes to http_archive: remote_file_urls and remote_file_integrity. The purpose of these two attributes is to allow files to effectively be overlaid ontop of an http_archive. The goal of such functionality would be useful for BCR since the BUILD & WORKSPACE files need no longer be stored as patch files. This means we could probably deprecate `build_file` since that could be referenced as a file:// url in the remote_file_urls attribute. Co-authored-by: Mark Williams <markrwilliams@google.com> CC @fmeum Closes bazelbuild#22155. PiperOrigin-RevId: 632594203 Change-Id: I6310093482c5c58537ed6dbe4ff90bafdbd696ff
This issue adds support necessary to tackle bazelbuild/bazel-central-registry#1566 Add two new attributes to http_archive: remote_file_urls and remote_file_integrity. The purpose of these two attributes is to allow files to effectively be overlaid ontop of an http_archive. The goal of such functionality would be useful for BCR since the BUILD & WORKSPACE files need no longer be stored as patch files. This means we could probably deprecate `build_file` since that could be referenced as a file:// url in the remote_file_urls attribute. Co-authored-by: Mark Williams <markrwilliams@google.com> CC @fmeum Closes #22155. PiperOrigin-RevId: 632594203 Change-Id: I6310093482c5c58537ed6dbe4ff90bafdbd696ff Commit e01509f Co-authored-by: Farid Zakaria <fmzakari@google.com>
This issue adds support necessary to tackle bazelbuild/bazel-central-registry#1566 Add two new attributes to http_archive: remote_file_urls and remote_file_integrity. The purpose of these two attributes is to allow files to effectively be overlaid ontop of an http_archive. The goal of such functionality would be useful for BCR since the BUILD & WORKSPACE files need no longer be stored as patch files. This means we could probably deprecate `build_file` since that could be referenced as a file:// url in the remote_file_urls attribute. Co-authored-by: Mark Williams <markrwilliams@google.com> CC @fmeum Closes bazelbuild#22155. PiperOrigin-RevId: 632594203 Change-Id: I6310093482c5c58537ed6dbe4ff90bafdbd696ff
This is a continuation of bazelbuild#22155 that adds the newly added 'remote_files' attribute for http_archive to the bzlmod functionality. The end goal is to then update BCR to this new functionality to overlay files rather than use patch files when providing MODULE/WORKSPACE/BUILD files. bazelbuild/bazel-central-registry#1566 has a good discussion of the rationale.
This issue adds support necessary to tackle
bazelbuild/bazel-central-registry#1566
Add two new attributes to http_archive: remote_file_urls and remote_file_integrity.
The purpose of these two attributes is to allow files to effectively be overlaid ontop of an http_archive. The goal of such functionality would be useful for BCR since the BUILD & WORKSPACE files need no longer be stored as patch files.
This means we could probably deprecate
build_file
since that could be referenced as a file:// url in the remote_file_urls attribute.Co-authored-by: Mark Williams markrwilliams@google.com
CC @fmeum