upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 16:58:44 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 16:58:44 +0000
commit9886a4680cd669f376eec1bf18da7ad10057dd38 (patch)
tree587eba4f7e36f09d8f80541bb0805f8372a9e060
parent098074193b7a3147f4ad0e0424618b52fe370026 (diff)
build: let a failed pin check decide the exit status everywhere
fd627b1's message said the rewrite hardened a pin check that used `;` where it needed `&&`. It hardened one of four. Three recipes still ended their chain with `echo "==> ... done"; ` after a semicolon, so a mismatched pin failed the `test`, skipped every build step, and then ran the echo anyway -- exit 0, and make announced a pinned dependency that nothing had verified. deps-windows also had the same break after mkdir and after `make randomx`. The one the earlier message did not mention is deps-secp256k1, on the Linux path: libsecp256k1 is signature verification, so that was the worst of the three to leave reporting success on an unverified checkout. Joined each chain with && the whole way to the closing echo, in deps-secp256k1, and in both halves of deps-windows. Verified by extracting each recipe as make expands it, splitting it into logical recipe lines and running each in its own shell the way make does, with git reporting a sha that does not match the pin: all three previously exited 0 and now exit 1, and each deps-windows half fails independently rather than relying on the other. With a matching sha the recipes still exit 0, still print "done", and still write the marker. The Windows path was not executed -- there is no MSYS2 here -- so pacman was shimmed and only the shell logic below it was measured.
-rw-r--r--Makefile26
1 files changed, 16 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index c891001..c5cf31c 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,12 @@ VERSION := 1.2.19+sec
37# resolves the object by its own hash). Bump deliberately, and rebuild and 37# resolves the object by its own hash). Bump deliberately, and rebuild and
38# resync before shipping the result. 38# resync before shipping the result.
39# 39#
40# The check has to decide the exit status, so each recipe below joins its
41# commands with && the whole way to the closing echo. Ending that chain with a
42# `;` meant a failed `test` only skipped the build steps: the echo still ran,
43# the target still exited 0, and make announced a pinned dependency that
44# nothing had verified.
45#
40# RandomX pin is the commit this tree has been building and syncing against 46# RandomX pin is the commit this tree has been building and syncing against
41# (post-v2.0.1 master, 2026-05-24) -- identical to upstream's pin. 47# (post-v2.0.1 master, 2026-05-24) -- identical to upstream's pin.
42# 48#
@@ -123,8 +129,8 @@ deps-apt:
123deps-secp256k1: 129deps-secp256k1:
124 @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \ 130 @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \
125 echo "==> building libsecp256k1"; \ 131 echo "==> building libsecp256k1"; \
126 rm -rf $(ROOT)/secp256k1-build; \ 132 rm -rf $(ROOT)/secp256k1-build && \
127 git init -q $(ROOT)/secp256k1-build; \ 133 git init -q $(ROOT)/secp256k1-build && \
128 cd $(ROOT)/secp256k1-build && \ 134 cd $(ROOT)/secp256k1-build && \
129 git remote add origin $(SECP256K1_REPO) && \ 135 git remote add origin $(SECP256K1_REPO) && \
130 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ 136 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \
@@ -134,7 +140,7 @@ deps-secp256k1:
134 cd $(ROOT)/secp256k1-build && ./autogen.sh && \ 140 cd $(ROOT)/secp256k1-build && ./autogen.sh && \
135 ./configure --enable-module-schnorrsig --enable-module-extrakeys \ 141 ./configure --enable-module-schnorrsig --enable-module-extrakeys \
136 --disable-shared --with-pic --disable-benchmark --disable-tests && \ 142 --disable-shared --with-pic --disable-benchmark --disable-tests && \
137 make -j$(NPROC) && $(SUDO) make install && $(SUDO) ldconfig; \ 143 make -j$(NPROC) && $(SUDO) make install && $(SUDO) ldconfig && \
138 echo "==> libsecp256k1 done"; \ 144 echo "==> libsecp256k1 done"; \
139 else \ 145 else \
140 echo "==> libsecp256k1 already installed"; \ 146 echo "==> libsecp256k1 already installed"; \
@@ -252,8 +258,8 @@ deps-windows:
252 mingw-w64-ucrt-x86_64-cmake \ 258 mingw-w64-ucrt-x86_64-cmake \
253 autoconf automake libtool 259 autoconf automake libtool
254 @if [ ! -f deps/lib/libsecp256k1.a ]; then \ 260 @if [ ! -f deps/lib/libsecp256k1.a ]; then \
255 rm -rf secp256k1-build; \ 261 rm -rf secp256k1-build && \
256 git init -q secp256k1-build; \ 262 git init -q secp256k1-build && \
257 cd secp256k1-build && \ 263 cd secp256k1-build && \
258 git remote add origin $(SECP256K1_REPO) && \ 264 git remote add origin $(SECP256K1_REPO) && \
259 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \ 265 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \
@@ -264,23 +270,23 @@ deps-windows:
264 ./configure --prefix=$(ROOT)/deps \ 270 ./configure --prefix=$(ROOT)/deps \
265 --enable-module-schnorrsig --enable-module-extrakeys \ 271 --enable-module-schnorrsig --enable-module-extrakeys \
266 --disable-shared --with-pic --disable-benchmark --disable-tests && \ 272 --disable-shared --with-pic --disable-benchmark --disable-tests && \
267 make install; \ 273 make install && \
268 echo "==> secp256k1 done"; \ 274 echo "==> secp256k1 done"; \
269 else \ 275 else \
270 echo "==> secp256k1 already built"; \ 276 echo "==> secp256k1 already built"; \
271 fi 277 fi
272 @if [ ! -f RandomX/build/librandomx.a ]; then \ 278 @if [ ! -f RandomX/build/librandomx.a ]; then \
273 rm -rf RandomX; \ 279 rm -rf RandomX && \
274 git init -q RandomX; \ 280 git init -q RandomX && \
275 cd RandomX && \ 281 cd RandomX && \
276 git remote add origin $(RANDOMX_REPO) && \ 282 git remote add origin $(RANDOMX_REPO) && \
277 git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \ 283 git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \
278 git checkout -q --detach FETCH_HEAD && \ 284 git checkout -q --detach FETCH_HEAD && \
279 test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \ 285 test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \
280 echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \ 286 echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \
281 mkdir -p $(ROOT)/RandomX/build; \ 287 mkdir -p $(ROOT)/RandomX/build && \
282 cd $(ROOT)/RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \ 288 cd $(ROOT)/RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \
283 make randomx; \ 289 make randomx && \
284 echo "==> RandomX done"; \ 290 echo "==> RandomX done"; \
285 else \ 291 else \
286 echo "==> RandomX already built"; \ 292 echo "==> RandomX already built"; \