From d80c142ebc4279f6d466110ad81bba6676e03e4e Mon Sep 17 00:00:00 2001 From: JC-000 <3798556+JC-000@users.noreply.github.com> Date: Sun, 30 Aug 2026 06:34:11 -0500 Subject: [PATCH] =?UTF-8?q?docs:=20HTTPS=5FSNI=20needs=20`make=20clean`=20?= =?UTF-8?q?=E2=80=94=20it=20was=20wrongly=20listed=20as=20exempt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Build section listed HTTPS_HOST/HTTPS_PATH/HTTPS_SNI together as the #128 exception to the "make clean after any flag change" rule. That is right for the first two and wrong for HTTPS_SNI. HTTPS_SNI's string does ride the content-compared build/https_host.inc, but a non-empty value also adds -D HTTPS_SNI_OVERRIDE=1, and that define is read by src/http.s (the http_get prologue that writes tls_hostname) as well as boot.s. The compare deletes only boot.o, so http.o keeps the non-override code. The result is a mixed link that embeds the SNI string via boot.o while never executing the override — behaviourally identical to not passing the flag at all. It defeats every cheap check: the PRG hash changes, and the name greps out of the image (it is also boot.s's default host), so only a diff against a properly cleaned build exposes it. Measured on uci onchip: a65fff60… clean vs d1b63508… dirty. Found while verifying #149 on hardware, where it cost a false negative — it made #141's suggested fix look broken when it in fact works. Also notes that HTTPS_PORT and HTTPS_BODY_TO_REU are pure -D flags outside the compare and were never exempt. Co-Authored-By: Claude Opus 5 (1M context) --- CLAUDE.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2b6ce0d6..5319aac2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,9 +47,20 @@ Neither exit code nor file size proves a build; **compare the PRG's sha256**. `.o` hashes are never evidence — ca65 stamps build time into every object; ld65 does not propagate it, so the PRG is deterministic. -The one exception is `HTTPS_HOST`/`HTTPS_PATH`/`HTTPS_SNI`: a generated +The one exception is `HTTPS_HOST`/`HTTPS_PATH`: a generated `build/https_host.inc` is content-compared **at Makefile parse time** and invalidates `boot.o` + the PRG, so no `make clean` is needed for those (#128). +**`HTTPS_SNI` is NOT exempt — it needs `make clean`.** Its string rides the +same include, but a non-empty value also adds `-D HTTPS_SNI_OVERRIDE=1`, read +by `src/http.s` (the `http_get` prologue that writes `tls_hostname`) as well +as `boot.s`. The compare deletes only `boot.o`, so `http.o` keeps the +non-override code and you get a mixed link that embeds the SNI string but +never runs the override — indistinguishable from not passing the flag. The +PRG hash changes and the name greps out of the image (it is also `boot.s`'s +default host), so only a diff against a cleaned build catches it. The general +flag rule wins over this exception; `HTTPS_PORT` and `HTTPS_BODY_TO_REU` are +pure `-D` flags outside the compare and were never exempt. + Also: `$(PRG)`'s recipe `rm -f`s the target first, because ld65 writes nothing on a memory-area overflow and every rig loads the PRG by path — an absent PRG is the honest state after a failed link. Keep prose out of recipe