diff --git a/clwb/src/com/google/idea/blaze/clwb/run/BlazeCidrLauncher.java b/clwb/src/com/google/idea/blaze/clwb/run/BlazeCidrLauncher.java index f5f986a6932..c4400d20861 100644 --- a/clwb/src/com/google/idea/blaze/clwb/run/BlazeCidrLauncher.java +++ b/clwb/src/com/google/idea/blaze/clwb/run/BlazeCidrLauncher.java @@ -189,10 +189,7 @@ private ProcessHandler createProcess(CommandLineState state, List extraB final GeneralCommandLine commandLine = new GeneralCommandLine(command.toList()); - EnvironmentVariablesData envState = handlerState.getEnvVarsState().getData(); - commandLine.withParentEnvironmentType( - envState.isPassParentEnvs() ? ParentEnvironmentType.SYSTEM : ParentEnvironmentType.NONE); - commandLine.getEnvironment().putAll(envState.getEnvs()); + updateCommandlineWithEnvironmentData(commandLine); return new ScopedBlazeProcessHandler( project, @@ -216,6 +213,13 @@ public ImmutableList createProcessListeners(BlazeContext contex }); } + private void updateCommandlineWithEnvironmentData(GeneralCommandLine commandLine) { + EnvironmentVariablesData envState = handlerState.getEnvVarsState().getData(); + commandLine.withParentEnvironmentType( + envState.isPassParentEnvs() ? ParentEnvironmentType.SYSTEM : ParentEnvironmentType.NONE); + commandLine.getEnvironment().putAll(envState.getEnvs()); + } + @Override public CidrDebugProcess createDebugProcess(CommandLineState state, XDebugSession session) throws ExecutionException { @@ -247,6 +251,9 @@ public CidrDebugProcess createDebugProcess(CommandLineState state, XDebugSession commandLine.addParameters(handlerState.getExeFlagsState().getFlagsForExternalProcesses()); commandLine.addParameters(handlerState.getTestArgs()); + // otherwise is handled in createProcess + updateCommandlineWithEnvironmentData(commandLine); + if (CppBlazeRules.RuleTypes.CC_TEST.getKind().equals(configuration.getTargetKind())) { convertBlazeTestFilterToExecutableFlag().ifPresent(commandLine::addParameters); }