makefiles/tests: use BINFILE for hash comparision instead of ELFFILE#18216
makefiles/tests: use BINFILE for hash comparision instead of ELFFILE#18216gschorcht merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
Note that creation of the binfile is one (rather simple) step more. But I do think that many ESP32 builds currently do get rebuild within the bounds of three failures due to this issue, and much less re-runs will be needed if the false positives don't happen anymore. |
|
Does everything have a |
makefiles/tests/tests.inc.mk
Outdated
| # RIOTNOLINK="". | ||
| ifeq (,$(RIOTNOLINK)) | ||
| test-input-hash: $(TESTS) $(TESTS_WITH_CONFIG) $(TESTS_AS_ROOT) $(ELFFILE) $(TEST_EXTRA_FILES) | ||
| test-input-hash: $(TESTS) $(TESTS_WITH_CONFIG) $(TESTS_AS_ROOT) $(BINFILE) $(TEST_EXTRA_FILES) |
There was a problem hiding this comment.
If I'm right, BINFILE is not built in CI:
Lines 689 to 695 in 55b57e1
There was a problem hiding this comment.
But if it is added as prerequisite, it should be built
There was a problem hiding this comment.
Hm, I tried it for AVR, only the FLASHFILE (.hex) is generated when RIOT_CI_BUILD is set.
|
Whatever we change it to we may want to add a REMOVEME commit that prevents silent failures. |
Even though BINFILE ?= $(ELFFILE:.elf=.bin)
|
|
So we should go for Given that the hash is used to guard tests runs, it may actually be quite beneficial to not run tests again if the machine code is unchanged. E.g. a whitespace change will result in a different ELF file with debug symbols, as the mapping of source lines to machine code will differ. Still, running the test again will (hopefully!) not yield a different result. |
|
Sure, maybe add a remove me commit before the has that sets |
7eb283c to
181dd44
Compare
|
@MrKevinWeiss: Added and |
makefiles/tests/tests.inc.mk
Outdated
| ifeq (,$(FLASHFILE)) | ||
| $(error "FLASHFILE is not set!") | ||
| endif |
There was a problem hiding this comment.
I guess this check isn't needed here because this check is already done here
Lines 685 to 687 in 55b57e1
makefile/tests/test.inc.mk is included. Right?
There was a problem hiding this comment.
BTW, using the undefined FLASHFILE variable in the error message doesn't make sense 😉
There was a problem hiding this comment.
The intention was probably to use $(BOARD)
181dd44 to
55320dd
Compare
|
I changed back to BINFILE. The issue of mismatching hashes of the ELFFILE is not limited to ESP32 and other targets do use the ELFFILE as FLASHFILE. Let's use consistently the BINFILE, sot hat we finally have the issue solved. Also note that it will result in faster CI times when tests are running, as right now white-space-only changes will result in tests being re-run (due to changes in |
|
Cool, no BINFILE for MIPS. I am using the HEXFILE on MIPS now instead, that should also be robust against changes in debug symbols. |
|
Please squash. |
Let's consider firmwares as identical if their flash files are matching. This will have the side effect that hash mismatches for ESP32 due to different .debug sections in the ELFFILE are prevented, as for ESP32 the BINFILE is used.
9b6393a to
a247e87
Compare
|
@maribu Thanks for solving that problem. |
|
Thx for the reviews! |
|
It appears as the issue is still present |
|
Shit. I will try to take a look soonish |
|
Might it be that the PR has to be rebased? |
|
Murdock will rebase automatically before building |
|
I think I know what the issue is: Since there is no explicit rule to create the binfile, make cannot now for what job it has to wait to finish before starting to compare the hash value. Doing a |
|
False alarm, it does work fine without |
|
I opened #18236 in the hope it can shed some light on the remaining issue. I cannot reproduce mismatching values in |
Me too.
What confirms this assumption is that the problem seems to occur only sporadically. Some compilations have already been successful, others still show the problem. It seems to occur mostly with |
Contribution description
Let's consider firmwares as identical if their binfiles are matching, e.g. in case the
.debugsection ends up being different for whatever reason.This hopefully makes sure false positives on hash mismatches are a thing of the past.
Testing procedure
Murdock should be happy. Even for ESP32 builds, every time.
Issues/PRs references
None