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

unable to stat $HOME/.espressif/tools/../xtensa-esp32s3-elf-objcopy (RDT-1064) #47

Closed
3 tasks done
Retr0Kr0dy opened this issue Jan 2, 2025 · 2 comments
Closed
3 tasks done

Comments

@Retr0Kr0dy
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

i have this .sh script that i run before the build :

toolchain_esp32=$(find "$HOME/.espressif/tools" -type f -name "xtensa-esp32-elf-objcopy" | head -1)
toolchain_esp32s3=$(find "$HOME/.espressif/tools" -type f -name "xtensa-esp32s3-elf-objcopy" | head -1)

then i should be able to use objcopy before building my project

Actual behavior (suspected bug)

It appears that the files are missing from the Docker image.

Error logs or terminal output

++ find /root/.espressif/tools" -type f -name "xtensa-esp32-elf-objcopy"
++ head -1
+ toolchain_esp32=
++ find /root/.espressif/tools" -type f -name "xtensa-esp32-elf-objcopy"
++ head -1
+ toolchain_esp32s3=

Steps to reproduce the behavior

1 - Modify the default build action to start the script

   - name: Build ESP-IDF Firmware
      uses: espressif/esp-idf-ci-action@v1
      with:
        command: /app/<user>/<repo>/patch-esp-idf.sh && idf.py build
        esp_idf_version: v4.4

with patch-esp-idf.sh containing :

# Find the objcopy tools dynamically
toolchain_esp32=$(find "$HOME/.espressif/tools" -type f -name "xtensa-esp32-elf-objcopy" | head -1)
toolchain_esp32s3=$(find "$HOME/.espressif/tools" -type f -name "xtensa-esp32s3-elf-objcopy" | head -1)

Project release version

latest

System architecture

other (details in Additional context)

Operating system

Linux

Operating system version

Ubuntu latest

Shell

ZSH

Additional context

to put it all, my problem is that am unable to retrieve objcopy files from the docker container in my Action

@github-actions github-actions bot changed the title unable to stat $HOME/.espressif/tools/../xtensa-esp32s3-elf-objcopy unable to stat $HOME/.espressif/tools/../xtensa-esp32s3-elf-objcopy (RDT-1064) Jan 2, 2025
@kumekay
Copy link
Collaborator

kumekay commented Jan 4, 2025

@Retr0Kr0dy IDF tools are not always placed in $HOME/.espressif, this directory can be specified by IDF_TOOLS_PATH environment variable as described in: https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-guides/tools/idf-tools.html#tools-installation-directory and our docker image has it set to: /opt/esp

So, you can modify your script to respect this env variable:

#!/usr/bin/env bash

# Use $IDF_TOOLS_PATH if defined, otherwise fall back to $HOME/.espressif/tools
tools_path="${IDF_TOOLS_PATH:-$HOME/.espressif}/tools"

toolchain_esp32=$(find "$tools_path" -type f -name "xtensa-esp32-elf-objcopy" | head -n 1)
toolchain_esp32s3=$(find "$tools_path" -type f -name "xtensa-esp32s3-elf-objcopy" | head -n 1)

@Retr0Kr0dy
Copy link
Author

Thank you very much; it fixed my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants