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

Warn against potentially overly nested depsets #679

Closed
laurentlb opened this issue Jul 26, 2019 · 1 comment · Fixed by #680
Closed

Warn against potentially overly nested depsets #679

laurentlb opened this issue Jul 26, 2019 · 1 comment · Fixed by #680

Comments

@laurentlb
Copy link
Contributor

In Bazel, depsets are not always used efficiently. API changes (bazelbuild/bazel#5817) encourage users to write the efficient solution.

We can statically detect bad patterns. For example, this is sometimes used to add things to a depset:

x = depset(..., transitive = [..., x, ...])

If this pattern is used inside a for loop, we should report a warning because it can lead to overly nested depsets (which lead to performance problems).

@brandjon
Copy link
Member

Nice! @c-parsons and I were talking about this idea just the other day, had no idea you were already implementing it!

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 a pull request may close this issue.

2 participants