-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1628: Remove conflicting System env variables for export command #1305
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| import java.text.MessageFormat; | ||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.LinkedList; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
|
|
@@ -132,6 +133,8 @@ public IStatus getToolsExportOutputFromGivenIdfPath(final String pythonExePath, | |
| addGitToEnvironment(environment, gitExePath); | ||
| } | ||
|
|
||
| cleanUpSystemEnvironment(environment); | ||
|
|
||
| final ProcessBuilderFactory processRunner = new ProcessBuilderFactory(); | ||
| try | ||
| { | ||
|
|
@@ -157,6 +160,31 @@ public IStatus getToolsExportOutputFromGivenIdfPath(final String pythonExePath, | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Remove the variables which can affect the idf_tools.py export command | ||
| * These variables can come from system environment | ||
| * @param environment | ||
| */ | ||
| private void cleanUpSystemEnvironment(Map<String, String> environment) | ||
| { | ||
| List<String> keysToRenmove = new LinkedList<>(); | ||
| keysToRenmove.add(IDFEnvironmentVariables.IDF_PYTHON_ENV_PATH); | ||
| keysToRenmove.add(IDFEnvironmentVariables.IDF_PATH); | ||
|
||
| keysToRenmove.add(IDFEnvironmentVariables.ESP_IDF_VERSION); | ||
| keysToRenmove.add(IDFEnvironmentVariables.IDF_CCACHE_ENABLE); | ||
| keysToRenmove.add(IDFEnvironmentVariables.IDF_COMPONENT_MANAGER); | ||
| keysToRenmove.add(IDFEnvironmentVariables.IDF_MAINTAINER); | ||
| keysToRenmove.add(IDFEnvironmentVariables.OPENOCD_SCRIPTS); | ||
|
|
||
| for (String key : keysToRenmove) | ||
| { | ||
| if (environment.containsKey(key)) | ||
| { | ||
| environment.remove(key); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private List<String> getExportCommandUsingGivenIdfPath(String pythonExePath, String idfPath) | ||
| { | ||
| final List<String> arguments = new ArrayList<>(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Apply env cleanup to all export paths, not just the “given IDF path” flow.
The conflicting vars will still leak into these two flows:
Call cleanUpSystemEnvironment(environment) there as well to make the fix complete.
Please also verify Windows tool installation via all three code paths.
🏁 Script executed:
Length of output: 2461
Add cleanup in all export flows and verify Windows tool installation
cleanUpSystemEnvironment(environment);immediately after theaddGitToEnvironment(...)block in bothrunToolsExportAndProcessOutput(...)andgetToolsExportOutput(...).🤖 Prompt for AI Agents