Skip to content

[2.x] feat: client-side run env inheritance#8752

Merged
eed3si9n merged 2 commits intosbt:developfrom
aviu16:codex/sbtn-env-reeval-7012
Feb 17, 2026
Merged

[2.x] feat: client-side run env inheritance#8752
eed3si9n merged 2 commits intosbt:developfrom
aviu16:codex/sbtn-env-reeval-7012

Conversation

@aviu16
Copy link
Copy Markdown
Contributor

@aviu16 aviu16 commented Feb 17, 2026

Fixes #7012.

When sbtn run is executed through client jobs, the run env currently only uses explicit task env vars. This can keep stale process-level values around across invocations.

This change merges the current client process environment (sys.env) with explicit overrides, so each invocation reflects the shell env it was started with.

Changes:

  • merge sys.env with job env overrides in RunHandler.jvmRun
  • apply the same merge for native client-side runs in NetworkClient
  • add a focused unit test for env merge behavior and override precedence

@aviu16
Copy link
Copy Markdown
Contributor Author

aviu16 commented Feb 17, 2026

added validation evidence for this branch:\n\nran in JDK 17 container:\ndocker run --rm -v "/Users/Avantika/Documents/New project":/work -w /work eclipse-temurin:17-jdk bash -lc './sbt ";project commandProj;testOnly sbt.internal.util.RunHandlerTest"'\n\nresult:\n- RunHandlerTest passed\n- test: mergedEnvVars includes current process environment and applies explicit overrides

@aviu16
Copy link
Copy Markdown
Contributor Author

aviu16 commented Feb 17, 2026

Scala CLA has been signed for aviu16 and I pushed a no-op commit to retrigger checks.\n\nCurrent new runs are in action_required state, likely awaiting maintainer approval to run workflows for fork PRs.

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n changed the title Fix client-side run env inheritance for sbtn [2.x] feat: client-side run env inheritance Feb 17, 2026
@eed3si9n eed3si9n merged commit 44b9ca7 into sbt:develop Feb 17, 2026
15 checks passed
@agilesteel
Copy link
Copy Markdown

I've been waiting a long time for this ❤️ Can't wait to test it out...

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

Successfully merging this pull request may close these issues.

sbtn should reevaluate env variables

3 participants