Skip to content

Commit

Permalink
fix: Enviroment Variables are not correctly inherited from system on …
Browse files Browse the repository at this point in the history
…MacOS

Use CONSOLE ParentEnvironmentType instead of SYSTEM

CONSOLE is the default value initialized in GeneralCommandLineso it was used before. Now, if we want to inherit the system envs we use SYSTEM,
so in both cases it differs from what was there before. This PR just brings the old behavior in case a user wants to inherit enviroment from the system.

https://github.com/JetBrains/intellij-community/blob/9838665ba816fc8ce06e4071aa5a906a35fbb22e/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L85C1-L86C1

fixes bazelbuild#6163
  • Loading branch information
Tomasz Pasternak committed Feb 27, 2024
1 parent f56e695 commit c8ed503
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private ProcessHandler getScopedProcessHandler(
commandLine.withEnvironment(envVarState.getEnvs());
commandLine.withParentEnvironmentType(
envVarState.isPassParentEnvs()
? GeneralCommandLine.ParentEnvironmentType.SYSTEM
? GeneralCommandLine.ParentEnvironmentType.CONSOLE
: GeneralCommandLine.ParentEnvironmentType.NONE);
return new ScopedBlazeProcessHandler(
project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private ProcessHandler getScopedProcessHandler(
commandLine.withEnvironment(envVarState.getEnvs());
commandLine.withParentEnvironmentType(
envVarState.isPassParentEnvs()
? GeneralCommandLine.ParentEnvironmentType.SYSTEM
? GeneralCommandLine.ParentEnvironmentType.CONSOLE
: GeneralCommandLine.ParentEnvironmentType.NONE);
return new ScopedBlazeProcessHandler(
project,
Expand Down

0 comments on commit c8ed503

Please sign in to comment.