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

Environment variables (PATH etc.) not set in Visual Studio Code development container (IDFGH-13713) #14584

Closed
TheSeven opened this issue Sep 16, 2024 · 3 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@TheSeven
Copy link

TheSeven commented Sep 16, 2024

This recent addition of code

fd.write(f'source {bashrc_path}\n')

causes an endless loop of ~/.bashrc sourcing /opt/esp/idf/export.py, running activate.py, activate_venv.py and the resulting script in turn sourcing ~/.bashrc again.
VSCode waits for 10 seconds for this to finish, which it doesn't, then gives up and continues without the necessary environment variables being set, resulting in builds failing with xtensa-esp32-elf-gcc not being found.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 16, 2024
@github-actions github-actions bot changed the title Environment variables (PATH etc.) not set in Visual Studio Code development container Environment variables (PATH etc.) not set in Visual Studio Code development container (IDFGH-13713) Sep 16, 2024
@espressif-bot espressif-bot added Type: Bug bugs in IDF Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Sep 16, 2024
@mfialaf
Copy link
Collaborator

mfialaf commented Sep 16, 2024

Hi @TheSeven , thank you for reporting the bug.

As for now, I can recommend a temporary workaround, by using the old export script:
ESP_IDF_LEGACY_EXPORT=1 . ./export.sh or . ./tools/legacy_exports/export_legacy.sh

@TheSeven
Copy link
Author

I worked around it by just breaking the recursion in .bashrc by changing the related line in the Dockerfile to this:
RUN echo "[ -z \"\$ESP_EXPORT_DONE\" ] && ESP_EXPORT_DONE=yes . /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc

With that file being automatically generated by the ESP-IDF VSCode extension, should I open an issue against that to get a workaround added there for the time being?

@fhrbata
Copy link
Collaborator

fhrbata commented Sep 17, 2024

I worked around it by just breaking the recursion in .bashrc by changing the related line in the Dockerfile to this: RUN echo "[ -z \"\$ESP_EXPORT_DONE\" ] && ESP_EXPORT_DONE=yes . /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc

With that file being automatically generated by the ESP-IDF VSCode extension, should I open an issue against that to get a workaround added there for the time being?

Apologies for the inconvenience. I believe this issue needs to be addressed in the export scripts. At present, the export script is sourcing .bashrc, which is incorrect.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Selected for Development Issue is selected for development Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants