php: run a first conformance program on 5.6, 7.4 and 8.4 #730
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!730
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/727-php-first-program"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #727
Refs #64
Task
Step 2 of #64:
torb build --target linux-phpwrites one PHP file that runs on PHP 5.6, 7.4 and 8.4 with the output, standard error and exit code of the C and VM legs (docs/design/PHP.md section 6, slice 1).What and why
Two commits, as the issue asks:
feat(target): theArchitecture.Phpcase instd/coreandTargetArchitecture.Phpwith thelinux-phptarget, so the seed's own compiler can learn the name first.feat(php): the back end.compiler/src/backend/php/{emit,body,type,natives,writer}.trb: functions and calls, integers of every width exceptUInt64, booleans, records and tuples, text,printandexit, withgotoblocks and a depth counter on recursive functions. Overflow, zero divisor,MIN / -1, shift and stack-limit panics use the messages and exit code 101 of the C leg.runtime/php/{core,int64}.php: the five startup guards, the output buffer, the panic and exit path, the helpers.compiler/src/cli/build.trb: the target needs no--emit-cand no C compiler.tests/conformance/php_first.trband four smallphp-*.trbprograms with expected files,php.allow,tools/conformance.sh --php,tools/php-guards.sh(forges the machine each guard checks)..forgejo/actions/phpbuilds the pinned PHP 5.6.40, 7.4.33 and 8.4.27 from the php.net tarballs (SHA-256 checked); the jobconformance-phpruns the leg and the guard test.docs/design/PHP.md(row 1 done, "What slice 1 left out", section 7 figures, shift semantics now "panics like C", nointdivpolyfill) anddocs/tooling/torb-build.mdwith itsskills/copy.UInt64, floats and everything past the slice-1 constructs are reported as unsupported with a finding and nothing is written.
Test
The machine that wrote this has no
torb, PHP or C compiler, so the back end is verified in CI only: theconformance-phpjob (leg on 5.6, 7.4, 8.4 plustools/php-guards.sh),sh tools/gates.sh a,torb format --check,torb docs check.sh tools/check-commits.sh 79b35cb9is clean locally.0cff94d8649c7f186ed69c7f186ed6a0dfff27e8a0dfff27e81143876713114387671336ca76f01136ca76f: tier A format --check, body.trbCI red on
36ca76f:ci / tier A (linux-x64)fails onformat --check:./compiler/src/backend/php/body.trbwould change (1 of 1708 files). Runtorb formaton that file and push.ci / gatesfails only because tier A failed;conformance (PHP 5.6, 7.4 and 8.4)is green.bd928fdcde36684a6e30Approved at
36684a6.conformance (PHP 5.6, 7.4 and 8.4)(runsphp_first, the fourphp-*programs,bit-shift-panicandstack-overflowon all three interpreters, plustools/php-guards.sh), tier A (the earlierformat --checkfailure on36ca76fis fixed), tier B, gates, pdisc, commit messages.MIN / -1, shift and stack-limit panics use the C leg's messages and exit 101. The guards exit 1, and each is forged inphp-guards.sh. Unsupported constructs (UInt64, floats, multiple entries) are reported and nothing is written.Architecture.Phpandlinux-phptarget first and the back end after, as the issue asks.evalor shell calls.PHP.md(row 1 done, "What slice 1 left out", section 7),torb-build.md,core.md,target-capabilities.mdandtorb-check.mdare updated, with theskills/copies. pdisc is green.Non-blocking:
runtime/php/core.phpsays the stack limit of 100000 is "chosen, not measured", while the issue asked for a figure set by running the deepest program on 5.6.stack-overflow.trbpasses on all three interpreters under 256M, so this holds. If the limit is ever measured, record the number in section 7.