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

IEP-1395: Removing system env vars from IDE while executing scripts #1110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -75,6 +75,8 @@ protected IStatus run(IProgressMonitor monitor)
{
return status;
}

Logger.log(status.getMessage());
processExportCmdOutput(status.getMessage());

monitor.worked(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ protected IStatus runCommandIdfPyInIdfEnv(List<String> arguments, MessageConsole
Logger.log(environment.toString());
environment.put("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$
loadIdfPathWithSystemPath(environment);
environment.remove(IDFEnvironmentVariables.IDF_PYTHON_ENV_PATH);
environment.remove(IDFEnvironmentVariables.ESP_IDF_VERSION);
environment.remove(IDFEnvironmentVariables.IDF_PATH);
environment.remove(IDFEnvironmentVariables.OPENOCD_SCRIPTS);
Comment on lines +352 to +355
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @alirana01,

Do you know why these variables are not replaced with the same ones from the idfToolSet (which, as I understand, should have proper environment variables)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So basically the environment here is taken from System.getEnv() so it loads the system env. The function where the change was done is actually before these variables are even part of the idfToolSet. This function make sures that the correct variables from the idf export script are loaded into the idfToolSet basically it sits before that. Which is the reason we need to make sure that any of these variables from System environment are not loaded here


if (gitExecutablePath != null)
{
addPathToEnvironmentPath(environment, gitExecutablePath);
Expand Down Expand Up @@ -399,7 +404,7 @@ protected IStatus runCommandIdfPyInIdfEnv(List<String> arguments, MessageConsole
return IDFCorePlugin.errorStatus(e1.getMessage(), e1);
}
}

private void addPathToEnvironmentPath(Map<String, String> environment, String gitExecutablePath)
{
IPath gitPath = new org.eclipse.core.runtime.Path(gitExecutablePath);
Expand Down
Loading