Skip to content

patches: msys variant of the tebako spawn hook (fix the target_file shadowing) - #103

Merged
ronaldtse merged 1 commit into
mainfrom
fix/spawn-msys-shadow
Aug 27, 2026
Merged

patches: msys variant of the tebako spawn hook (fix the target_file shadowing)#103
ronaldtse merged 1 commit into
mainfrom
fix/spawn-msys-shadow

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Fixes the reason the windows argv bridge (merged in #102) had no effect on the packed-mn acceptance: the spawn patch never reached msys builds at all.

Root cause (proven, not hypothesized)

PatchSelection#filter_platform (tools/lib/tfs/patch_selection.rb:135-138) implements the msys shadow rule: a base patch is dropped when an _msys-suffixed sibling targets the same file (by +++ b/ header). Lines 3.2/3.3/3.4 carry process_c_clock_guard_msys.patch (target: process.c), which shadows the base process_c_tebako_spawn.patch (target: process.c).

Local proof with the repo's own tooling:

3.3.12 msys pass2 set: 19 patches; the only process.c toucher is
process_c_clock_guard_msys — process_c_tebako_spawn: DROPPED
(linux-gnu keeps it, as expected)

So windows runtimes have never contained the spawn hook — not even the pre-#102 no-op stub. The packed-mn#251 windows acceptance on runtime 0.16.13 failed with the byte-identical jing error (Unable to access jarfile A:/__tfs__/...jing-20091111.jar) because there was nothing in the binary to rewrite the token.

Fix

Add process_c_tebako_spawn_msys.patch (byte-identical to the base — the POSIX half is #ifndef _WIN32 and compiles out; the win32 argv bridge compiles in) plus the manifest entry on the three affected lines (3.2, 3.3, 3.4). Lines 3.1 and 4.0 have no clock_guard_msys, so the base patch already lands there — verified, no change.

Validation

  • Selection proof (this branch), all five lines, msys pass2 vs linux-gnu:
    • 3.1.7 / 4.0.6: msys carries base (unchanged — no shadow)
    • 3.2.11 / 3.3.12 / 3.4.10: msys now carries process_c_tebako_spawn_msys; POSIX unchanged
  • tools/lint OK on 3.1.7 / 3.2.11 / 3.3.12 / 3.4.10 / 4.0.6 (lint checks each patch independently — necessary, not sufficient)
  • Scenario composition proof (the gate that actually models the build): tools/apply <v> --platform msys --pass 2 succeeds for 3.2.11 / 3.3.12 / 3.4.10, and the composed msys process.c contains the bridge (tfs_spawn_prepare, tebako_path_is_embedded, tebako_fs_exec_materialize at the bridge sites), composing cleanly with clock_guard_msys.

Follow-ups

  • Release chain after merge: tag v0.2.30 → factory 0.16.14 re-cut → packed-mn#251 re-pin → windows acceptance re-run.
  • A lint gate asserting "no base patch is silently shadowed by an _msys sibling without an explicit decision" is queued as debt (the trap this PR fixes was silent by construction).

…hadowing)
process_c_clock_guard_msys (lines 3.2/3.3/3.4) shadows the base
process_c_tebako_spawn under PatchSelection's msys rule (a base patch
is dropped when an _msys sibling targets the same file), so windows
runtimes have never carried the spawn hook — including the argv bridge
merged in #102. Add the msys variant (identical content; the POSIX
half compiles out under _WIN32) so the bridge actually lands on msys.
3.1/4.0 have no clock_guard patch and keep the base, verified via
PatchSelection for 3.1.7/3.2.11/3.3.12/3.4.10/4.0.6 + scenario
composition proofs (tools/apply --platform msys --pass 2).
@ronaldtse
ronaldtse merged commit a111d32 into mainAug 27, 2026
42 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ronaldtse@tebako-ci