-
Notifications
You must be signed in to change notification settings - Fork 229
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
Add dart run --find_entrypoint or similar #1811
Comments
If this is motivated by performance, we should make sure that this would actually bring the gains you're hoping for. I'm not inherently opposed to this--I think it would probably be generally useful to build something like |
It's less about performance than it is about being able to pass flags to the VM used to run your application independent of the flags used to run pub which then runs your application. It's nice to get that level of indirection out of the way so that you can use all of the options and environment variables the VM supports without affecting how pub itself behaves. |
I think this would be cool to do for |
I think so yes. It will be more future-proof than having tools hardcode some assumption about the relative path between the binary and the package config which is what would likely happen otherwise. |
With
webdev
andbuild_runner
we're starting to investigate new use cases for tools which want to run binaries from other packages. We're looking at ways to avoid the cost of spinning up multiple VMs and have found some nice patterns using isolates - but when there are multiple packages involved we can't avoid the second VM because we need to usepub run package_name
.One way we've gotten around this with
build_runner
is to leverage an existing detail of it's design - that it puts a dart file on disk and runs it in an isolate anyway. We therefore have the cost of a second vm duringpub run build_runner generateBuildScript
, but only for a short time. That command prints out the location of the generated Dart file which can then be run in an isolate.If we can do something similar with pub - run a quick command which prints the location of the binary - then we could set up new patterns of interactions between binaries in different packages, including those at the top level.
Forked from #1807
cc @nshahan @jakemac53
The text was updated successfully, but these errors were encountered: