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

--include doesn't work as expected with plz gc #2812

Closed
RichardoC opened this issue Jun 6, 2023 · 3 comments
Closed

--include doesn't work as expected with plz gc #2812

RichardoC opened this issue Jun 6, 2023 · 3 comments

Comments

@RichardoC
Copy link
Contributor

What I expected to happen

plz gc will only show dangling targets which have the label provided in --include

What actually happened

plz gc shows all dangling targets in that path, regardless of labels

Redacted example below

$ plz gc --include=some_label  //some/folder/... --targets_only
...
//some/folder:target_a

$ plz query print //some/folder:target_a
# //some/folder:target_a:
some_rule(
    name = 'target_a',
...
    labels = ["a-different-label",],
)
@stale
Copy link

stale bot commented Sep 16, 2023

This issue has been automatically marked as stale because it has not had any recent activity in the past 90 days. It will be closed if no further activity occurs. If you require additional support, please reply to this message. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 16, 2023
@RichardoC
Copy link
Contributor Author

/remove stale

@stale stale bot removed the wontfix label Sep 24, 2023
@peterebden
Copy link
Member

I suspect what is happening here is that --include is used to determine the original set of targets to look at the dependencies of to GC and not to filter the list later on. Maybe that's unintuitive here but the --include / --exclude stuff is a general mechanism shared between all commands, so the meaning here isn't specific to GC.

You could probably still achieve what you want by piping through plz query filter.

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

No branches or pull requests

2 participants