Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Pass Build env PATH to CMake build #377

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@

import com.espressif.idf.core.IDFConstants;
import com.espressif.idf.core.IDFCorePlugin;
import com.espressif.idf.core.IDFEnvironmentVariables;
import com.espressif.idf.core.internal.CMakeConsoleWrapper;
import com.espressif.idf.core.internal.CMakeErrorParser;
import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.util.IDFUtil;
import com.espressif.idf.core.util.StringUtil;
import com.google.gson.Gson;

@SuppressWarnings(value = { "restriction" })
Expand Down Expand Up @@ -278,7 +280,7 @@ public IProject[] build(int kind, Map<String, String> args, IConsole console, IP
}
}

String userArgs = getProperty(CMAKE_ARGUMENTS);
String userArgs = getProperty(CMAKE_ARGUMENTS); //IDF_PYTHON_ENV_PATH
if (userArgs != null)
{
command.addAll(Arrays.asList(userArgs.trim().split("\\s+"))); //$NON-NLS-1$
Expand All @@ -297,8 +299,15 @@ public IProject[] build(int kind, Map<String, String> args, IConsole console, IP
// Set PYTHONUNBUFFERED to 1/TRUE to dump the messages back immediately without
// buffering
IEnvironmentVariable bufferEnvVar = new EnvironmentVariable("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$

IEnvironmentVariable envVar = new EnvironmentVariable(IDFEnvironmentVariables.PATH, System.getenv(IDFEnvironmentVariables.PATH)); //$NON-NLS-1$
String buildEnvPATH = new IDFEnvironmentVariables().getEnvValue(IDFEnvironmentVariables.PATH);
if (!StringUtil.isEmpty(buildEnvPATH))
{
envVar = new EnvironmentVariable(IDFEnvironmentVariables.PATH, buildEnvPATH); //$NON-NLS-1$
}

Process p = startBuildProcess(command, new IEnvironmentVariable[] { bufferEnvVar }, workingDir,
Process p = startBuildProcess(command, new IEnvironmentVariable[] { bufferEnvVar, envVar }, workingDir,
errConsole, monitor);
if (p == null) {
console.getErrorStream().write(String
Expand Down