Skip to content

Commit

Permalink
Remove espidf workaround by not using their python environment
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Apr 14, 2022
1 parent 1c1bba7 commit 26ba789
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions mlonmcu/platform/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def invoke_idf_exe(self, *args, **kwargs):
env = {} # Do not use current virtualenv (TODO: is there a better way?)
env["IDF_PATH"] = str(self.espidf_src_dir)
env["IDF_TOOLS_PATH"] = str(self.espidf_install_dir)
env["PATH"] = str(Path(sys.base_prefix) / "bin")
cmd = (
". "
+ str(self.espidf_src_dir / "export.sh")
Expand Down Expand Up @@ -342,7 +341,6 @@ def _monitor_helper(*args, verbose=False, start_match=None, end_match=None, time
env = {} # Do not use current virtualenv (TODO: is there a better way?)
env["IDF_PATH"] = str(self.espidf_src_dir)
env["IDF_TOOLS_PATH"] = str(self.espidf_install_dir)
env["PATH"] = str(Path(sys.base_prefix) / "bin")
cmd = (
". "
+ str(self.espidf_src_dir / "export.sh")
Expand Down
11 changes: 7 additions & 4 deletions mlonmcu/setup/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,12 @@ def install_espidf(context: MlonMcuContext, params=None, rebuild=False, verbose=
assert isinstance(boards, list)
boards = ";".join(boards)
if not utils.is_populated(espidfInstallDir) or rebuild:
espidfInstallScript = Path(espidfSrcDir) / "install.sh"
env = {} # Do not use current virtualenv (TODO: is there a better way?)
# Using idf_tools.py directory instead of ./install.sh because we
# don't want to use espe-idfs python environment
espidfInstallScript = Path(espidfSrcDir) / "tools" / "idf_tools.py"
targets = ",".join(boards)
espidfInstallArgs = [f"--targets={targets}"]
env = {}
env["IDF_TOOLS_PATH"] = str(espidfInstallDir)
env["PATH"] = "/usr/bin:/bin" # TODO: find a better way to achieve this
utils.exec_getout(espidfInstallScript, boards, print_output=False, live=verbose, env=env)
utils.exec_getout(espidfInstallScript, *espidfInstallArgs, print_output=False, live=verbose, env=env)
context.cache["espidf.install_dir"] = espidfInstallDir

0 comments on commit 26ba789

Please sign in to comment.