Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

API to access environment variables in vm #752

Closed
sigmundch opened this issue Dec 8, 2011 · 10 comments
Closed

API to access environment variables in vm #752

sigmundch opened this issue Dec 8, 2011 · 10 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@sigmundch
Copy link
Member

It would be really useful to have access to the terminal's environment variables. I have in mind something similar to 'process.env' in nodejs.

@DartBot
Copy link

DartBot commented Mar 15, 2012

This comment was originally written by Bradley...@gmail.com


In conjunction with this, there should be a way to set environmental variables on new Process. Working directory is good, but if I need a worker process to integrate with a system using environmental variables, this is a must.

@iposva-google
Copy link
Contributor

This could be added to the Options interface:
Map<String, String> environment();

Created issue #2193 for the feature request in comment 1.

@munificent
Copy link
Member

We don't need this right this second for pub, but it is certain that we will need it before too long. Can I make a friendly request for this to be implemented in the near future?


cc @iposva-google.
cc @madsager.

@madsager
Copy link
Contributor

Putting this higher on my list.


Set owner to @madsager.
Added Accepted label.

@munificent
Copy link
Member

Thanks!

@munificent
Copy link
Member

Oh, and just to clarify, we will likely need both:

  1. The ability to query the set of environment variables available to the current process.
  2. The ability to provide environment variables when spawning a process.

#­1 is obvious, but #­2 will be very helpful for the test infrastructure for pub which generally works by invoking pub in its own process.

@madsager
Copy link
Contributor

Sounds good. They do go hand in hand and I'll see if I can get to do both ASAP. I have accepted issue #2193 as well.

@madsager
Copy link
Contributor

Issue #1791 has been merged into this issue.

@madsager
Copy link
Contributor

First step implemented. Access to environment variables from a script.

Map<String, String> env = new Platform().environment();

Next step: providing an environment to a child process. Tracked in issue #2193.


Added Fixed label.

@munificent
Copy link
Member

Thanks!

@sigmundch sigmundch added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Apr 18, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants