Three defects in sys/unix/Makefile.top:
The "no checksum known" test read [ -z $CHKSUMSTMP ], which tests the
filename string rather than the file, so it never fired. A tarball
with no entry in submodules/CHKSUMS reported "Checksum found" and then
failed with "Integrity check FAILED - STOPPING", which suggests a
corrupted or tampered download rather than a missing checksum. It now
tests [ ! -s $CHKSUMSTMP ] and reports the real reason.
A missing semicolon left "exit 1" as an argument to echo on the final
failure path, so exhausting every download source exited 0 and make
reported success.
CHKSUMS.tmp was never removed; it is now deleted on both exits.
Three small defects in the fetch-Lua target in sys/unix/Makefile.top. I went looking for the CHKSUMS.tmp leftover and found the other two next to it.
1. The "no checksum known" branch could never run
-z tests the filename string, which is never empty, so the branch was dead. A tarball with no entry in submodules/CHKSUMS fell through to the else branch and was "verified" against an empty checklist.
Building with a Lua version that has no checksum entry, before and after:
It fails closed either way, so this is not a security issue, but "Integrity check FAILED" points at a corrupted or tampered download when the real cause is a missing entry.
2. Exhausting every download source exited 0
The line continuation makes exit 1 an argument to echo, so the subshell exits 0 and make reports success. The build then fails later with "Please do 'make fetch-lua'", which is the message you just tried to act on.
3. CHKSUMS.tmp was never removed
It is now deleted on both exits from the checksum block. Not on the integrity-failure path, where the build has stopped hard and the file is more useful kept than removed.
Testing
Ubuntu 24.04, gcc, sys/unix/hints/linux.500, tty.
No doc/fixes5-0-1.txt entry, since recent contributor PRs leave that to you. Happy to add one if you would rather have it.
🤖 Generated with Claude Code