Skip to content

sbtn should reevaluate env variables #7012

@agilesteel

Description

@agilesteel

steps

Given a hello world application that reads out an environment variable and prints it out:

@main def Main(args: String*): Unit =
  println(System.getenv("FOO"))

Then run:

FOO=BAR sbtn run

problems

I see null.

expectations

I see BAR

notes

When I run:

FOO=BAR bloop run my-project

I correctly see BAR

In fact the sbtn behavior is flaky. It depends on how the server was started. If the server was not running to begin with, then yes

FOO=BAR sbtn run

will indeed print out BAR and the subsequent requests as well. However as soon as we change it to

FOO=NOT_BAR sbtn run

we will keep seeing the incorrect BAR.

original report

I'm not sure whether it's an issue or a feature request. I already created a feature request here: https://discuss.lightbend.com/t/feature-request-sbtn-should-reevaluate-env-variables/9908 but haven't heard anything in over 2 weeks so I'm opening an issue here as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions