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

IDF_PATH cannot contain shell characters like ~ #118

Closed
MobiusHorizons opened this issue Nov 24, 2016 · 12 comments
Closed

IDF_PATH cannot contain shell characters like ~ #118

MobiusHorizons opened this issue Nov 24, 2016 · 12 comments
Labels
Status: Opened Issue is new

Comments

@MobiusHorizons
Copy link

Updated the esp_idf today, and all the examples fail to compile. The relavant error message is

/Users/username/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/4.8.5/../../../../xtensa-esp32-elf/bin/ld: cannot open map file /Users/username/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.map: No such file or directory
[/Users/username/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.elf] Error 1

Where does this file come from, and how do I create it?

I think the documentation as well as the examples/template project should be updated to reflect this change.

@igrr
Copy link
Member

igrr commented Nov 24, 2016

Just did a clean build of example project on macOS (which I think you are using) and it doesn't produce this error. Could you please run make V=1 and post a link to the full output you get?

Also try checking of build/bootloader directory actually exists, by doing ls -l build. It should be created automatically by the build system, but the error you are getting may be indicating that it wasn't created for some reason.

@MobiusHorizons
Copy link
Author

You are correct, I am on OSX.

In my case, the build directory does not contain a bootloader subdirectory.

The results of make V=1 in the 02_blink directory are as follows.

including /Users/paulmartin/esp/esp-idf/components/bootloader/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/esp32/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/esptool_py/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/mbedtls/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/nghttp/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/partition_table/Makefile.projbuild...
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C /Users/paulmartin/esp/esp-idf/components/bootloader/src V=1 BUILD_DIR_BASE=/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader /Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.bin
including /Users/paulmartin/esp/esp-idf/components/esptool_py/Makefile.projbuild...
including /Users/paulmartin/esp/esp-idf/components/bootloader/Makefile.projbuild...
xtensa-esp32-elf-gcc -nostdlib -L~/esp/esp-idf/lib -L~/esp/esp-idf/ld -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/esptool_py -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader_support -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/log -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/spi_flash -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/micro-ecc -L/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/main -u call_user_start_cpu0  -Wl,--gc-sections -Wl,-static -Wl,--start-group  -lgcc -Wl,--end-group -Wl,-EL -o /Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.elf -Wl,-Map=/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.map
/Users/paulmartin/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/4.8.5/../../../../xtensa-esp32-elf/bin/ld: cannot open map file /Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.map: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.elf] Error 1
make: *** [/Users/paulmartin/esp/esp-idf/examples/02_blink/build/bootloader/bootloader.bin] Error 2

I may have updated incorrectly, All I did was a git pull; git submodule update.

@oguiter
Copy link

oguiter commented Dec 9, 2016

I can confirm the build/bootloader is not created. If i create it manually, everything works.
My OS: Ubuntu 16.04 64b

@oguiter
Copy link

oguiter commented Dec 10, 2016

Update: not a bug. Please check the IDF_PATH var... you must set a full/complete path: eg.:
BAD: export IDF_PATH="~/Devel/Espressif/ESP32/20161209/esp-idf"
GOOD: export IDF_PATH="/home/bflash4k/Devel/Espressif/ESP32/20161209/esp-idf"
Hope this will help !!!

@MobiusHorizons
Copy link
Author

@bflash4k This solution works for me. Thanks.

@projectgus
Copy link
Contributor

For the record, this also works:

export IDF_PATH=~/Devel/Espressif/ESP32/20161209/esp-idf

(Leaving off the quotes means that the shell expands the ~, instead of storing it in the environment variable.)

I've submitted a fix for code review which will work around this issue entirely, so both types (quoted & unquoted) will work.

@projectgus projectgus changed the title missing bootloader.map IDF_PATH cannot contain shell characters like ~ Dec 22, 2016
@projectgus projectgus added the Status: Pending blocked by some other factor label Dec 22, 2016
igrr pushed a commit that referenced this issue Dec 26, 2016
See github issue #118

(This is easier to work around in the build system than to document.)
igrr pushed a commit that referenced this issue Dec 26, 2016
Build system: Allow IDF_PATH to contain ~ or C:/

See github issues
* #118
* #166

(This is easier to work around in the build system than to document.)

See merge request !315
@igrr igrr closed this as completed Jan 16, 2017
@igrr igrr removed the Status: Pending blocked by some other factor label Jan 16, 2017
@geekskick
Copy link

This is an issue still in the v3.3-beta1-328-gabea9e4c0 release and its documentation here.

@projectgus
Copy link
Contributor

@geekskick Are you referring to the "Linux and MacOS" section here: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/add-idf_path-to-profile.html#linux-and-macos

This works:

export IDF_PATH=~/esp/esp-idf

Because the ~ is expanded by the shell before it processes the export command. You can verify by running echo "$IDF_PATH" to see the value.

A form of the command which does not work is this:

export IDF_PATH="~/esp/esp-idf"

The quotes mean that shell expansion does not happen and the variable is set to the exact string value, including the ~.

@projectgus
Copy link
Contributor

projectgus commented Feb 7, 2019

@geekskick Also, the fix linked above means that even if the IDF_PATH contains a literal ~ character, it's expanded properly. I just tested on the master branch and was able to build an ESP-IDF example with such a path set.

If the build is failing and you think it's a build system bug, please open a new issue with all of the information asked for in the issue template. Feel free to link back to this issue if you think it's related.

@geekskick
Copy link

My apologies, I had the quotes in there! RTFM.

Although the second part doesn't seem to be true for me - with the ~ literal in the expansion doesn't work.

@projectgus
Copy link
Contributor

@geekskick What OS are you using?

@geekskick
Copy link

macOS Mojave 10.14.2

@espressif-bot espressif-bot added the Status: Opened Issue is new label Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

6 participants