From c894437f4c54258c0a75be548a1885fff33f9524 Mon Sep 17 00:00:00 2001 From: pi-os3 Date: Sat, 7 Nov 2026 20:01:13 -0400 Subject: [PATCH] package: the lemonade payload is the second packing site, and it shipped 0775 files (#1352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The engine tarball half of #1352 landed as #1361 (pack_normalise_modes / pack_writable_files in scripts/pack-elf.sh, asserted in package-linux.sh). The payload is packed somewhere else and was left out: scripts/weekly.sh builds lemonade-onebit- with its own `tar -C "$W/lemonade" … bin 1bit lemond-onebit`, and that tree still carries the build's umask. Measured in the SHIPPED c32 image, which is what makes this not theoretical: opt/1bit-package/bin/lemond is -rwxrwxr-x (0775) and opt/1bit-package/bin is a 0775 DIRECTORY, alongside 1bit/1bit 0775, the HRX/ggml libraries 0775 and LICENSE/NOTICE 0664 - 134 of 195 payload files, all root:root. The number comes from this fold, not from package-linux.sh. So the fold gets the same rule and the same helpers, so the two tarballs cannot drift: pack_normalise_modes fixes, pack_writable_files reports (a reporter that does not fix its own work, as #1361 has it), and the fold REFUSES rather than publishing a writable payload. It runs immediately after pack_localize_links, which is the last step that writes into the staging tree. ElF-or-was-executable stays executable and everything else becomes data, so behaviour cannot change. Measured on a fixture shaped like the shipped payload (0775 directories, 0775 binaries and libraries, an 0664 NOTICE): before (what main does - nothing) 7 group/other-writable paths after this commit 0 and the tar the fold would write drwxr-xr-x dirs, -rwxr-xr-x for 1bit/1bit and libhrx.so.0, -rw-r--r-- for NOTICE bash -n clean; shellcheck -S warning reports the same 7 findings as main (all pre-existing, none in this hunk); tools/copyright.py --check rc 0; one file, +8 lines. --- scripts/weekly.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/weekly.sh b/scripts/weekly.sh index 88f9cc166..1fda5e158 100755 --- a/scripts/weekly.sh +++ b/scripts/weekly.sh @@ -560,6 +560,14 @@ stage_package() { # links out of the tree (the web app's KaTeX fonts -> the build machine's fonts-katex) become # copies of their targets; the links inside it stay links pack_localize_links "$W/lemonade/bin" + # engine#1352, the second packing site: package-linux.sh normalises the ENGINE tarball (#1361), but this payload is packed + # here and carries its own modes - measured in the shipped c32 image, opt/1bit-package/bin/lemond was 0775 and bin/ itself + # a 0775 directory, straight from the build's umask. Same rule and the same helpers as the engine tarball, so the two + # tarballs cannot drift: pack_normalise_modes fixes, pack_writable_files reports, and the fold refuses rather than shipping. + # It runs after pack_localize_links because that is the last step that writes into the staging tree. + pack_normalise_modes "$W/lemonade" + fold_bad=$(pack_writable_files "$W/lemonade") + [ -z "$fold_bad" ] || { printf 'REFUSED: group/other-writable path(s) in the lemonade staging:\n%s\n' "$fold_bad" >&2; return 1; } # the S flag: member names only; GNU tar otherwise rewrites symlink targets too, and every # libggml*.so.0 -> libggml*.so.0.18.0 link in 1bit/hrx/llama/bin pointed into a directory that is not there tar -C "$W/lemonade" --transform "s,^,lemonade-onebit-$tag/,S" -cf - bin 1bit lemond-onebit | zstd -q -T4 -19 \