WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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
if not repository_ctx.path("BUILD").exists and not repository_ctx.path("BUILD.bazel").exists:
if build_file_content:
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.

3 participants