Browse Source

G-128: re-vendor punkres 0.3.1 (platform-aware usage pin - linux CLI suite green)

Upstream f0af880 (f97eda2 + version-pin fixup): the first native linux test
run (WSL Ubuntu 24.04, zig 0.16.0, route-b of the e2e) surfaced the usage
pin's hardcoded punkres.exe argv0; the pin now splices EXENAME comptime and
the suite is green on BOTH platforms (windows 33/33 verified here from the
vendored tree; linux run recorded in the goal detail). bin/punkres.exe
rebuilt via the tool step (0.3.1).

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 day ago
parent
commit
0bee025ec4
  1. 4
      src/tools/punkres/PROVENANCE.md
  2. 2
      src/tools/punkres/build.zig.zon
  3. 4
      src/tools/punkres/src/punkres.zig
  4. 22
      src/tools/punkres/src/punkres_test.zig

4
src/tools/punkres/PROVENANCE.md

@ -8,8 +8,8 @@
the punkshell repo root. That is a layout convention, not a requirement - if
no checkout is present there, clone the remote to that location; the Vendored
state commit below identifies the exact upstream state in any clone.
- Vendored state: commit `dca8634f190d8e9e800637211d666951737909da` (punkres
v0.3.0, 2026-07-29; upstream working tree clean at copy time)
- Vendored state: commit `f0af880e1a1e2f27897b71bd63aa27a80ba0355e` (punkres
v0.3.1, 2026-07-29; upstream working tree clean at copy time)
- Vendored: 2026-07-29 for goal G-128 (see
`goals/G-128-portable-pe-resource-stamping.md`)
- Lineage: first-party punkshell tool, written 2026-07-29 for G-128 - no

2
src/tools/punkres/build.zig.zon

@ -1,6 +1,6 @@
.{
.name = .punkres,
.version = "0.3.0",
.version = "0.3.1",
.fingerprint = 0x663d2953305aee5d,
.minimum_zig_version = "0.16.0",
.paths = .{""},

4
src/tools/punkres/src/punkres.zig

@ -40,10 +40,10 @@ var g_io: Io = undefined;
//stdout with honestly-probed flags - set at entry (see stdout_file)
var g_stdout: Io.File = undefined;
pub const VERSION = "0.3.0";
pub const VERSION = "0.3.1";
pub const HEADER =
\\# PUNKRES 0.3.0 -- portable PE resource stamper (punkshell G-128)
\\# PUNKRES 0.3.1 -- portable PE resource stamper (punkshell G-128)
\\
;

22
src/tools/punkres/src/punkres_test.zig

@ -178,17 +178,17 @@ test "print usage" {
var tmp = initTestDir();
defer tmp.cleanup();
const args = [_][]const u8{"nonsense"};
//argv0 renders platform-dependently (punkres.exe / punkres) - the pin
//splices EXENAME so the exact-output check holds on windows AND linux
const output = mainres.HEADER ++
\\
\\Usage:
\\
\\ punkres.exe info [-porcelain] <pefile>
\\ punkres.exe list [-porcelain] <pefile>
\\ punkres.exe extract-ico [-group <id|name>] <pefile> <out.ico>
\\ punkres.exe set-icon [-o <outfile>] [-group <id|name>]
\\ [-allow-file-relative-shift] [-allow-opaque-overlay]
\\ [-drop-opaque-overlay] [-strip-signature] <pefile> <icon.ico>
\\ punkres.exe version
"\nUsage:\n\n" ++
" " ++ EXENAME ++ " info [-porcelain] <pefile>\n" ++
" " ++ EXENAME ++ " list [-porcelain] <pefile>\n" ++
" " ++ EXENAME ++ " extract-ico [-group <id|name>] <pefile> <out.ico>\n" ++
" " ++ EXENAME ++ " set-icon [-o <outfile>] [-group <id|name>]\n" ++
" [-allow-file-relative-shift] [-allow-opaque-overlay]\n" ++
" [-drop-opaque-overlay] [-strip-signature] <pefile> <icon.ico>\n" ++
" " ++ EXENAME ++ " version\n" ++
\\
\\ set-icon replaces ALL RT_ICON/RT_GROUP_ICON resources with the images
\\ of <icon.ico> (ids 1..N under the first pre-existing group's name and
@ -210,7 +210,7 @@ test "version" {
var tmp = initTestDir();
defer tmp.cleanup();
const args = [_][]const u8{"version"};
try expectExecute(&args, 0, "punkres 0.3.0\n", tmp);
try expectExecute(&args, 0, "punkres 0.3.1\n", tmp);
}
test "set-icon -group renames the group; later stamps adopt it (convergent)" {

Loading…
Cancel
Save