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

Repository dependencies in workspace rules #8780

Open
mboes opened this issue Jul 2, 2019 · 5 comments
Open

Repository dependencies in workspace rules #8780

mboes opened this issue Jul 2, 2019 · 5 comments
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@mboes
Copy link
Contributor

mboes commented Jul 2, 2019

Description of the problem / feature request:

In a workspace rule, I can specify attributes of Label type. These labels, however, can only be used in limited ways. In particular, when fed to repository_ctx.path() they must refer to one regular file, and a regular file at that, and one that can't be generated. If I want one external repository A to depend on the entire content of another repository B, I can't express that. I have to list specific files as inputs. If the content of those files I list as inputs doesn't change as frequently as B, then I get an under approximation of how often the rule for A has to be rerun.

Feature requests: what underlying problem are you trying to solve with this feature?

In BUILD files, I can depend on targets rather than files. So I can have a target that stands for say a filegroup of all files under a directory. In WORKSPACE files, I don't have that. Understandably, I can't depend on generated files, but it would be very convenient if target-like special cases would be supported. For example, I would imagine that allowing a label that refers to the entire external repository would be easy to implement.

For the sake of discussion, let me steal some syntax for such a label. Say @foo means "all the files in repository foo". Then I could have:

some_rule(
  name = "bar",
  deps = ["@foo"],
  ...
)

Then Bazel would always rerun the rule for @bar if it reran the rule for @foo.

cc @guibou

@Globegitter
Copy link

I have also run into limitations: #8674 - agreed it would be nice if more advanced cases would be possible here.

@ishikhman ishikhman added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request untriaged labels Jul 3, 2019
@laurentlb laurentlb added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Jul 29, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
@mvgijssel
Copy link

Just ran into this issue as well, trying to include all the source files from a repository rule into another repository rule.

@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 16, 2023
@fmeum
Copy link
Collaborator

fmeum commented Jun 17, 2023

See https://docs.google.com/document/d/17RZKMuMjAIgNfFdrsLhqNsMTQDSS-BBA-S-fCSBPV7M/edit# for a proposal aiming to address this issue.

@fmeum
Copy link
Collaborator

fmeum commented Jun 17, 2023

@bazelbuild/triage not stale

@sgowroji sgowroji added not stale Issues or PRs that are inactive but not considered stale and removed stale Issues or PRs that are stale (no activity for 30 days) labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants