Skip to content

php: the GNU basename, and json_parser's source is .tab.c - #721

Merged
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd
Nov 5, 2026
Merged

staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

Two stops from the first mk install, both cheap.

The rule said mkdir -p {basename -d $target}', which is the Plan 9 idiom for a dirname -- and inside apexp-sh the union puts APExp's own /bin first, so basename is GNU coreutils' and has no -d. mk then reported the failure of the compile rather than of the mkdir, naming the victim again. The rule runs no external command now: the directory list is known statically, mkdir -p is idempotent, and one exec per compile is nothing beside 513 runs of pcc. Recorded as a build-system rule, since a command name inside apexp-sh is whatever the union resolves it to and Plan 9's own flags are the ones most likely to be missing.

`no recipe to make ext/json/json_parser.6' had a better answer than expected: ext/json's parser is bison-generated and the generated file SHIPS IN THE TARBALL as json_parser.tab.c, so the object upstream calls json_parser.lo is built from a source whose name does not match it. One explicit rule covers it.

The useful half is what the check found rather than what it fixed. All 513 objects were resolved against the vendored tree and this was the only name that does not, so no bison and no re2c are needed anywhere in this port: json_scanner.c and php_json_scanner_defs.h are shipped too, alongside the four Zend parsers and scanners and the 4.2MB zend_vm_execute.h. A question that could have cost two more build tools cost one grep.

Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs

Two stops from the first mk install, both cheap.

The rule said `mkdir -p `{basename -d $target}', which is the Plan 9
idiom for a dirname -- and inside apexp-sh the union puts APExp's own
/bin first, so basename is GNU coreutils' and has no -d.  mk then
reported the failure of the compile rather than of the mkdir, naming
the victim again.  The rule runs no external command now: the
directory list is known statically, mkdir -p is idempotent, and one
exec per compile is nothing beside 513 runs of pcc.  Recorded as a
build-system rule, since a command name inside apexp-sh is whatever
the union resolves it to and Plan 9's own flags are the ones most
likely to be missing.

`no recipe to make ext/json/json_parser.6' had a better answer than
expected: ext/json's parser is bison-generated and the generated file
SHIPS IN THE TARBALL as json_parser.tab.c, so the object upstream
calls json_parser.lo is built from a source whose name does not match
it.  One explicit rule covers it.

The useful half is what the check found rather than what it fixed.
All 513 objects were resolved against the vendored tree and this was
the only name that does not, so no bison and no re2c are needed
anywhere in this port: json_scanner.c and php_json_scanner_defs.h are
shipped too, alongside the four Zend parsers and scanners and the
4.2MB zend_vm_execute.h.  A question that could have cost two more
build tools cost one grep.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit 72f93fe into main Nov 5, 2026
1 check passed
Sign up for free to 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