Skip to content
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

When installing specific tools, export.sh fails (IDFGH-6172) #7848

Closed
shehzaman opened this issue Nov 6, 2021 · 3 comments
Closed

When installing specific tools, export.sh fails (IDFGH-6172) #7848

shehzaman opened this issue Nov 6, 2021 · 3 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@shehzaman
Copy link

shehzaman commented Nov 6, 2021

Environment

  • Module or chip used: ESP32-WROOM-32
  • IDF version: master - 417ef24
  • Compiler version: xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2) 8.4.0
  • Operating System: Linux, Ubuntu 18.04 (Docker Container), Python: 3.6.9
  • Using an IDE?: No

Problem Description

I am following instructions from https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#get-started-set-up-tools

The install.sh script supports installing specific tools, I tried installing esp32 only and none of the other tools.

Next step . ./export.sh (or source export.sh) fails as it cannot find other tools (xtensa-esp32s2-elf, xtensa-esp32s3-elf, etc) which I do not need.

Expected Behavior

source export.sh should be aware of tools installed and not fail when some tools are not installed.

Actual Behavior

source export.sh stops because ERROR <> tool has no installed versions

Steps to reproduce

I am following instructions from https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#get-started-set-up-tools

Step 1:

cd ~/esp

git clone -b master --depth=1 --recursive https://github.com/espressif/esp-idf.git

cd esp-idf

./install.sh esp32                            

Detecting the Python interpreter
Checking "python" ...
Python 3.6.9
"python" has been detected
Installing ESP-IDF tools
WARNING: File /root/.espressif/idf-env.json was not found. 
Creating /root/.espressif/idf-env.json
WARNING: File /root/.espressif/idf-env.json can not be created. 
Selected targets are: 
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Installing xtensa-esp32-elf@esp-2021r2-8.4.0
Downloading xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz to /root/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz.tmp
Done
Extracting /root/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz to /root/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0
Installing esp32ulp-elf@2.28.51-esp-20191205
Downloading binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /root/.espressif/dist/binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz.tmp
Done
Extracting /root/.espressif/dist/binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /root/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205
Installing openocd-esp32@v0.10.0-esp32-20210902
Downloading openocd-esp32-linux64-0.10.0-esp32-20210902.tar.gz to /root/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20210902.tar.gz.tmp
Done
Extracting /root/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20210902.tar.gz to /root/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210902
Installing Python environment and packages
fatal: No names found, cannot describe anything.
WARNING: Git describe was unsuccessful: b''
...
... (things that ran successfully)
...
All done! You can now run:

  . ./export.sh

Step 2:

. ./export.sh

Detecting the Python interpreter
Checking "python" ...
Python 3.6.9
"python" has been detected
Adding ESP-IDF tools to PATH...
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/root/esp/esp-idf/install.sh' to install it.
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/root/esp/esp-idf/install.sh' to install it.
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/root/esp/esp-idf/install.sh' to install it.
ERROR: tool esp32s2ulp-elf has no installed versions. Please run '/root/esp/esp-idf/install.sh' to install it.
fatal: No names found, cannot describe anything.
WARNING: Git describe was unsuccessful: b''

The . ./export.sh command fails because it is unable to find tools, that I did not install. I do not need any of the other tools.

Did it fail because idf-env.json could not be generated? I searched this repository, issues, commits and could not find any mention of idf-env.json anywhere.

I looked at command line tools for export in idf_tools.py -

export.add_argument('--format', choices=[EXPORT_SHELL, EXPORT_KEY_VALUE], default=EXPORT_SHELL,

There is no command line option to mention which tools have been installed.

I'd be very obliged if anyone could help me run the export script correctly.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 7, 2021
@github-actions github-actions bot changed the title When installing specific tools, export.sh fails When installing specific tools, export.sh fails (IDFGH-6172) Nov 7, 2021
@dobairoland
Copy link
Collaborator

Hi @shehzaman. Yes, you are right that this is the cause:

WARNING: File /root/.espressif/idf-env.json can not be created. 

So it cannot save that your installation choice was "esp32" only.

Does the file exists? Or maybe directory /root/.espressif doesn't exist?

Does it help if you do mkdir /root/.espressif before install.sh?

BTW, in docker we use idf_tools.py directly: https://github.com/espressif/esp-idf/blob/master/tools/docker/Dockerfile#L65. But please try mkdir before this one to see if it works. Thanks!

@shehzaman
Copy link
Author

Hi @dobairoland thank you for taking a look into this.

You are absolutely right!

The script that creates idf-env.json expects /root/.espressif folder to be present. Since creation of idf-env.json precedes the directory creation in idf_tools.py it fails.

Adding mkdir /root/.espressif before install.sh fixes it.

Ah, I should've taken a look at the docker folder makes it so much easier!

I'll close the issue as it is solved.

@dobairoland
Copy link
Collaborator

Thanks @shehzaman for the feedback. I'll create a patch so mkdir won't be necessary in the future.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants