Browse Source

G-102: build.zig entry shim; deterministic critcl target; zig pin in comptime gate

Three deltas surfaced by the PATH-scrubbed clean-checkout demonstration:

- build.zig: default-entry re-export of build905.zig's build so the documented
  plain 'zig build stage|bootstrap' works from the tracked suite dir (the
  recipe keeps its versioned filename; staged flows still invoke it via
  --build-file).
- critcl_zig.config + recipe: settings move under an EXPLICIT target
  (win32-x86_64-zig) and the tcllibc step passes -target win32-x86_64-zig.
  critcl otherwise chooses its build target by probing PATH for compilers -
  with a gcc visible the config defaults engaged (why G-098's flow worked),
  but the scrubbed environment fell back to critcl's builtin msvc 'cl'
  target and all 25 accelerator modules failed with "couldn't execute cl".
  Verified green in BOTH environments (scrubbed and normal PATH).
- build905.zig comptime gate: the stale 0.13-dev minimum becomes the actual
  suite pin (0.16.0) with a message pointing at punk-getzig and the README
  (acceptance: the recipe records the zig version it is written against).

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
acc6ab409c
  1. 7
      src/buildsuites/suite_tcl90/build.zig
  2. 22
      src/buildsuites/suite_tcl90/build905.zig
  3. 55
      src/buildsuites/suite_tcl90/critcl_zig.config

7
src/buildsuites/suite_tcl90/build.zig

@ -0,0 +1,7 @@
//build.zig - default-entry shim so plain 'zig build <step>' works from this
//directory (the bootstrap-flow invocations in the README). The recipe itself
//lives in build905.zig - a deliberately VERSIONED name (the staged flows invoke
//it explicitly via --build-file, and a future suite may carry more than one
//recipe file). build.zig.zon beside this file serves both entry points.
const recipe = @import("build905.zig");
pub const build = recipe.build;

22
src/buildsuites/suite_tcl90/build905.zig

@ -44,20 +44,17 @@ var static_build: bool = true;
//} //}
comptime { comptime {
//const required_zig = "0.14.0-dev.300"; //The suite pin (G-102 acceptance: the recipe records the zig version it is
const required_zig = "0.13.0-dev.8"; //written against). The recipe is 0.16-API and does not build under 0.14/0.15;
//punk-getzig materializes the pinned toolchain (see README Pinned zig).
const required_zig = "0.16.0";
const current_zig = builtin.zig_version; const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
if (current_zig.order(min_zig) == .lt) { if (current_zig.order(min_zig) == .lt) {
const error_message = const error_message =
\\Sorry, it looks like your version of zig is too old. :-( \\This recipe is written against zig {} (see README Pinned zig) and
\\ \\does not build with older zigs. bin/punk-getzig fetches the pinned
\\punk tcl requires development build {} \\toolchain; https://ziglang.org/download/ hosts releases.
\\
\\Please download a development ("master") build from
\\
\\https://ziglang.org/download/
\\
\\ \\
; ;
@compileError(std.fmt.comptimePrint(error_message, .{min_zig})); @compileError(std.fmt.comptimePrint(error_message, .{min_zig}));
@ -2298,6 +2295,11 @@ pub fn build(b: *std.Build) !void {
critcl_run.addFileArg(b.path("../critcl/main.tcl")); critcl_run.addFileArg(b.path("../critcl/main.tcl"));
critcl_run.addArg("-config"); critcl_run.addArg("-config");
critcl_run.addFileArg(b.path("critcl_zig.config")); critcl_run.addFileArg(b.path("critcl_zig.config"));
//pin the build target to the config's explicit section: critcl otherwise
//GUESSES its target by probing PATH for compilers - with a gcc visible the
//config defaults engaged, but a scrubbed environment fell back to critcl's
//builtin msvc 'cl' target and never used the zig cc settings (G-102 finding).
critcl_run.addArgs(&.{ "-target", "win32-x86_64-zig" });
critcl_run.addArg("-cache"); critcl_run.addArg("-cache");
_ = critcl_run.addOutputDirectoryArg("critcl-cache"); _ = critcl_run.addOutputDirectoryArg("critcl-cache");
critcl_run.addArg("-force"); critcl_run.addArg("-force");

55
src/buildsuites/suite_tcl90/critcl_zig.config

@ -1,25 +1,34 @@
# suite_tcl90 critcl configuration: zig cc as the C toolchain (G-098). # suite_tcl90 critcl configuration: zig cc as the C toolchain (G-098, G-102).
# Overrides critcl's gcc-style defaults; 'zig' is resolved from PATH - the suite # 'zig' is resolved from PATH - the suite recipe prepends the pinned bin/tools zig
# driver prepends the pinned bin/tools zig dir for the critcl invocation. # dir for the critcl invocation. Target is the native windows-gnu triple (matches
# Target is the native windows-gnu triple (matches the suite's tcl runtime ABI). # the suite's tcl runtime ABI).
#
# The settings live under an EXPLICIT target, win32-x86_64-zig, and the recipe
# invokes critcl with '-target win32-x86_64-zig': critcl otherwise chooses its
# build target by PROBING the environment for compilers, which made the selection
# depend on what happened to be on PATH (a visible gcc landed on the config
# defaults; a scrubbed environment fell back to critcl's builtin msvc 'cl'
# target and never used these settings - G-102 finding).
platform win32-x86_64 platform win32-x86_64
compile zig cc -target x86_64-windows-gnu -c -fPIC
version zig version win32-x86_64-zig platform win32-x86_64
link zig cc -target x86_64-windows-gnu -shared win32-x86_64-zig compile zig cc -target x86_64-windows-gnu -c -fPIC
include -I win32-x86_64-zig version zig version
libinclude -L win32-x86_64-zig link zig cc -target x86_64-windows-gnu -shared
object .o win32-x86_64-zig include -I
output -o [list $outfile] win32-x86_64-zig libinclude -L
optimize -O2 win32-x86_64-zig object .o
noassert -DNDEBUG win32-x86_64-zig output -o [list $outfile]
tclstubs -DUSE_TCL_STUBS win32-x86_64-zig optimize -O2
tkstubs -DUSE_TK_STUBS win32-x86_64-zig noassert -DNDEBUG
debug_symbols -g win32-x86_64-zig tclstubs -DUSE_TCL_STUBS
strip -Wl,-s win32-x86_64-zig tkstubs -DUSE_TK_STUBS
link_debug win32-x86_64-zig debug_symbols -g
link_release win32-x86_64-zig strip -Wl,-s
embed_manifest win32-x86_64-zig link_debug
ldoutput win32-x86_64-zig link_release
link_preload win32-x86_64-zig embed_manifest
sharedlibext .dll win32-x86_64-zig ldoutput
win32-x86_64-zig link_preload
win32-x86_64-zig sharedlibext .dll

Loading…
Cancel
Save