Browse Source

G-096 clean-checkout re-verification PASS; suite tools quieted (zig stderr-warning cosmetics)

Fresh clone (shallow path + core.longpaths - the deep-path first attempt
hit windows MAX_PATH on the modpod template trees, caveat recorded) ->
the clone's own punk-getzig fetched 0.16.0 (mirror chain, minisign,
versioned dir) -> cold-cache suite build PASS: 9.0.5 static/zip/pr/przip
shells with recipe-generated configure-products, zip shell smoked, all
tk/tklib/tcllib/tcllibc legs green.

Cold-log 'failed command:' blocks diagnosed as BENIGN zig 0.16 behaviour
(build_runner prints that block for any step with nonempty result_stderr
even on success) triggered by our own tools' informational stderr prints
- zipfs_mkzip/mkimg call echoes now go to stdout and wrapfiletofile's
octet count is removed; rebuild shows zero occurrences, PASS.

All G-096 acceptance items are now met - achieved flip pending user
confirmation.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 4 days ago
parent
commit
cae1483b73
  1. 29
      goals/G-096-zig-buildsuite-piperepl.md
  2. 4
      src/buildsuites/suite_tcl90/tools/wrapfiletofile.zig
  3. 111
      src/buildsuites/suite_tcl90/tools/zipfs_mkimg.tcl
  4. 128
      src/buildsuites/suite_tcl90/tools/zipfs_mkzip.tcl

29
goals/G-096-zig-buildsuite-piperepl.md

@ -372,3 +372,32 @@ Remaining for acceptance:
minisig downloaded -> signature verified -> versioned extract ->
ZIG VERSION: 0.15.2.
- Remaining for this goal: the final clean-checkout re-verification only.
### 2026-07-20 increment: final clean-checkout re-verification PASS - all acceptance items met
- Flow: fresh git clone of the repo (at 9496a898) -> the CLONE'S OWN
bin/punk-getzig.cmd (empty bin/tools; real 0.16.0 fetch via the mirror chain,
minisign-verified, versioned dir) -> suite.tcl build with a cold zig cache ->
'suite_tcl90: PASS - built 9.0.5 (checkout 1a9c3b9d96, zig 0.16.0)' with
recipe-generated tclUuid.h + tclsh.exe.manifest (TCL_WIN_VERSION 9.0.2.905),
static + zip + pr + przip shells produced, zip shell smoked (9.0.5, tz set),
tk/tklib/tcllib/tcllibc legs all completed in the clone.
- CAVEAT recorded: the first attempt (clone under the deep agent-scratchpad path)
failed at checkout with windows MAX_PATH 'Filename too long' on the modpod
template trees - a clean checkout of this repo on windows needs a SHALLOW base
path and/or git core.longpaths=true (same MAX_PATH class as the known
project.new-outdir trap). Verified from C:/Users/<u>/AppData/Local/Temp/pkverify
with -c core.longpaths=true.
- Cold-build log oddity diagnosed as BENIGN and then removed at source: zig 0.16's
build_runner prints a 'failed command:' block for any step whose result_stderr is
nonempty EVEN ON SUCCESS (build_runner.zig prints error/warning messages when
result_stderr.len > 0 regardless of result). Our zipfs_mkzip/zipfs_mkimg call
echoes and wrapfiletofile's octet count went to stderr, so uncached (cold) runs
showed four alarming-but-successful 'failed command' blocks (warm runs fewer -
cached steps don't re-run). The informational prints now go to stdout (or are
removed); a rebuild shows zero 'failed command' occurrences with PASS.
- With this, every Acceptance item is met: clean-checkout + punk-getzig-pinned-zig
build (this increment), recovered+rebased patch set with the G-103 gate policy
and behaviour matrix (earlier increments), both-VCS tracking + samplesuite1/
vendorbuild reconciliation, bin/AGENTS.md naming policy + punk-getzig rename
(original increments). Ready for the achieved flip on user confirmation.

4
src/buildsuites/suite_tcl90/tools/wrapfiletofile.zig

@ -70,7 +70,9 @@ pub fn main(init: std.process.Init.Minimal) !void {
fatal("Unable to read '{s}': {s}", .{ input_file_path, @errorName(err) });
};
defer arena.free(input_data);
std.debug.print("inputfile - Read {d} octets.\n", .{input_data.len});
//no informational print here: std.debug.print writes to stderr, and zig 0.16's
//build_runner reports any step with nonempty stderr under a misleading
//"failed command:" block even on success. Quiet on success, loud on error.
var output_file = std.Io.Dir.cwd().createFile(io, output_file_path, .{}) catch |err| {
fatal("Unable to open '{s}': {s}", .{ output_file_path, @errorName(err) });

111
src/buildsuites/suite_tcl90/tools/zipfs_mkimg.tcl

@ -1,55 +1,58 @@
#JMN 2024
#A simple wrapper to call the 'zipfs mkimg' (tcl::zipfs::mkimg) command via commandline arguments.
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages)
#
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]"
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>? ?-infile <explicit_prepend_file>?"
set arglist $::argv
puts stderr "====> '$arglist'"
#error 42
if {![llength $arglist]} {
puts stderr $usage
exit 1
}
if {[llength $arglist] %2 != 0} {
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'"
puts stderr $usage
exit 2
}
set known_opts [list -outfile -indir -strip -password -infile]
dict for {k v} $arglist {
switch -exact -- $k {
-outfile - -indir - -strip - -password - -infile {}
default {
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts"
exit 3
}
}
}
set defaults [dict create\
-strip ""\
-password ""\
]
set opts [dict merge $defaults $arglist]
if {![dict exists $opts -outfile]} {
puts stderr "$script_title error: Missing -outfile <zipfilename>"
exit 4
}
if {![dict exists $opts -indir]} {
puts stderr "$script_title error: Missing -indir <folder>"
exit 5
}
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]] [file normalize [dict get $opts -strip]] [dict get $opts -password]]
if {[dict exists $opts -infile]} {
lappend callargs [file normalize [dict get $opts -infile]]
}
puts stderr "$script_title call 'tcl::zipfs::mkimg $callargs'"
if {[catch {
tcl::zipfs::mkimg {*}$callargs
} errM]} {
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkimg $callargs'\n $errM"
exit 6
}
#JMN 2024
#A simple wrapper to call the 'zipfs mkimg' (tcl::zipfs::mkimg) command via commandline arguments.
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages)
#
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]"
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>? ?-infile <explicit_prepend_file>?"
set arglist $::argv
#informational arglist echo goes to stdout if wanted - stderr output makes zig build
#report the (successful) step with a misleading "failed command:" block (0.16
#build_runner prints that whenever result_stderr is nonempty, success or not)
puts stdout "====> '$arglist'"
#error 42
if {![llength $arglist]} {
puts stderr $usage
exit 1
}
if {[llength $arglist] %2 != 0} {
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'"
puts stderr $usage
exit 2
}
set known_opts [list -outfile -indir -strip -password -infile]
dict for {k v} $arglist {
switch -exact -- $k {
-outfile - -indir - -strip - -password - -infile {}
default {
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts"
exit 3
}
}
}
set defaults [dict create\
-strip ""\
-password ""\
]
set opts [dict merge $defaults $arglist]
if {![dict exists $opts -outfile]} {
puts stderr "$script_title error: Missing -outfile <zipfilename>"
exit 4
}
if {![dict exists $opts -indir]} {
puts stderr "$script_title error: Missing -indir <folder>"
exit 5
}
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]] [file normalize [dict get $opts -strip]] [dict get $opts -password]]
if {[dict exists $opts -infile]} {
lappend callargs [file normalize [dict get $opts -infile]]
}
puts stdout "$script_title call 'tcl::zipfs::mkimg $callargs'" ;#stdout: stderr makes zig report the successful step as 'failed command'
if {[catch {
tcl::zipfs::mkimg {*}$callargs
} errM]} {
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkimg $callargs'\n $errM"
exit 6
}
exit 0

128
src/buildsuites/suite_tcl90/tools/zipfs_mkzip.tcl

@ -1,65 +1,65 @@
#JMN 2024
#A simple wrapper to call the 'zipfs mkzip' (tcl::zipfs::mkzip) command via commandline arguments.
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages)
#
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]"
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>?"
set arglist $::argv
#puts stderr "====> '$arglist'"
#error 42
if {![llength $arglist]} {
puts stderr $usage
exit 1
}
if {[llength $arglist] %2 != 0} {
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'"
puts stderr $usage
exit 2
}
set known_opts [list -outfile -indir -strip -password]
dict for {k v} $arglist {
switch -exact -- $k {
-outfile - -indir - -strip - -password {}
default {
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts"
exit 3
}
}
}
set defaults [dict create\
]
set opts [dict merge $defaults $arglist]
if {![dict exists $opts -outfile]} {
puts stderr "$script_title error: Missing -outfile <zipfilename>"
exit 4
}
if {![dict exists $opts -indir]} {
puts stderr "$script_title error: Missing -indir <folder>"
exit 5
}
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]]]
if {[dict exists $opts -strip]} {
set opt_strip [dict get $opts -strip]
#avoid extraneous underscore(empty path segment?) in zip archive on windows.
#review - test if trailing slash needed on other platforms
#if {"windows" eq "$::tcl_platform(platform)" && $opt_strip ne "" && [lindex $opt_strip end] ne "\\"} {
# append opt_strip \\
#}
lappend callargs [file normalize $opt_strip]
}
if {[dict exists $opts -password]} {
if {![dict exists $opts -strip]} {
lappend callargs ""
}
lappend callargs [dict get $opts -password]
}
puts stderr "$script_title call 'tcl::zipfs::mkzip $callargs'"
if {[catch {
tcl::zipfs::mkzip {*}$callargs
} errM]} {
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkzip $callargs'\n $errM"
exit 6
}
#JMN 2024
#A simple wrapper to call the 'zipfs mkzip' (tcl::zipfs::mkzip) command via commandline arguments.
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages)
#
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]"
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>?"
set arglist $::argv
#puts stderr "====> '$arglist'"
#error 42
if {![llength $arglist]} {
puts stderr $usage
exit 1
}
if {[llength $arglist] %2 != 0} {
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'"
puts stderr $usage
exit 2
}
set known_opts [list -outfile -indir -strip -password]
dict for {k v} $arglist {
switch -exact -- $k {
-outfile - -indir - -strip - -password {}
default {
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts"
exit 3
}
}
}
set defaults [dict create\
]
set opts [dict merge $defaults $arglist]
if {![dict exists $opts -outfile]} {
puts stderr "$script_title error: Missing -outfile <zipfilename>"
exit 4
}
if {![dict exists $opts -indir]} {
puts stderr "$script_title error: Missing -indir <folder>"
exit 5
}
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]]]
if {[dict exists $opts -strip]} {
set opt_strip [dict get $opts -strip]
#avoid extraneous underscore(empty path segment?) in zip archive on windows.
#review - test if trailing slash needed on other platforms
#if {"windows" eq "$::tcl_platform(platform)" && $opt_strip ne "" && [lindex $opt_strip end] ne "\\"} {
# append opt_strip \\
#}
lappend callargs [file normalize $opt_strip]
}
if {[dict exists $opts -password]} {
if {![dict exists $opts -strip]} {
lappend callargs ""
}
lappend callargs [dict get $opts -password]
}
puts stdout "$script_title call 'tcl::zipfs::mkzip $callargs'" ;#stdout: stderr makes zig report the successful step as 'failed command'
if {[catch {
tcl::zipfs::mkzip {*}$callargs
} errM]} {
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkzip $callargs'\n $errM"
exit 6
}
exit 0
Loading…
Cancel
Save