Conversation
|
The issue with locally-built tools under EIM may have been found, see espressif/idf-im-ui#1067 (comment) It'd be great if somebody could try this out on macOS after editing the PATH variable to remove the directories mentioned in the comment linked above, as EIM also installs its own version of clang. So I can at least update the documentation mentioning whether EIM can be used to build MicroPython on macOS :) |
9c3bf6d to
d34951a
Compare
|
I've been told EIM does take over a default LLVM installation to use its own, but that's a Xtensa + RV32 cross compiler only. So, unless Espressif updates its clang version to also target x86_64 and AArch64, this method is not usable on macOS or on systems where there's no GCC installed (*BSDs, maybe?). |
|
Thinking a bit more about this, there may be a "cleaner" solution if Espressif can't (or won't) fix things on their end. If
then, in theory this should work for Linux, WSL, and macOS. |
|
This should make it work under Linux, both using GCC and LLVM to build No idea about building this from Windows outside WSL, but hey, maybe they broke that too... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19657 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 182 182
Lines 23335 23335
Branches 5 5
=======================================
Hits 23006 23006
Misses 328 328
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8df81d6 to
c846a59
Compare
This commit lets the ESP32 port makefile work in environments set up via EIM (Espressif's SDK/toolchain manager) instead of the regular SDK export script. EIM-activated environment do not place `idf.py` into the system's PATH, so the Makefile needs to know where to look for it if it cannot be found right away. However, EIM does set up an environment variable that points to the environment root, and therefore picking up idf.py from there is trivial. As a bonus, if the makefile cannot find idf.py, it will report a more sensible error to the user rather than a generic "file not found" message. The documentation was also updated to mention EIM and the current state of things when using such a tool to manage your ESP-IDF SDKs. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit updates the build infrastructure to undo the local compiler takeover done by Espressif's EIM tool, allowing the ESP32 port to build correctly from an EIM-activated environment. EIM would blindly edit the PATH environment variable to replace any local LLVM installation with its own bare-metal version, and add all directories named `bin` from their tools directory. Three of those directories have files whose name clashes with local GCC installations. As we may build `mpy-cross` for the host system as part of the build process of the ESP32 port, that's unfortunately a workaround we have to add ourselves. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Octoprobe PR report
|

Summary
This PR lets the ESP32 port makefile work in environments set up via EIM (Espressif's SDK/toolchain manager) instead of the regular SDK export script.
EIM-activated environment do not place
idf.pyinto the system's PATH, so the Makefile needs to know where to look for it if it cannot be found right away. However, EIM does set up an environment variable that points to the environment root, and therefore picking up idf.py from there is trivial. As a bonus, if the makefile cannot find idf.py, it will report a more sensible error to the user rather than a generic "file not found" message.The documentation was also updated to mention EIM and the current state of things when using such a tool to manage your ESP-IDF SDKs.
This should close #19390.
Testing
An ESP32 build was initiated successfully with the environment set up by
export.fishfrom a previously set up SDK using the regular git checkout +install.shmethod, then from an environment activated via EIM, and finally with no environment set up to see the new error message.Trade-offs and Alternatives
Currently there is a known issue with EIM preventing building
mpy-crossfrom the same environment it sets up for cross-compilation builds (see espressif/idf-im-ui#1067). However, this PR contains a workaround for this situation.Generative AI
I did not use generative AI tools when creating this PR.