Browse Source

defaults.txt: curated per-platform recommended default fetch runtime

The default a no-name 'punk-runtime fetch' retrieves is a release
DECISION, so it lives on the artifact server as hand-curated data
(never generated) - updated in the same change-set that publishes the
artifact it points at, taking effect for every deployed punk-runtime
immediately with no punkshell release. src/build_sha1sums.tcl validates
entries (warns on unknown platforms / missing artifact files) so the
publish and the recommendation cannot drift silently.

Seeded from the values previously baked into punk-runtime's payloads,
with one correction those baked values got WRONG: linux-arm's actual
artifact is tclkit-9.0.2-Linux64-arm-dyn (dotted), not the baked
tclkit-902-Linux64-arm-dyn - a no-name fetch on linux-arm has been
broken until now, which is the config-in-code failure mode this file
removes. freebsd-x86_64 deliberately has no line (its only artifact is
a legacy 8.5-era kit, not a recommendation). Documented in AGENTS.md
Local Contracts with the release process.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
c4d948f975
  1. 10
      AGENTS.md
  2. 14
      defaults.txt
  3. 40
      src/build_sha1sums.tcl

10
AGENTS.md

@ -33,6 +33,16 @@ This artifact repository is specific to the punkshell project.
for raw-file consumers that have no directory-listing capability for raw-file consumers that have no directory-listing capability
(`punk-runtime.cmd platforms -remote`, and third-party mirrors using the same (`punk-runtime.cmd platforms -remote`, and third-party mirrors using the same
layout should carry the same file). Regenerated by `src/build_sha1sums.tcl`. layout should carry the same file). Regenerated by `src/build_sha1sums.tcl`.
- `defaults.txt` at the repo root is the CURATED per-platform recommended default
fetch runtime (`<platform> <runtimename>` per line; `#` comments/blanks
ignored) consulted by `punk-runtime.cmd fetch` when no runtime name is given.
Hand-edited, never generated - it records a release DECISION. The release
process: publish the artifact (add, `git add`, run `src/build_sha1sums.tcl`),
then point the platform's `defaults.txt` line at it IN THE SAME CHANGE-SET -
the script validates entries (warns on unknown platforms or missing artifact
files) so drift between the halves is caught. A platform with no line has no
recommendation (punk-runtime tells the user to name a runtime explicitly).
Mirrors may curate their own recommendations.
- Every platform folder (and tool subfolder) carries a `sha1sums.txt` with one - Every platform folder (and tool subfolder) carries a `sha1sums.txt` with one
`<sha1> *<filename>` line per artifact (binary-mode marker `*`). `<sha1> *<filename>` line per artifact (binary-mode marker `*`).
- `sha1sums.txt` (and `platforms.txt`) are regenerated with - `sha1sums.txt` (and `platforms.txt`) are regenerated with

14
defaults.txt

@ -0,0 +1,14 @@
#recommended default fetch runtime per platform - CURATED BY HAND (not generated).
#punk-runtime 'fetch' with no runtime name consults this file for the resolved
#platform. Update as part of the release/publication change-set: publish the
#artifact, then point the platform's line at it (immutable -r<N> artifact names
#once family runtimes publish). Format: <platform> <runtimename>, one per line;
#'#' comments and blanks ignored. src/build_sha1sums.tcl warns about entries
#naming unknown platforms or missing artifact files.
#(platforms with no line here have no recommended default - punk-runtime tells
#the user to name a runtime explicitly, e.g. freebsd-x86_64's only artifact is
#a legacy 8.5-era kit not suitable as a recommendation.)
win32-x86_64 tclsh902z.exe
linux-x86_64 tclkit-902-Linux64-intel-dyn
linux-arm tclkit-9.0.2-Linux64-arm-dyn
macosx tclkit-902-Darwin64-dyn

40
src/build_sha1sums.tcl

@ -145,4 +145,44 @@ if {$new_platforms ne $existing_platforms} {
} else { } else {
puts stderr "platforms.txt unchanged ([llength $new_platforms] platforms)" puts stderr "platforms.txt unchanged ([llength $new_platforms] platforms)"
} }
#defaults.txt validation - the file itself is CURATED BY HAND (a release
#recommendation, not derivable facts - deliberately never generated here).
#Warn when an entry names a platform this run did not serve or an artifact
#file that does not exist: the release process is 'publish artifact + edit
#defaults.txt in one change-set', and this check catches the halves drifting.
set defaultsfile [file join $basedir defaults.txt]
if {[file exists $defaultsfile]} {
set fd [open $defaultsfile r]
set dcount 0
set dwarn 0
set dln 0
foreach ln [split [read $fd] \n] {
incr dln
set trimln [string trim $ln]
if {$trimln eq "" || [string index $trimln 0] eq "#"} {continue}
if {[llength $trimln] != 2} {
puts stderr "${Y}WARNING: defaults.txt line $dln: expected '<platform> <runtimename>' - got: $trimln$RST"
incr dwarn
continue
}
lassign $trimln dplat dname
incr dcount
if {$dplat ni $new_platforms} {
puts stderr "${Y}WARNING: defaults.txt line $dln: platform '$dplat' is not a served platform folder$RST"
incr dwarn
} elseif {![file exists [file join $basedir $dplat $dname]]} {
puts stderr "${Y}WARNING: defaults.txt line $dln: default '$dname' does not exist in $dplat/$RST"
incr dwarn
}
}
close $fd
if {$dwarn} {
puts stderr "${Y}defaults.txt: $dcount entries, $dwarn warning(s)$RST"
} else {
puts stderr "defaults.txt: $dcount entries OK"
}
} else {
puts stderr "${Y}no defaults.txt found - punk-runtime no-name fetch will have no server recommendation$RST"
}
cd $original_cwd cd $original_cwd

Loading…
Cancel
Save