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

Depend on directories in repo rules (recursively) #19928

Closed
matts1 opened this issue Oct 24, 2023 · 2 comments
Closed

Depend on directories in repo rules (recursively) #19928

matts1 opened this issue Oct 24, 2023 · 2 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@matts1
Copy link
Contributor

matts1 commented Oct 24, 2023

Description of the feature request:

We have two repo rules internally that depend on whole directories.

We have a rust binary that needs to generate a repository. Because of that, it can't depend on a toolchain, and we have to it in a repo rule.

In order to build the rust binary, we need our repo rule to depend on.

build_rust_binary = rule(
    attrs = dict(srcs = attr.label_list(...))
)
src/main.rs
src/foo/bar.rs
...

At the moment, we need to write build_rust_binary(srcs=["src/main.rs", "src/foo/bar.rs", ...]). However, that means that if we add a new file src/foo/baz.rs, for example, it won't trigger a rebuild, and it may or may not actually build successfully, depending on the implementation.

We have similar issues with another repo rule that depends on a directory, where each directory in the input corresponds to a directory in the output.

I'd like to be able to specify a directory as a label for inputs, so any changes to the transitive closure of the direcotry will trigger a rebuild.

Which category does this issue belong to?

External Dependency

What underlying problem are you trying to solve with this feature?

Ensure that rebuilds are triggered when a directory is modified (or any subdirectory)

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

6.2.0

If bazel info release returns development 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 master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@iancha1992 iancha1992 added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Oct 24, 2023
@meteorcloudy
Copy link
Member

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Nov 7, 2023
@Wyverald
Copy link
Member

dupe of #20952 (which is fixed and will be in 7.1.0)

@Wyverald Wyverald closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants