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

Add a way to access the output_path in generated BUILD files #601

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

layus
Copy link
Collaborator

@layus layus commented Oct 8, 2024

This is really useful to avoid Bazel seeing the files themselves considering they are already in the nix store. No point in copying them in the bazel cache

@layus layus requested a review from benradf as a code owner October 8, 2024 09:26
@layus layus marked this pull request as draft October 8, 2024 09:26
repository_ctx.file("BUILD", content = build_file_content)
repository_ctx.file("BUILD", content = build_file_content.replace("{{NIX_STORE_PATH}}", output_path))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that could potentially have simplified things like the Python toolchain.

I guess the same could be done with the build_file attribute using repository_ctx.template for consistency.

This behavior should also be documented in the relevant repo macros / module extension tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants