In mill v0.9.9 Task Context API documentation it is said
Mill keeps a long-lived JVM server to avoid paying the cost of recurrent classloading. Because of this, running System.getenv in a task might not yield up to date environment variables, since it will be initialised when the server starts, rather than when the client executes. To circumvent this, mill’s client sends the environment variables to the server as it sees them, and the server makes them available as a Map[String, String] via the Ctx API.
So reading the up to date environment variable is straightforward:
def envVar = T.input { T.ctx.env.get("ENV_VAR") }
but how can a task do this: "mill’s client sends the environment variables to the server" so that next running tasks will see the updated environment variable?