diff --git a/src/buildsuites/suite_tcl90/build.zig b/src/buildsuites/suite_tcl90/build.zig new file mode 100644 index 00000000..588b9a34 --- /dev/null +++ b/src/buildsuites/suite_tcl90/build.zig @@ -0,0 +1,7 @@ +//build.zig - default-entry shim so plain 'zig build ' 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; diff --git a/src/buildsuites/suite_tcl90/build905.zig b/src/buildsuites/suite_tcl90/build905.zig index 1ed63792..ce47d15f 100644 --- a/src/buildsuites/suite_tcl90/build905.zig +++ b/src/buildsuites/suite_tcl90/build905.zig @@ -44,20 +44,17 @@ var static_build: bool = true; //} comptime { - //const required_zig = "0.14.0-dev.300"; - const required_zig = "0.13.0-dev.8"; + //The suite pin (G-102 acceptance: the recipe records the zig version it is + //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 min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; if (current_zig.order(min_zig) == .lt) { const error_message = - \\Sorry, it looks like your version of zig is too old. :-( - \\ - \\punk tcl requires development build {} - \\ - \\Please download a development ("master") build from - \\ - \\https://ziglang.org/download/ - \\ + \\This recipe is written against zig {} (see README Pinned zig) and + \\does not build with older zigs. bin/punk-getzig fetches the pinned + \\toolchain; https://ziglang.org/download/ hosts releases. \\ ; @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.addArg("-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.addOutputDirectoryArg("critcl-cache"); critcl_run.addArg("-force"); diff --git a/src/buildsuites/suite_tcl90/critcl_zig.config b/src/buildsuites/suite_tcl90/critcl_zig.config index 12af67b5..e38ce851 100644 --- a/src/buildsuites/suite_tcl90/critcl_zig.config +++ b/src/buildsuites/suite_tcl90/critcl_zig.config @@ -1,25 +1,34 @@ -# suite_tcl90 critcl configuration: zig cc as the C toolchain (G-098). -# Overrides critcl's gcc-style defaults; 'zig' is resolved from PATH - the suite -# driver prepends the pinned bin/tools zig dir for the critcl invocation. -# Target is the native windows-gnu triple (matches the suite's tcl runtime ABI). +# suite_tcl90 critcl configuration: zig cc as the C toolchain (G-098, G-102). +# 'zig' is resolved from PATH - the suite recipe prepends the pinned bin/tools zig +# dir for the critcl invocation. Target is the native windows-gnu triple (matches +# 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 -compile zig cc -target x86_64-windows-gnu -c -fPIC -version zig version -link zig cc -target x86_64-windows-gnu -shared -include -I -libinclude -L -object .o -output -o [list $outfile] -optimize -O2 -noassert -DNDEBUG -tclstubs -DUSE_TCL_STUBS -tkstubs -DUSE_TK_STUBS -debug_symbols -g -strip -Wl,-s -link_debug -link_release -embed_manifest -ldoutput -link_preload -sharedlibext .dll + +win32-x86_64-zig platform win32-x86_64 +win32-x86_64-zig compile zig cc -target x86_64-windows-gnu -c -fPIC +win32-x86_64-zig version zig version +win32-x86_64-zig link zig cc -target x86_64-windows-gnu -shared +win32-x86_64-zig include -I +win32-x86_64-zig libinclude -L +win32-x86_64-zig object .o +win32-x86_64-zig output -o [list $outfile] +win32-x86_64-zig optimize -O2 +win32-x86_64-zig noassert -DNDEBUG +win32-x86_64-zig tclstubs -DUSE_TCL_STUBS +win32-x86_64-zig tkstubs -DUSE_TK_STUBS +win32-x86_64-zig debug_symbols -g +win32-x86_64-zig strip -Wl,-s +win32-x86_64-zig link_debug +win32-x86_64-zig link_release +win32-x86_64-zig embed_manifest +win32-x86_64-zig ldoutput +win32-x86_64-zig link_preload +win32-x86_64-zig sharedlibext .dll