-
Notifications
You must be signed in to change notification settings - Fork 2k
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
make -j flash
fails due to missing make dependencies or make flash-only
rebuilds the .elf
#16385
Comments
A maybe hacky solution I can think of is to add The more correct solution is to remove |
It seems this was not properly tested in #16073. I'm looking into the issue. |
Is this a duplicate of #13492? |
Yeah this is causing #13492, but the problem is more generic than esp*. It just so happens that not many boards use I think we need a generic solution, like having |
indeed doesn't work, as
Does work (at least with Please re-open, if you disagree. |
Description
Many boards have
FLASHFILE
asELFFILE
and can directly flash theFLASHFILE
setting the rightFFLAGS
; however in some cases boards need additional files or additional conversions expressed in makefile rules.For example:
adafruit-nrfutil
based boards likeBOARD=adafruit-clue
add the$(HEXFILE).zip
toFLASHDEPS
(here) and the %.hex.zip target depends on the %.hex target as defined in that file. Also, the %.hex depends on the %.elf as defined here:RIOT/Makefile.include
Line 655 in 73ccd1e
This means that some targets in
FLASHDEPS
(the .hex.zip file) depend on theELFFILE
. This causesmake flash-only
to rebuild theELFFILE
because in theMakefile.include
this elf target depends onFORCE
esptool
based boards likeBOARD=esp32-wroom-32
(in the CI) have a phonyesp-image-convert
target that uses the$(FLASHFILE)
to generate the extra files needed for flashing which are then used by theflash-only
target. The issue here is thatesp-image-convert
does not depend on$(FLASHFILE)
, so if you runmake flash -j
for this board one of three things can happen: a) you are lucky and theesp-image-convert
target magically runs after the build is done (unlikely), b) you are unlucky and the first time you runmake -j flash
the missing$(FLASHFILE)
just makes the build fail with an error, or c) you are extra unlucky and theesp-image-convert
command runs reading an older version of the$(FLASHFILE)
because the new one is still waiting for some .o to be compiled (the common case). In this last case you are left scratching your head why your board behaves like if the change you just made and compiled fine didn't happen.The issue here is actually one of two different issues:
FLASHDEPS
depend on$(ELFFILE)
when they need to (example 1), but then theflash-only
command is actually building as well (example 1), orFLASHDEPS
are phony targets that don't depend on$(ELFFILE)
even if they use it but in that casemake flash -j
command doesn't work.I didn't find a way to properly set up a board so that it compiles in parallel, flashes and passes the CI.
Note that in the CI having "flash-only" rebuild can cause problems. I tried adding the ELFFILE dependency in the second example but that fails because it tries to re-link the .elf file with an error that it didn't find the eps32 g++ compiler.
Steps to reproduce the issue
Example 1:
Example 2:
Expected results
Example 1: "flash-only" command doesn't rebuild the .elf file.
Example 2: board flashes.
Actual results
Example 1: The second command (
flash-only
) should not rebuild the .elfExample 2: The build very likely fails because the needed ELFFILE was not built when
esp-image-convert
starts running.Versions
The text was updated successfully, but these errors were encountered: