Skip to content
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 usage of download{,_and_extract} and file in module_ctx #16144

Closed
Wyverald opened this issue Aug 22, 2022 · 0 comments
Closed

Allow usage of download{,_and_extract} and file in module_ctx #16144

Wyverald opened this issue Aug 22, 2022 · 0 comments
Assignees
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@Wyverald
Copy link
Member

So far we haven't allowed download, download_and_extract, or file in module_ctx (those methods are only present in repository_ctx). There is a real need for them, according to module extension authors -- for example, downloading prebuilt tool binaries. So we should look into adding these methods to module_ctx.

@Wyverald Wyverald added type: feature request P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests labels Aug 22, 2022
@Wyverald Wyverald self-assigned this Aug 22, 2022
@Wyverald Wyverald added this to the 6.0.0 release blockers milestone Aug 24, 2022
copybara-service bot pushed a commit that referenced this issue Aug 24, 2022
- Now uses AutoValue
- Removed the targetKind() and targetName() fields, which nobody was using, and replaced them with context(), which is more general (since this will be used by module_ctx too)
- Renamed repositoryPath() to destinationPath() (since this will be used by module_ctx too)
- Removed setDecompressor(), which was only used in tests, and was actually a no-op. The decompressor() field is only ever read in DecompressorValue#decompress, which test code never calls anyway.
- Also removed executable(), which wasn't being set or read anywhere.

Work towards #16144

PiperOrigin-RevId: 469700938
Change-Id: I038a6228a7583e22a0e497c74cb790235903a4ee
Wyverald added a commit that referenced this issue Sep 8, 2022
This involves some changes in logging and reporting, since a "download event" is not necessarily tied to a repository any more, but could be from a module extension impl function. So we generally convert any logging of repo names to a "context", which could either be a repo or a module extension.

Fixes #16144

PiperOrigin-RevId: 469413473
Change-Id: I8c5b7477e6993a6fb77e07d82fc97260c19674b4
aiuto pushed a commit to aiuto/bazel that referenced this issue Oct 12, 2022
- Now uses AutoValue
- Removed the targetKind() and targetName() fields, which nobody was using, and replaced them with context(), which is more general (since this will be used by module_ctx too)
- Renamed repositoryPath() to destinationPath() (since this will be used by module_ctx too)
- Removed setDecompressor(), which was only used in tests, and was actually a no-op. The decompressor() field is only ever read in DecompressorValue#decompress, which test code never calls anyway.
- Also removed executable(), which wasn't being set or read anywhere.

Work towards bazelbuild#16144

PiperOrigin-RevId: 469700938
Change-Id: I038a6228a7583e22a0e497c74cb790235903a4ee
aiuto pushed a commit to aiuto/bazel that referenced this issue Oct 12, 2022
This involves some changes in logging and reporting, since a "download event" is not necessarily tied to a repository any more, but could be from a module extension impl function. So we generally convert any logging of repo names to a "context", which could either be a repo or a module extension.

Fixes bazelbuild#16144

PiperOrigin-RevId: 472682924
Change-Id: I8c5b7477e6993a6fb77e07d82fc97260c19674b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

1 participant