-
Notifications
You must be signed in to change notification settings - Fork 134
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
Cargo-first build story with "pure" ESP-IDF tooling #3
Comments
Forgot to say: since we have the luxury of full control over the hidden mini ESP-IDF project, we can interrogate the native CMake build system using project-specific means, like custom CMake scripts that we inject in the project. This is what I'm actually doing for PIO here. |
I just created a draft pull request for this: #7. |
Closed by #7. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking at what it would take to replace (or have it as an additional option) the existing PlatformIO-based cargo-first build with a "native" esp-idf-tooling based cargo-first build.
Scope & Requirements
This is for now only for "Cargo-first" builds. I.e.:
esp-idf-sys
crate (which is somehow the representation of ESP-IDF in Rust-land) - Cargo is invoking or even downloading other tools, like the Espressif toolchains, or CMake or Python - this is completely hidden from the user (unless the user wants to opt-in with their own ESP IDF SDK dir and/or .espressif toolchain dir).This story is currently implemented by utilizing the PlatformIO build capabilities.
Why ESP-IDF native toolchain?
Assessment
The
install.sh
script available in the root of the ESP-IDF repository might be a very good start, fulfilling most (but maybe not all) of the above requirements:(+) A thin wrapper over Python-based tooling in
tools/
(+) Creates Python virtual envs and does not pollute the user's main Python environment (right?)
(+) Downloads all toolchains automatically
(+) Older and newer ESP-IDFs can co-exist (have separate python virtual envs)
(?) Can I use it on Windows without the "Windows installer" stuff?
(-) Some tooling besides Python still required on the PC of the user (cmake, ninja). PIO downloads this stuff too
(-) Grabbing the PATH requires running
. ./export.sh
. Can I do this with pure Python scripts?(-) PowerShell necessary on Windows. Can I do everything with only Python scripts?
Harder stuff
How the
esp-idf-sys
works is that it essentially builds a hidden ESP-IDF "mini" project, which only contains a stubbedapp_main
function.It then grabs all the artefacts of this build, namely:
esp-idf-hal
andesp-idf-svc
So the question is: is there an easy way to "interrogate" the CMake build system, so that I can get (a) and (b)? With PlatformIO, I'm making use of Scons Construction Variables which provide all of this.
I'm sure there's a way to do this with
CMake
(oridf.py
) too, I just don't know it yet. Any hints?If we can solve (a) and (b), the rest is a breeze.
The text was updated successfully, but these errors were encountered: