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

System.getEnv does not update between different runs #257

Closed
Baccata opened this issue Mar 24, 2018 · 0 comments
Closed

System.getEnv does not update between different runs #257

Baccata opened this issue Mar 24, 2018 · 0 comments

Comments

@Baccata
Copy link
Contributor

Baccata commented Mar 24, 2018

This is most likely a downside of keeping a daemon jvm, but it makes it impossible to use environment variables as inputs.

Maybe the mill launcher should pass the full environment to the program as a hidden parameter, which would allow for mill to provide a default Map[String, String] input ?

Baccata added a commit to Baccata/mill that referenced this issue Mar 29, 2018
Since Mill now executes in a long-lived JVM, the builds do not have a
chance to use environment variables as inputs. This propagates the
environment variables from the client all the way down to the context
available to the tasks as a `Map[String, String]` so that they can be
used as inputs should the user choose to do so.

com-lihaoyi#257
Baccata added a commit to Baccata/mill that referenced this issue Mar 29, 2018
Since Mill now executes in a long-lived JVM, the builds do not have a
chance to use environment variables as inputs. This propagates the
environment variables from the client all the way down to the context
available to the tasks as a `Map[String, String]` so that they can be
used as inputs should the user choose to do so.

com-lihaoyi#257
Baccata added a commit to Baccata/mill that referenced this issue Apr 5, 2018
* Moved the `System.getenv` side effect to the end of the world
* Adds a test to make sure that the `Map[String, String]` gets
propagated correctly
* Adds a `Ctx.Env` trait for consistency

com-lihaoyi#257
Baccata added a commit to Baccata/mill that referenced this issue Apr 5, 2018
Adds documentation about the Ctx.Env API to indicate that the user
should not use `System.getenv`

com-lihaoyi#257
Baccata added a commit to Baccata/mill that referenced this issue Apr 5, 2018
Adds documentation about the Ctx.Env API to indicate that the user
should not use `System.getenv`

com-lihaoyi#257
@lihaoyi lihaoyi closed this as completed Apr 8, 2018
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