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

BUILD_DIR_BASE must use Unix-style path on MSYS2+GNU make (IDFGH-472) #2736

Closed
Elektrik1 opened this issue Nov 24, 2018 · 6 comments
Closed
Labels
Status: Done Issue is done internally

Comments

@Elektrik1
Copy link

Elektrik1 commented Nov 24, 2018

On latest commit, setting up BUILD_DIR_BASE custom build path in Makefile does no longer works and produces such error:

AR <ANY_PATH>/xtensa-debug-module/libxtensa-debug-module.a
make: *** No rule to make target '<ANY_PATH>/esp32/esp32.common.ld', needed by '<ANY_PATH>/<PROJECT_NAME>.elf'. Stop.

Steps to reproduce, any example project, include BUILD_DIR_BASE :=<ANY_PATH> in Makefile and then make.

@Alvin1Zhang Alvin1Zhang changed the title Custom build dir failing [TW#27596] Custom build dir failing Nov 26, 2018
@Elektrik1
Copy link
Author

No news ? Build to external directory is still broken.

I have found commit 63411fc broke this. Tried to altering CMakeLists.txt files, with no luck.

Basically issue is that esp32/esp32.common.ld file is not generated on external build dir.

@projectgus
Copy link
Contributor

projectgus commented Feb 3, 2019

Hi @Elektrik1 ,

Sorry noone got back to you earlier about this.

Tried to altering CMakeLists.txt files, with no luck.

Are you using the GNU Make based build system (ie the default setup steps in the Getting Started Guide)? If so, the CMakeLists.txt files are not used. CMake based build system is only used if you run are running cmake or idf.py to start the build.

setting up BUILD_DIR_BASE custom build path in Makefile does no longer work

Assuming you're using the GNU make build system, I just attempted to reproduce this on Linux with latest master branch commit (d4d3ccf) two ways, but couldn't make it fail. I tried one time like this:

make BUILD_DIR_BASE=/path/to/other/build_dir

and a second time by editing the project template Makefile like this:

PROJECT_NAME := app-template

BUILD_DIR_BASE := /path/to/other/build_dir

include $(IDF_PATH)/make/project.mk

Both builds succeeded, including generation of the esp32.common.ld file.

Can you please provide all of the environment details asked for in the issue template, to give us some information to try and reproduce?

Also, please provide details of:

  • Where/how you are setting BUILD_DIR_BASE
  • What build command you run
  • The build output. Output from make V=1 would be the best, you may need to post this on an external site like https://gist.github.com or https://pastebin.com .
  • Anything else that you think may be relevant.

Thanks,

Angus

@Elektrik1
Copy link
Author

Thank you for your response, I do use regular make (msys32) to make the project. Now I understand why CMakeList did not alter anything, thou that was the only file referenced to esp32.common.ld file I have found and tried to enter paths manually.

Package was gathered here: https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20181001.zip, used in Windows 10 x64 machine.

Logs after trying to compile hello_world project:

MINGW32 /home/esp-idf/examples/get-started/hello_world
$ make BUILD_DIR_BASE=D:/Test
....
CC /d/Test/xtensa-debug-module/eri.o
AR /d/Test/xtensa-debug-module/libxtensa-debug-module.a
make: *** No rule to make target '/d/Test/esp32/esp32.common.ld', needed by 'D:/Test/hello-world.elf'.  Stop.

Here is verbose of rebuild cycle: https://pastebin.com/6qUFfFx0
Here is verbose of clean build: https://gist.github.com/Elektrik1/49371385b7500ae1e0accf24eb8a7a7e

Thanks. Meanwhile, will try CMake one.

@projectgus
Copy link
Contributor

Thanks for the extra details.

Does it work if you do make BUILD_DIR_BASE=/d/Test ? (this would still be a bug, just a more subtle one).

@Elektrik1
Copy link
Author

Haha, it works fine with unix-like path, shame I didn't try it that way for months :)

MINGW32 /home/esp-idf/examples/get-started/hello_world
$ make BUILD_DIR_BASE=/d/Test
...
Generating esp32.common.ld
LD /d/Test/hello-world.elf
esptool.py v2.6

Thank you for support!

P.s. I think it's time to move all projects builds to CMake, will try to deal with all undefined references.

@projectgus projectgus reopened this Feb 4, 2019
@projectgus
Copy link
Contributor

Glad you got it working.

Have reopened because this is still something that should be handled in the Make build system. I think probably it will be with an error message asking you to set the Unix-style path (as we can't otherwise remap a Make-level variable override), but this is still better than simply not working).

@projectgus projectgus changed the title [TW#27596] Custom build dir failing Custom build dir failing (IDFGH-472) Mar 12, 2019
@projectgus projectgus changed the title Custom build dir failing (IDFGH-472) BUILD_DIR_BASE must use Unix-style path on MSYS2+GNU make (IDFGH-472) Jun 4, 2019
@espressif-bot espressif-bot added the Status: In Progress Work is in progress label Mar 12, 2021
@espressif-bot espressif-bot added Status: Done Issue is done internally and removed Status: In Progress Work is in progress labels Mar 31, 2021
0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this issue May 5, 2021
As found by @mongozmaki in esp8266/Arduino#6035

With SSO implementation in String, StreamString::write generates wrong
strings under some circumstances.  Reason is that String::len() returns
strlen(sso_buf) if SSO=true but with newly written data
(in StreamString::write) the null-termination missing at the time len()
is called.

Furthermore, len() is called twice which is inefficient if SSO=true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants