Browse Source

G-096: vqtcl/vlerq removed from suite; 'suite.tcl test' runs the Tcl core testsuite; tm names synced

vqtcl was an old-tclkit experiment with no confirmed public upstream - wiring,
helper module, staging and docs removed (future tclkit work: TEMP_REFERENCE/
metakit + KitCreator). New 'test' action runs tests/all.tcl on the suite-built
static shell with -testargs passthrough; verified assocd/util/lindex: 557 run,
357 passed, 200 constraint-skipped (no C test commands in a release shell),
0 failed. install-libraries tm filenames synced to the tree's provided
versions (tcltest-2.5.11, http-2.10.2, platform-1.1.1) - the 2024-era names
made 'package require tcltest' fail on a filename/provide version conflict.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
1664e9ba91
  1. 13
      src/buildsuites/suite_tcl90/README.md
  2. 30
      src/buildsuites/suite_tcl90/build905.zig
  3. 2
      src/buildsuites/suite_tcl90/build_tclthread/build_tclthread.zig
  4. 80
      src/buildsuites/suite_tcl90/build_vqtcl/build_vqtcl_shared.zig
  5. 40
      src/buildsuites/suite_tcl90/suite.tcl

13
src/buildsuites/suite_tcl90/README.md

@ -1,9 +1,11 @@
# suite_tcl90 - zig build of the Tcl 9.0 windows runtime (G-096) # suite_tcl90 - zig build of the Tcl 9.0 windows runtime (G-096)
The first real, tracked buildsuite: reproducibly builds `tclsh90s.exe` (static) and The first real, tracked buildsuite: reproducibly builds `tclsh90s.exe` (static) and
`tclsh90szip.exe` (self-contained zipfs) plus the thread/vfs/vlerq extension dlls from `tclsh90szip.exe` (self-contained zipfs) plus the thread/vfs extension dlls from
a fresh Tcl core-9-0-branch checkout, using zig only (no MS toolchain, per the project a fresh Tcl core-9-0-branch checkout, using zig only (no MS toolchain, per the project
toolchain policy). toolchain policy). (vqtcl/vlerq was removed 2026-07-20 - an old-tclkit experiment;
future tclkit investigation has TEMP_REFERENCE/metakit and TEMP_REFERENCE/KitCreator
as reference material.)
Everything transient lives under `src/buildsuites/_build/suite_tcl90/` (VCS-ignored via Everything transient lives under `src/buildsuites/_build/suite_tcl90/` (VCS-ignored via
the repo's existing `_build` globs): staged recipe, source checkouts, zig cache, and the the repo's existing `_build` globs): staged recipe, source checkouts, zig cache, and the
@ -15,7 +17,7 @@ the repo's existing `_build` globs): staged recipe, source checkouts, zig cache,
tclsh suite.tcl clean tclsh suite.tcl clean
See `suite.tcl`'s header for options (`-zig`, `-optimize`, `-tclbranch`, `-refresh`, See `suite.tcl`'s header for options (`-zig`, `-optimize`, `-tclbranch`, `-refresh`,
`-vqtcl-source`, `-steps`). Zig resolution: `-zig` > `$env(PUNK_ZIG)` > the pinned `-steps`). Zig resolution: `-zig` > `$env(PUNK_ZIG)` > the pinned
toolchain at `bin/tools/zig-x86_64-windows-0.14.1/zig.exe` > `zig` on PATH. toolchain at `bin/tools/zig-x86_64-windows-0.14.1/zig.exe` > `zig` on PATH.
## Pinned zig ## Pinned zig
@ -39,9 +41,9 @@ producing stale/duplicate artifacts at link time).
- `build905.zig` - the zig recipe (verbatim lineage copy - see Lineage). Expects its - `build905.zig` - the zig recipe (verbatim lineage copy - see Lineage). Expects its
build root's SIBLING dirs to hold sources (`../tcl905`, `../zlib`, `../tclthread`, build root's SIBLING dirs to hold sources (`../tcl905`, `../zlib`, `../tclthread`,
`../tclvfs`, `../vqtcl`), which is why `suite.tcl` stages it into `../tclvfs`), which is why `suite.tcl` stages it into
`_build/suite_tcl90/build/` rather than building in place. `_build/suite_tcl90/build/` rather than building in place.
- `build_libtommath/ build_zlib/ build_tclvfs/ build_vqtcl/ build_tclthread/` - helper - `build_libtommath/ build_zlib/ build_tclvfs/ build_tclthread/` - helper
build modules. The four tcl-dependent helpers take the tcl source dir as their build modules. The four tcl-dependent helpers take the tcl source dir as their
`tcldir` param (a hardcoded `../tcl90/generic` include, marked "todo - fix" upstream, `tcldir` param (a hardcoded `../tcl90/generic` include, marked "todo - fix" upstream,
was fixed when these copies were made). `build_libtommath.zig` still carries the was fixed when these copies were made). `build_libtommath.zig` still carries the
@ -65,7 +67,6 @@ producing stale/duplicate artifacts at link time).
| `zlib` | the tcl checkout's own `compat/zlib` (version-matched, includes contrib/minizip) | copied by suite.tcl | | `zlib` | the tcl checkout's own `compat/zlib` (version-matched, includes contrib/minizip) | copied by suite.tcl |
| `tclthread` | fossil `https://core.tcl-lang.org/thread` | trunk | | `tclthread` | fossil `https://core.tcl-lang.org/thread` | trunk |
| `tclvfs` | fossil `https://core.tcl-lang.org/tclvfs` | trunk | | `tclvfs` | fossil `https://core.tcl-lang.org/tclvfs` | trunk |
| `vqtcl` | local dir only (vlerq 4.1 by jcw; no public upstream confirmed) | `-vqtcl-source` |
Checkouts under `_build` use `FOSSIL_HOME=<stage>` so the user's global fossil config Checkouts under `_build` use `FOSSIL_HOME=<stage>` so the user's global fossil config
db records nothing (stage-local `_fossil` db, deleted with `clean`). db records nothing (stage-local `_fossil` db, deleted with `clean`).

30
src/buildsuites/suite_tcl90/build905.zig

@ -10,7 +10,8 @@ const build_zlib = @import("build_zlib/build_zlib.zig").build_zlib;
const tclvfs_shared = @import("build_tclvfs/build_tclvfs_shared.zig"); const tclvfs_shared = @import("build_tclvfs/build_tclvfs_shared.zig");
// ******************** // ********************
const vqtcl_shared = @import("build_vqtcl/build_vqtcl_shared.zig"); //vqtcl/vlerq removed from the suite (old-tclkit experiment; see note near the former
//compile site and TEMP_REFERENCE/metakit + TEMP_REFERENCE/KitCreator for future work)
const build_tclthread = @import("build_tclthread/build_tclthread.zig").build_tclthread; const build_tclthread = @import("build_tclthread/build_tclthread.zig").build_tclthread;
@ -1749,12 +1750,10 @@ pub fn build(b: *std.Build) !void {
tclsh_exe.step.dependOn(&tclvfs_compile.step); // review tclsh_exe.step.dependOn(&tclvfs_compile.step); // review
//////////////////// ////////////////////
if (target.result.os.tag == .windows) { //vqtcl/vlerq removed from the suite (user 2026-07-20): it was an attempt at old
const vqtcl_compile = try vqtcl_shared.build_vqtcl(tcl_source_folder, "../vqtcl", b, target, optimize, finalstublib); //tclkit support and its source has no confirmed public upstream. When tclkit
const build_vqtcl_step = b.step("build-vqtcl", "build vqtcl shared library"); //builds are investigated, TEMP_REFERENCE/metakit and TEMP_REFERENCE/KitCreator
build_vqtcl_step.dependOn(&vqtcl_compile.step); //in the punkshell repo are the reference material.
tclsh_exe.step.dependOn(&vqtcl_compile.step); //review - find better dependOn for this?
}
tclsh_exe.linkLibC(); tclsh_exe.linkLibC();
@ -1828,7 +1827,7 @@ pub fn build(b: *std.Build) !void {
}); });
install_libraries.dependOn(&cookiejar_install.step); install_libraries.dependOn(&cookiejar_install.step);
const tm_http_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/http/http.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "http-2.10.0.tm" })); const tm_http_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/http/http.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "http-2.10.2.tm" }));
tm_http_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package http 2.10.0 as a Tcl Module--" }).step); tm_http_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package http 2.10.0 as a Tcl Module--" }).step);
install_libraries.dependOn(&tm_http_install.step); install_libraries.dependOn(&tm_http_install.step);
//opt/*.tcl //opt/*.tcl
@ -1856,11 +1855,11 @@ pub fn build(b: *std.Build) !void {
tm_msgcat_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package msgcat 1.7.1 as a Tcl Module--" }).step); tm_msgcat_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package msgcat 1.7.1 as a Tcl Module--" }).step);
install_libraries.dependOn(&tm_msgcat_install.step); install_libraries.dependOn(&tm_msgcat_install.step);
const tm_tcltest_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/tcltest/tcltest.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "tcltest-2.5.8.tm" })); const tm_tcltest_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/tcltest/tcltest.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "tcltest-2.5.11.tm" }));
tm_tcltest_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package tcltest 2.5.8 as a Tcl Module--" }).step); tm_tcltest_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package tcltest 2.5.8 as a Tcl Module--" }).step);
install_libraries.dependOn(&tm_tcltest_install.step); install_libraries.dependOn(&tm_tcltest_install.step);
const tm_platform_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/platform/platform.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "platform-1.0.19.tm" })); const tm_platform_install = b.addInstallFileWithDir(b.path(tcl_source_folder ++ "/library/platform/platform.tcl"), .prefix, b.pathJoin(&.{ module_install_dir_rel, tcl_dot_version, "platform-1.1.1.tm" }));
tm_platform_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package platform 1.0.19 as a Tcl Module--" }).step); tm_platform_install.step.dependOn(&b.addSystemCommand(&.{ "echo", "\n--Installing package platform 1.0.19 as a Tcl Module--" }).step);
install_libraries.dependOn(&tm_platform_install.step); install_libraries.dependOn(&tm_platform_install.step);
@ -1913,15 +1912,8 @@ pub fn build(b: *std.Build) !void {
_ = make_vfs_root.addCopyFile(tclvfs_compile.getEmittedBin(), "base/lib/vfs1.4.2/tcl9vfs142.dll"); _ = make_vfs_root.addCopyFile(tclvfs_compile.getEmittedBin(), "base/lib/vfs1.4.2/tcl9vfs142.dll");
// ***************************** // *****************************
//we are putting vqtcl in the zipkit root - *not* a metakit - as we're loading vlerq dynamically and not using standard tclkit startup method //vqtcl/vlerq zip payload removed with the rest of the vqtcl wiring (user 2026-07-20;
_ = try vqtcl_shared.vfsadd_vqtcl_files(tcl_source_folder, "../vqtcl", b, make_vfs_root); //old-tclkit experiment - see TEMP_REFERENCE/metakit + TEMP_REFERENCE/KitCreator).
//hack
if (target.result.os.tag == .windows) {
//_ = make_vfs_root.addCopyFile(vqtcl_compile.getEmittedBin(), "base/lib/vqtcl4.1/tcl9vlerq41.dll");
} else {
//unix/linux
}
//pass make_vfs_root to build_tclvfs //pass make_vfs_root to build_tclvfs

2
src/buildsuites/suite_tcl90/build_tclthread/build_tclthread.zig

@ -16,7 +16,7 @@ pub fn build_tclthread(comptime tcldir: []const u8, comptime subdir: []const u8,
const wrapfilecmd = b.addExecutable(.{ const wrapfilecmd = b.addExecutable(.{
.name = "wrapfiletofile", .name = "wrapfiletofile",
.root_source_file = b.path("tools/wrapfiletofile.zig"), .root_source_file = b.path("tools/wrapfiletofile.zig"),
.target = b.host, .target = b.graph.host,
}); });
const uuidcmd_step = b.addRunArtifact(wrapfilecmd); const uuidcmd_step = b.addRunArtifact(wrapfilecmd);
uuidcmd_step.addArgs(&.{ uuidcmd_step.addArgs(&.{

80
src/buildsuites/suite_tcl90/build_vqtcl/build_vqtcl_shared.zig

@ -1,80 +0,0 @@
const std = @import("std");
const fs = std.fs;
const vqtcl_dotversion = "4.1";
const vqtcl_nodotversion = "41";
pub fn vfsadd_vqtcl_files(comptime tcldir: []const u8, comptime subdir: []const u8, b: *std.Build, vfswrite: *std.Build.Step.WriteFile) !*std.Build.Step.WriteFile {
//_ = tcldir;
//recursive copy
//_ = make_vfs_root.addCopyDirectory(b.path(tcl_source_folder ++ "/../tclvfs/library"), "base/lib/vfs1.4.2", .{});
_ = vfswrite.addCopyDirectory(b.path(tcldir ++ "/" ++ subdir ++ "/library"), b.pathJoin(&.{ "base", "lib", "vqtcl" ++ vqtcl_dotversion }), .{});
return vfswrite;
}
pub fn build_vqtcl(comptime tcldir: []const u8, comptime subdir: []const u8, b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, stublib: *std.Build.Step.Compile) !*std.Build.Step.Compile {
const lib = b.addSharedLibrary(.{
.name = "tcl9vlerq" ++ vqtcl_nodotversion,
.target = target,
.optimize = optimize,
});
//_ = stublib;
var flags = std.ArrayList([]const u8).init(b.allocator);
defer flags.deinit();
//try flags.appendSlice(&.{ "-Wall", "-O3" });
//try flags.appendSlice(&.{ "-Wall", "-O2", "-fomit-frame-pointer" });
try flags.appendSlice(&.{ "-O3", "-fomit-frame-pointer" });
try flags.appendSlice(&.{
"-DPACKAGE_NAME=\"vfs\"",
"-DPACKAGE_TARNAME=\"vfs\"",
"-DPACKAGE_VERSION=\"" ++ vqtcl_dotversion ++ "\"",
"-DPACKAGE_STRING=\"vfs " ++ vqtcl_dotversion ++ "\"",
"-DPACKAGE_BUGREPORT=\"\"",
"-DPACKAGE_URL=\"\"",
"-DTCL_CFG_OPTIMIZED=1",
"-DUSE_TCL_STUBS=1",
"-DZIPFS_BUILD=1",
"-DTCL_WIDE_INT_TYPE=long long",
});
// "-DTCL_MEM_DEBUG=1", //define for all or none of modules that are linked together
// "-DTCL_MAJOR_VERSION=9",
//"-static-libgcc", //argument unused - review
var sources = std.ArrayList([]const u8).init(b.allocator);
try sources.append(subdir ++ "/generic/vlerq.c");
lib.addIncludePath(b.path(subdir));
lib.addIncludePath(b.path(subdir ++ "/generic"));
lib.addIncludePath(b.path(subdir ++ "/win")); //header for MSVC only - possibly not needed here - unless zig build can use it?
lib.addIncludePath(b.path(tcldir ++ "/generic"));
lib.addIncludePath(b.path(tcldir ++ "/generic"));
if (target.result.os.tag == .windows) {
lib.addIncludePath(b.path(tcldir ++ "/win"));
} else {
lib.addIncludePath(b.path(tcldir ++ "/unix"));
}
lib.addCSourceFiles(.{
.files = sources.items,
.flags = flags.items,
});
lib.linkLibrary(stublib);
lib.linkLibC();
// no resource file - todo - make one?
//lib.addWin32ResourceFile(.{
// .file = b.path(subdir ++ "/win/tclvfs.rc"),
// .flags = &.{
// "-DPACKAGE_MAJOR=1",
// "-DPACKAGE_MINOR=4",
// "-DPACKAGE_VERSION=" ++ vqtcl_dotversion,
// "-DDOTVERSION=" ++ vqtcl_dotversion,
// "-DCOMMAVERSION=" ++ vqtcl_dotversion,
// "-DVERSION=" ++ vqtcl_nodotversion,
// },
//}); //ignored for non-windows targets
// COMMAVERSION??? VERSION???
b.installArtifact(lib);
return lib; //static library
}

40
src/buildsuites/suite_tcl90/suite.tcl

@ -4,14 +4,13 @@
#and smoke-test the result. #and smoke-test the result.
# #
#Usage: tclsh suite.tcl build ?options? #Usage: tclsh suite.tcl build ?options?
# tclsh suite.tcl test ?-testargs {tcltest args}? (e.g -testargs {-file "assocd.test util.test"})
# tclsh suite.tcl clean # tclsh suite.tcl clean
#Options: #Options:
# -zig <path> zig executable (default: $env(PUNK_ZIG), else 'zig' on PATH) # -zig <path> zig executable (default: $env(PUNK_ZIG), else 'zig' on PATH)
# -optimize <mode> Debug|ReleaseSafe|ReleaseFast|ReleaseSmall (default ReleaseFast) # -optimize <mode> Debug|ReleaseSafe|ReleaseFast|ReleaseSmall (default ReleaseFast)
# -tclbranch <branch> tcl branch/tag to open (default core-9-0-branch) # -tclbranch <branch> tcl branch/tag to open (default core-9-0-branch)
# -refresh <0|1> fossil update existing source checkouts (default 0) # -refresh <0|1> fossil update existing source checkouts (default 0)
# -vqtcl-source <dir> local vqtcl source dir (no public upstream confirmed;
# default C:/buildtcl/2024zig/vqtcl)
# -steps <list> zig build steps (default {install install-libraries make-zipfs}) # -steps <list> zig build steps (default {install install-libraries make-zipfs})
# #
#The build area lives entirely under src/buildsuites/_build (VCS-ignored via the #The build area lives entirely under src/buildsuites/_build (VCS-ignored via the
@ -39,16 +38,16 @@ set fossildir [file normalize [file join $env(HOME) .fossils]]
#-- options --------------------------------------------------------------- #-- options ---------------------------------------------------------------
set action [lindex $argv 0] set action [lindex $argv 0]
if {$action ni {build clean}} { if {$action ni {build test clean}} {
puts stderr "usage: tclsh suite.tcl build|clean ?options? (see header)" puts stderr "usage: tclsh suite.tcl build|test|clean ?options? (see header)"
exit 2 exit 2
} }
array set opt { array set opt {
-optimize ReleaseFast -optimize ReleaseFast
-tclbranch core-9-0-branch -tclbranch core-9-0-branch
-refresh 0 -refresh 0
-vqtcl-source C:/buildtcl/2024zig/vqtcl
-steps {install install-libraries make-zipfs} -steps {install install-libraries make-zipfs}
-testargs {}
} }
#zig resolution: -zig option > PUNK_ZIG env > the suite's pinned toolchain under #zig resolution: -zig option > PUNK_ZIG env > the suite's pinned toolchain under
#bin/tools (zig 0.14.1 official release - hosted on punkbin, minisign-verified; #bin/tools (zig 0.14.1 official release - hosted on punkbin, minisign-verified;
@ -72,6 +71,24 @@ if {$action eq "clean"} {
exit 0 exit 0
} }
if {$action eq "test"} {
#Exercise the Tcl core test suite on the suite-built static shell (all.tcl in the
#staged checkout's tests dir; pass tcltest selection via -testargs). all.tcl's
#exit code reflects test failures on modern tcl; output is streamed regardless.
set exe [file join $stage out bin tclsh90s.exe]
set testsdir [file join $stage tcl905 tests]
if {![file exists $exe]} {fail "no built shell at $exe - run 'suite.tcl build' first"}
if {![file isdirectory $testsdir]} {fail "no tcl tests dir at $testsdir - run 'suite.tcl build' first"}
log "tcl testsuite on $exe [expr {[llength $opt(-testargs)] ? $opt(-testargs) : "(full suite)"}]"
set savedpwd [pwd]
cd $testsdir
set rc [catch {exec $exe all.tcl {*}$opt(-testargs) >@stdout 2>@stderr} err]
cd $savedpwd
if {$rc} {fail "tcl testsuite reported failure: $err"}
log "tcl testsuite run complete (see output above for any FAILED lines)"
exit 0
}
#-- fossil environment ---------------------------------------------------- #-- fossil environment ----------------------------------------------------
#Checkout registrations go to a stage-local config db, not the user's global one #Checkout registrations go to a stage-local config db, not the user's global one
#(agent-memory: fossil scratchpad registry pollution). Clones are still shared. #(agent-memory: fossil scratchpad registry pollution). Clones are still shared.
@ -109,7 +126,7 @@ proc fossil_source {name url branch dir} {
set builddir [file join $stage build] set builddir [file join $stage build]
log "staging recipe -> $builddir" log "staging recipe -> $builddir"
file mkdir $builddir file mkdir $builddir
foreach item {build905.zig build_libtommath build_zlib build_tclvfs build_vqtcl build_tclthread src tools} { foreach item {build905.zig build_libtommath build_zlib build_tclvfs build_tclthread src tools} {
file delete -force [file join $builddir $item] file delete -force [file join $builddir $item]
file copy [file join $suiteroot $item] $builddir file copy [file join $suiteroot $item] $builddir
} }
@ -125,15 +142,8 @@ if {![file isdirectory $zlibdir]} {
log "staging zlib from tcl compat/zlib" log "staging zlib from tcl compat/zlib"
file copy [file join $stage tcl905 compat zlib] $zlibdir file copy [file join $stage tcl905 compat zlib] $zlibdir
} }
#vqtcl: local source only (vlerq 4.1 by jcw - no public upstream confirmed) #vqtcl/vlerq: removed from the suite (user 2026-07-20) - old-tclkit experiment with no
set vqdir [file join $stage vqtcl] #confirmed public upstream. Future tclkit work: TEMP_REFERENCE/metakit + KitCreator.
if {![file isdirectory $vqdir]} {
if {![file isdirectory $opt(-vqtcl-source)]} {
fail "vqtcl source not found at '$opt(-vqtcl-source)' (set -vqtcl-source)"
}
log "staging vqtcl from $opt(-vqtcl-source)"
file copy $opt(-vqtcl-source) $vqdir
}
#-- generated files a fresh tcl checkout lacks (normally configure/prepare products) -- #-- generated files a fresh tcl checkout lacks (normally configure/prepare products) --
set tcldir [file join $stage tcl905] set tcldir [file join $stage tcl905]

Loading…
Cancel
Save