Repository navigation
spawn hook: translate an in-image chdir: to its host twin (#152) - #153
Merged
Merged
Conversation
ronaldtse
force-pushed
the
fix/152-spawn-chdir
branch
from
November 8, 2026 15:00
38a7bb2 to
638e7b6
Compare
A spawn carrying an embedded chdir: option died ENOENT in the child before the materialized exec could run — the hook materialized the exec target but the chdir passed through to a VFS path the kernel never sees. The standing case: the 1.18.4 metanorma payload's render-time sass compile (isodoc 3.7.12 moved the style compile to render; the strict font manifest read's substitution re-keys the font header and forces it), where sass-embedded's Open3 spawns the in-image dart with chdir into the in-image lib/sass/compiler dir. tebako-packages/ metanorma#124's linux/windows legs die on exactly that (the macOS legs never recompile — the full ISO font set installs there, so the shipped css serves). Both hooks (POSIX + win32) now rewrite eargp->chdir_dir through the NEW tfs verb tebako_fs_exec_materialize_dir: a home-layout mount answers the whole-tree twin; any other mount extracts the subtree into the per-process dl tmpdir. The verb is weak-externed — a runtime linked against a link unit predating it passes the chdir through untranslated (the pre-#152 honest ENOENT). The tfs side is tebako's own PR (the verb + the c_api.h declaration + exports.txt). The patch applies clean to ruby 4.0.7 (git-apply-checked); the regenerated hunks are git-native.
ronaldtse
force-pushed
the
fix/152-spawn-chdir
branch
from
November 8, 2026 15:00
638e7b6 to
fd8ec04
Compare
This was referenced Nov 8, 2026
ronaldtse
pushed a commit
that referenced
this pull request
Nov 11, 2026
…completion) The #153 fix landed on the 4.0 series only — the 3.1/3.2/3.3/3.4 patches never carried the chdir arm, so a 3.x runtime's spawn with chdir: into the VFS still dies ENOENT (the metanorma 1.18.5 html-xml legs on ruby 3.3, tebako-runtime-ruby#333). The arm is #153's own text verbatim (the weak-extern discipline included); the regeneration is mechanical — the current patch applied to the pristine upstream, the arm inserted, the diff regenerated — never a hand-edited hunk. tools/apply proves each series on its latest version (3.1.7 / 3.2.11 / 3.3.9 / 3.4.9), and each patched tree carries the verb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #152.
What
Both spawn hooks (POSIX + win32) translate an in-image
chdir:option through the new tfs verbtebako_fs_exec_materialize_dir: a home-layout mount answers the whole-tree twin, any other mount extracts the subtree into the per-process dl tmpdir. Weak-externed — a runtime linked against an older link unit passes the chdir through untranslated (the pre-#152 honest ENOENT, no link break).Why
The exec-target materialization alone is not enough: a spawn with an in-image
chdir:dies in the child (ENOENT on the VFS path) before the materialized exe runs. The standing case is the 1.18.4 metanorma payload's render-time sass compile — sass-embedded'sOpen3.popen3(*Sass::CLI::COMMAND, '--embedded', chdir: __dir__)chdirs into the in-imagelib/sass/compiler/. Exercised for the first time because isodoc 3.7.12 moved the style compile to render time, triggered by the strict font manifest read (metanorma#595) substituting a font and re-keying the scss font header. tebako-packages/metanorma#124's linux/windows legs die on exactly this; the macOS legs never recompile (the full ISO font set installs there).The chain this rides
tebako_fs_exec_materialize_dir+ thec_api.hdeclaration +exports.txt— its own PR in the product queue.v*tag) → the runtime factory rebuild → the runtime line the metanorma payload pins.Verification
process.c(git-apply-checked; the hunks are git-native regenerated, not hand-counted).exec_materialize_dir_extracts_the_subtree_for_a_non_home_mount) proves the verb's contract: the subtree lands in the dl tmpdir once per process per path, a file answers ENOTDIR, an uncovered path ENOENT.