build: make every header a rebuild prerequisite (1.0.3)
`make` listed only src/*.c, the generated UI header and vendor/*.c as prerequisites, so a one-line edit to src/ws.h - a version bump, a provider id, a buffer size - printed "Nothing to be done for 'native'" and left the PREVIOUS binary in place. The build reports success and the artefact is stale, which is exactly the failure this project keeps paying for. Reproduced while bumping WS_VER for 1.0.3: metadatas kept answering 1.0.2 until the header was touched. HDR now covers src/*.h, vendor/*.h and vendor/bearssl/*.h (the TLS and JSON sources are compiled straight out of that tree, so their headers count too), and tests/run.sh pins the rule rather than the belief - 87 assertions.
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-14 07:49:47
Commit7c66e20b
Parents634a1999
Changed files
Makefile+13−6■■■■■
plugin.json+1−1■■
src/ws.h+1−1■■
tests/run.sh+10−0■■■■■
4 files+25−8
Diff
Makefile+13−6■■■■■
index 9312b4a..aff9a19 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,13 @@ ARM_CC ?= aarch64-linux-gnu-gcc
3232 WIN_CC ?= x86_64-w64-mingw32-gcc
3333
3434 SRC_C := $(wildcard src/*.c)
35+# Every header is a prerequisite too. Without them a one-line edit to
36+# src/ws.h (a version bump, a provider id, a buffer size) left `make`
37+# reporting "Nothing to be done" and the *previous* binary in place - the
38+# build says success and the artefact is stale, which is the failure mode
39+# this project keeps paying for. vendor/ headers are included because the
40+# TLS and JSON sources are compiled straight from that tree.
41+HDR := $(wildcard src/*.h) $(wildcard vendor/*.h) $(wildcard vendor/bearssl/*.h)
3542 VENDOR_C := $(wildcard vendor/*.c) $(wildcard vendor/bearssl/*.c)
3643 UI_SRC := src/ui.html
3744 UI_HDR := src/ui_html.h
@@ -53,32 +60,32 @@ ui: $(UI_HDR)
5360
5461 native: $(BIN)
5562
56-$(BIN): $(SRC_C) $(UI_HDR) $(VENDOR_C)
63+$(BIN): $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
5764 @echo "==> native build ($(CC))"
5865 $(CC) $(CFLAGS) -o $(BIN) $(SRC_C) $(VENDOR_C)
5966
6067 musl: $(BIN).musl
61-$(BIN).musl: $(SRC_C) $(UI_HDR) $(VENDOR_C)
68+$(BIN).musl: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
6269 @echo "==> static musl build ($(MUSL_CC))"
6370 $(MUSL_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)
6471
6572 arm64: $(BIN).arm64
66-$(BIN).arm64: $(SRC_C) $(UI_HDR) $(VENDOR_C)
73+$(BIN).arm64: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
6774 @echo "==> static arm64 build ($(ARM_CC))"
6875 $(ARM_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)
6976
7077 win64: $(EXE)
71-$(EXE): $(SRC_C) $(UI_HDR) $(VENDOR_C)
78+$(EXE): $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
7279 @echo "==> MinGW-w64 build ($(WIN_CC))"
7380 $(WIN_CC) $(CFLAGS) -static -D_WIN32_WINNT=0x0601 -fno-strict-aliasing \
7481 -o $@ $(SRC_C) $(VENDOR_C) $(WIN_LIBS)
7582
76-macos: $(SRC_C) $(UI_HDR) $(VENDOR_C)
83+macos: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
7784 @echo "==> Apple clang build"
7885 $(CC) $(CFLAGS) -fno-strict-aliasing -o $(BIN) $(SRC_C) $(VENDOR_C)
7986
8087 asan: $(BIN)-asan
81-$(BIN)-asan: $(SRC_C) $(UI_HDR) $(VENDOR_C)
88+$(BIN)-asan: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
8289 @echo "==> ASan + UBSan + FORTIFY build"
8390 $(CC) -O1 -g $(STD) $(WARN) $(INCLUDES) -D_FORTIFY_SOURCE=2 \
8491 -fsanitize=address,undefined -fno-omit-frame-pointer \
plugin.json+1−1■■
index e169b42..786c1d9 100644
--- a/plugin.json
+++ b/plugin.json
@@ -11,7 +11,7 @@
1111 "menus": false,
1212 "verified": "mock",
1313 "category": "network",
14- "version": "1.0.2",
14+ "version": "1.0.3",
1515 "license": "MIT",
1616 "capabilities": [
1717 "outbound_https_search_api",
src/ws.h+1−1■■
index 8301ad0..14ac690 100644
--- a/src/ws.h
+++ b/src/ws.h
@@ -32,7 +32,7 @@
3232
3333 #define WS_SLUG "websearch"
3434 #define WS_ID "plugin_websearch"
35-#define WS_VER "1.0.2"
35+#define WS_VER "1.0.3"
3636 #define WS_NAME "websearch"
3737 #define WS_DESC "Web search MCP"
3838
tests/run.sh+10−0■■■■■
index f114706..7bda96b 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -399,6 +399,16 @@ else fail "require_node_auth() is not called"; fi
399399 if python3 tools/gen_ui.py --check >/dev/null 2>&1; then
400400 pass "src/ui_html.h matches src/ui.html"
401401 else fail "src/ui_html.h is stale (run make ui)"; fi
402+# A one-line header edit must force a rebuild. `make` used to treat only
403+# src/*.c and the generated UI header as prerequisites, so a version bump in
404+# src/ws.h left "Nothing to be done" and the previous binary in place - the
405+# build reported success with a stale artefact (the failure this project
406+# keeps paying for). Pin the rule, not the belief.
407+if grep -q '^HDR ' Makefile && grep -q '\$(HDR)' Makefile; then
408+ pass "Makefile makes every header a rebuild prerequisite"
409+else
410+ fail "Makefile does not depend on src/*.h - a header edit would not rebuild"
411+fi
402412
403413 # --------------------------------------------------------------- summary
404414 printf '\n%s== summary ==%s\n' "$C_B" "$C_0"
405415
Makefile+13−6■■■■■
index 9312b4a..aff9a19 100644index 9312b4a..aff9a19 100644
--- a/Makefile--- a/Makefile
+++ b/Makefile+++ b/Makefile
@@ -32,6 +32,13 @@ ARM_CC ?= aarch64-linux-gnu-gcc@@ -32,6 +32,13 @@ ARM_CC ?= aarch64-linux-gnu-gcc
32 WIN_CC ?= x86_64-w64-mingw32-gcc32 WIN_CC ?= x86_64-w64-mingw32-gcc
33 33
34 SRC_C := $(wildcard src/*.c)34 SRC_C := $(wildcard src/*.c)
35+# Every header is a prerequisite too. Without them a one-line edit to
36+# src/ws.h (a version bump, a provider id, a buffer size) left `make`
37+# reporting "Nothing to be done" and the *previous* binary in place - the
38+# build says success and the artefact is stale, which is the failure mode
39+# this project keeps paying for. vendor/ headers are included because the
40+# TLS and JSON sources are compiled straight from that tree.
41+HDR := $(wildcard src/*.h) $(wildcard vendor/*.h) $(wildcard vendor/bearssl/*.h)
35 VENDOR_C := $(wildcard vendor/*.c) $(wildcard vendor/bearssl/*.c)42 VENDOR_C := $(wildcard vendor/*.c) $(wildcard vendor/bearssl/*.c)
36 UI_SRC := src/ui.html43 UI_SRC := src/ui.html
37 UI_HDR := src/ui_html.h44 UI_HDR := src/ui_html.h
@@ -53,32 +60,32 @@ ui: $(UI_HDR)@@ -53,32 +60,32 @@ ui: $(UI_HDR)
53 60
54 native: $(BIN)61 native: $(BIN)
55 62
56-$(BIN): $(SRC_C) $(UI_HDR) $(VENDOR_C)63+$(BIN): $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
57 @echo "==> native build ($(CC))"64 @echo "==> native build ($(CC))"
58 $(CC) $(CFLAGS) -o $(BIN) $(SRC_C) $(VENDOR_C)65 $(CC) $(CFLAGS) -o $(BIN) $(SRC_C) $(VENDOR_C)
59 66
60 musl: $(BIN).musl67 musl: $(BIN).musl
61-$(BIN).musl: $(SRC_C) $(UI_HDR) $(VENDOR_C)68+$(BIN).musl: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
62 @echo "==> static musl build ($(MUSL_CC))"69 @echo "==> static musl build ($(MUSL_CC))"
63 $(MUSL_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)70 $(MUSL_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)
64 71
65 arm64: $(BIN).arm6472 arm64: $(BIN).arm64
66-$(BIN).arm64: $(SRC_C) $(UI_HDR) $(VENDOR_C)73+$(BIN).arm64: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
67 @echo "==> static arm64 build ($(ARM_CC))"74 @echo "==> static arm64 build ($(ARM_CC))"
68 $(ARM_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)75 $(ARM_CC) $(CFLAGS) -static -fno-strict-aliasing -o $@ $(SRC_C) $(VENDOR_C)
69 76
70 win64: $(EXE)77 win64: $(EXE)
71-$(EXE): $(SRC_C) $(UI_HDR) $(VENDOR_C)78+$(EXE): $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
72 @echo "==> MinGW-w64 build ($(WIN_CC))"79 @echo "==> MinGW-w64 build ($(WIN_CC))"
73 $(WIN_CC) $(CFLAGS) -static -D_WIN32_WINNT=0x0601 -fno-strict-aliasing \80 $(WIN_CC) $(CFLAGS) -static -D_WIN32_WINNT=0x0601 -fno-strict-aliasing \
74 -o $@ $(SRC_C) $(VENDOR_C) $(WIN_LIBS)81 -o $@ $(SRC_C) $(VENDOR_C) $(WIN_LIBS)
75 82
76-macos: $(SRC_C) $(UI_HDR) $(VENDOR_C)83+macos: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
77 @echo "==> Apple clang build"84 @echo "==> Apple clang build"
78 $(CC) $(CFLAGS) -fno-strict-aliasing -o $(BIN) $(SRC_C) $(VENDOR_C)85 $(CC) $(CFLAGS) -fno-strict-aliasing -o $(BIN) $(SRC_C) $(VENDOR_C)
79 86
80 asan: $(BIN)-asan87 asan: $(BIN)-asan
81-$(BIN)-asan: $(SRC_C) $(UI_HDR) $(VENDOR_C)88+$(BIN)-asan: $(SRC_C) $(HDR) $(UI_HDR) $(VENDOR_C)
82 @echo "==> ASan + UBSan + FORTIFY build"89 @echo "==> ASan + UBSan + FORTIFY build"
83 $(CC) -O1 -g $(STD) $(WARN) $(INCLUDES) -D_FORTIFY_SOURCE=2 \90 $(CC) -O1 -g $(STD) $(WARN) $(INCLUDES) -D_FORTIFY_SOURCE=2 \
84 -fsanitize=address,undefined -fno-omit-frame-pointer \91 -fsanitize=address,undefined -fno-omit-frame-pointer \
plugin.json+1−1■■
index e169b42..786c1d9 100644index e169b42..786c1d9 100644
--- a/plugin.json--- a/plugin.json
+++ b/plugin.json+++ b/plugin.json
@@ -11,7 +11,7 @@@@ -11,7 +11,7 @@
11 "menus": false,11 "menus": false,
12 "verified": "mock",12 "verified": "mock",
13 "category": "network",13 "category": "network",
14- "version": "1.0.2",14+ "version": "1.0.3",
15 "license": "MIT",15 "license": "MIT",
16 "capabilities": [16 "capabilities": [
17 "outbound_https_search_api",17 "outbound_https_search_api",
src/ws.h+1−1■■
index 8301ad0..14ac690 100644index 8301ad0..14ac690 100644
--- a/src/ws.h--- a/src/ws.h
+++ b/src/ws.h+++ b/src/ws.h
@@ -32,7 +32,7 @@@@ -32,7 +32,7 @@
32 32
33 #define WS_SLUG "websearch"33 #define WS_SLUG "websearch"
34 #define WS_ID "plugin_websearch"34 #define WS_ID "plugin_websearch"
35-#define WS_VER "1.0.2"35+#define WS_VER "1.0.3"
36 #define WS_NAME "websearch"36 #define WS_NAME "websearch"
37 #define WS_DESC "Web search MCP"37 #define WS_DESC "Web search MCP"
38 38
tests/run.sh+10−0■■■■■
index f114706..7bda96b 100755index f114706..7bda96b 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -399,6 +399,16 @@ else fail "require_node_auth() is not called"; fi@@ -399,6 +399,16 @@ else fail "require_node_auth() is not called"; fi
399 if python3 tools/gen_ui.py --check >/dev/null 2>&1; then399 if python3 tools/gen_ui.py --check >/dev/null 2>&1; then
400 pass "src/ui_html.h matches src/ui.html"400 pass "src/ui_html.h matches src/ui.html"
401 else fail "src/ui_html.h is stale (run make ui)"; fi401 else fail "src/ui_html.h is stale (run make ui)"; fi
402+# A one-line header edit must force a rebuild. `make` used to treat only
403+# src/*.c and the generated UI header as prerequisites, so a version bump in
404+# src/ws.h left "Nothing to be done" and the previous binary in place - the
405+# build reported success with a stale artefact (the failure this project
406+# keeps paying for). Pin the rule, not the belief.
407+if grep -q '^HDR ' Makefile && grep -q '\$(HDR)' Makefile; then
408+ pass "Makefile makes every header a rebuild prerequisite"
409+else
410+ fail "Makefile does not depend on src/*.h - a header edit would not rebuild"
411+fi
402 412
403 # --------------------------------------------------------------- summary413 # --------------------------------------------------------------- summary
404 printf '\n%s== summary ==%s\n' "$C_B" "$C_0"414 printf '\n%s== summary ==%s\n' "$C_B" "$C_0"
405415