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

"pub run" should spawn an isolate rather than starting a subprocess #21821

Closed
nex3 opened this issue Dec 8, 2014 · 10 comments
Closed

"pub run" should spawn an isolate rather than starting a subprocess #21821

nex3 opened this issue Dec 8, 2014 · 10 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@nex3
Copy link
Member

nex3 commented Dec 8, 2014

Currently "pub run" starts a subprocess to run its code. It should instead spawn an isolate to avoid VM startup time and provide accurate information for the stdioType getter.

@nex3
Copy link
Member Author

nex3 commented Dec 8, 2014

Added Pub-Run label.

@nex3
Copy link
Member Author

nex3 commented Feb 23, 2015

This is blocking dart-lang/test#19.

@DartBot
Copy link

DartBot commented Mar 23, 2015

This comment was originally written by @seaneagan


In the meantime could pub run temporarily set an environment variable in the sub-process for us to check the stdioType e.g. PUB_RUN_STDIOTYPE?

This is also blocking https://github.com/google/stagehand/issues/147

@DartBot
Copy link

DartBot commented Apr 10, 2015

This comment was originally written by @seaneagan


This would fix stdioType, but wouldn't it break Platform.script?

@nex3
Copy link
Member Author

nex3 commented Apr 10, 2015

Platform.script is already not what people expect under "pub run". Ideally there would be a way to spawn an isolate with a custom value for Platform.script, but that feature request is out-of-scope for this issue.

@DartBot
Copy link

DartBot commented Apr 10, 2015

This comment was originally written by @seaneagan


I think Platform.script currently references the pub cache location of the script, no? I only need basenameWithoutExtension(Platform.script), so that has been sufficient for my needs, and I'm not sure what a better value would be. But I would no longer have that if the isolate retains the Platform.script of pub itself, rather than of the spawned script.

(BTW my use case is for unscripted to determine the command name for help text output.)

@DartBot
Copy link

DartBot commented Apr 10, 2015

This comment was originally written by @seaneagan


See also issue #22098, which would be an even better solution for my use case.

@nex3
Copy link
Member Author

nex3 commented Apr 22, 2015

This is also blocking dart-lang/test#86.

@DartBot
Copy link

DartBot commented May 20, 2015

This comment was originally written by emil.n.pe...@gmail.com


Case where this is a real problem:
"stdout.terminalColumns" throws when file is run with "pub run" rather than "dart"

@DartBot
Copy link

DartBot commented Jun 5, 2015

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

@DartBot DartBot closed this as completed Jun 5, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants