Skip to content

pub run can't run a bin script in a transitive dependencies #23426

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

Closed
sethladd opened this issue May 11, 2015 · 5 comments
Closed

pub run can't run a bin script in a transitive dependencies #23426

sethladd opened this issue May 11, 2015 · 5 comments
Labels
closed-as-intended Closed as the reported issue is expected behavior

Comments

@sethladd
Copy link
Contributor

Testing out pub run's ability to run scripts. It appears that it's unable to run a script in a dependency's dependency.

Setup:

package A
  depends on package B

package B
  depends on dartdoc

I tried running with pub run dartdoc:dartdoc from package A

Output/error:

Package "dartdoc" is not an immediate dependency.
Cannot run executables in transitive dependencies.

@sethladd
Copy link
Contributor Author

@munificent
Copy link
Member

As the error message indicates, this is deliberate. Packages don't automatically make their transitive dependencies part of their own public API, and that philosophy extends to binaries. If A depends on B, that's an implementation detail of A, and not something that should be exposed to all consumers. That includes any binaries B may contain.


cc @nex3.
Added AsDesigned label.

@sethladd
Copy link
Contributor Author

Thanks for the detailed explanation. We'll wrap the script from the developer-facing dependency.

@nex3
Copy link
Member

nex3 commented May 11, 2015

Keep in mind that if you're exporting the public API of another package, including its executables, your package should have a very narrow constraint on the package you're exporting. For example, if A exports B and the latest version of B is 1.0.0, A should have the constraint ">=1.0.0 <1.1.0" for B. Otherwise, A is unable to guarantee that its API will be stable in the way its versions indicate.

@DartBot
Copy link

DartBot commented Jun 4, 2015

This issue has been moved to dart-lang/pub#21.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

5 participants