-
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
Add module_ctx.template Starlark function #24829
Comments
This reverts commit 61c3f7c. This comment is wrong, see https://groups.google.com/g/bazel-discuss/c/vGWAMaziGCU/m/bt5Uu7TDAQAJ: Module extensions aren't meant to replace repository rules - in fact, module extensions can create repositories only by instantiating repository rules. The files created by a module extension's implementation function are only kept in a temporary location. It is thus both perfectly fine and necessary to continue to use repository rules and orchestrate them via module extensions.
Moving An argument in favor of not moving the other methods is that files created by module extensions are temporary in nature and the working directory is deleted after execution. @meteorcloudy @Wyverald What do you think, should we just go for parity with |
@satyanandak: Repository and module rules (mention of either repository_ctx, module_ctx) are owned by OSS team in their effort to solve problems with external dependencies. |
basically exactly what @fmeum said above. I'm happy to review a PR that adds |
Description of the feature request:
Create function module_ctx.template with the same interface and semantics as repository_ctx.template.
Which category does this issue belong to?
Rules API
What underlying problem are you trying to solve with this feature?
There's repository_ctx.template to expand a template as part of a repository rule, but no equivalent in module_ctx. This means that module rule implementations that want to expand a template either have to instantiate a private repository rule, or implement template expansion by hand.
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 8.0.0
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 HEAD
?No response
Have you found anything relevant by searching the web?
Didn't find anything on these sites using the search query "module_ctx template"
Any other information, logs, or outputs that you want to share?
Maybe it would be enough to move StarlarkRepositoryContext.createFileFromTemplate into StarlarkBaseExternalContext.
A similar argument could be made for other functions in StarlarkRepositoryContext: delete, rename, patch, symlink.
The text was updated successfully, but these errors were encountered: