-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Wrong SDK version read, when building binaries via docker image (IDFGH-11223) #12389
Comments
Hello @bhuvanchandra , I've tried using the v5.1.1 docker image locally and also with the
The output is contains
TBH I'm quite not sure how the ``HEAD-HASH-NOTFOUND can get there. IIUC esp_get_idf_version returns just If I'm reading the cmake's git_describe function right, the only case where the Are you using the stock docker image provided by espressif Note the HTH, but this doesn't seem like a bug in Thank you |
Hello @fhrbata, thanks for looking into the issue. I tried again, and the problem appears to be related to permissions. With the default root user, I can see the IDF version correctly. However, when running the docker image as a non-root user, the git describe command fails with the error: "fatal: detected dubious ownership in the repository at /opt/esp/idf/." In my workflow, I need to run the following command to access the binary artifacts.
This is necessary for committing and subsequently creating a PR. It's important for me to access these binaries as a standard user, not as root. I'll review and address the permission issues in my workflow. |
Hello @bhuvanchandra , maybe you can look into safe.directory git config option. I think setting it for your repo might help here. Thank you |
Thinking about this a little more, we could probably add the
I will prepare a fix for this. |
In our docker docs[1] we recommend to start docker as a non-root user. This has a side effect, because the esp-idf repo in docker image is owned by root. Git by default refuses even to parse a config file if the repo is owned by other than current user. As a result the version detection in cmake fails[2] and the app version is set to "HEAD-HASH-NOTFOUND". This adds esp-idf repo to the system git config as a safe one. [1] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/ tools/idf-docker-image.html#building-a-project-with-cmake [2] #12389 (comment) Closes #12389 Signed-off-by: Frantisek Hrbata <[email protected]>
In our docker docs[1] we recommend to start docker as a non-root user. This has a side effect, because the esp-idf repo in docker image is owned by root. Git by default refuses even to parse a config file if the repo is owned by other than current user. As a result the version detection in cmake fails[2] and the app version is set to "HEAD-HASH-NOTFOUND". This adds esp-idf repo to the system git config as a safe one. [1] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/ tools/idf-docker-image.html#building-a-project-with-cmake [2] #12389 (comment) Closes #12389 Signed-off-by: Frantisek Hrbata <[email protected]>
In our docker docs[1] we recommend to start docker as a non-root user. This has a side effect, because the esp-idf repo in docker image is owned by root. Git by default refuses even to parse a config file if the repo is owned by other than current user. As a result the version detection in cmake fails[2] and the app version is set to "HEAD-HASH-NOTFOUND". This adds esp-idf repo to the system git config as a safe one. [1] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/ tools/idf-docker-image.html#building-a-project-with-cmake [2] espressif#12389 (comment) Closes espressif#12389 Signed-off-by: Frantisek Hrbata <[email protected]>
Answers checklist.
IDF version.
v5.1.1
Operating System used.
Linux
How did you build your project?
using idf.py build from within esp-idf docker image
If you are using Windows, please specify command line type.
None
What is the expected behavior?
when using esp_get_idf_version expected version is "v5.1.1"
What is the actual behavior?
when using esp_get_idf_version expected version is "HEAD-HASH-NOTFOUND"
Steps to reproduce.
use esp-idf docker image for building the firmware binaries and call the esp_get_idf_version method.
Build or installation Logs.
No response
More Information.
When building the firmware binaries through the CI pipeline, the ESP-IDF version read via the API is incorrect. Instead of the expected "v5.1.1", it reads "HEAD-HASH-NOTFOUND". Upon verifying, the Docker image for the esp-idf doesn't explicitly check out to the release tag, which is necessary for the API to retrieve the correct version from the git tag.
I'm using this action, v5.1.1 docker tag.
The text was updated successfully, but these errors were encountered: