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

Consider dev-dependencies of non-root packages in some cases #3186

Closed
simolus3 opened this issue Sep 3, 2021 · 1 comment
Closed

Consider dev-dependencies of non-root packages in some cases #3186

simolus3 opened this issue Sep 3, 2021 · 1 comment

Comments

@simolus3
Copy link
Contributor

simolus3 commented Sep 3, 2021

When constructing a package graph, we only consider regular dependencies for packages that aren't the root package. I think this is fairly reasonable in general (after all, dev-dependencies aren't transitive), but it sometimes makes it counterintuitive as expected builders are not applied.

Consider a buildera writing hidden outputs and b writing to source, assuming that both auto-apply to dependents. b may read the hidden outputs from a. Now, let's say a user has a multi-package project with a root package root and a package dep, where root depends on dep from path.
Now, if root has a dev-dependency on a and b; and dep has a dev-dependency on a, one might assume that hidden files from a are generated for the target in dep. However, they aren't! For me, I was quite surprised to see that b couldn't read expected files in dep and it took me a while to figure out that dep needs a regular dependency for this to work (real-world use case).

Now, I'm wondering if we could loosen up these restrictions a bit. Maybe we can consider dev_dependencies from packages reachable through a path dependency as those typically are part of the same project? Another approach may be to consider dev-dependencies from non-root packages if they are a transitive regular dependency of the root package?

I assume this is a fairly rare scenario so it might not be worth it at all, I'm just wondering if this is worth considering.

@jakemac53
Copy link
Contributor

I don't think we want to try and specialize for this. It would likely cause more confusion than anything I think.

We do have a sort of similar issue here also #3113

@simolus3 simolus3 closed this as completed Sep 3, 2021
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