diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-19 13:37:05 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-19 13:37:05 +0000 |
| commit | 6526f7dac704d73d615159e834af8f83a26ab8d7 (patch) | |
| tree | c571b4120613b640005d35d717e85cc3794b742e /AGENTS | |
| parent | 3214d942145b7221078b37ce7b9e37907ad61b9d (diff) | |
build: use Perl for native runtime build dependencies
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS')
| -rw-r--r-- | AGENTS/ARCH.md | 9 | ||||
| -rw-r--r-- | AGENTS/TESTING.md | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/AGENTS/ARCH.md b/AGENTS/ARCH.md index b146996..f6e5d30 100644 --- a/AGENTS/ARCH.md +++ b/AGENTS/ARCH.md @@ -36,7 +36,8 @@ uses C++ promotions, except that / always returns pseudocode REAL. The compiler emits native executables by default and textual `.ll` IR with `-S`. Initial configuration must explicitly select `CPSC_RUN_MODE=PATH`, `EMBEDDED` or `NONE` (no default). All modes need LLVM/Clang/LLD 23 development libraries, -Python 3.9+ and native C/C++ development files to build; NONE supports both outputs. +Perl with core modules (including Compress::Zlib and JSON::PP) and native C/C++ +development files to build; NONE supports both outputs. The following commands use Debian/Ubuntu's versioned compiler names: ```bash @@ -180,7 +181,7 @@ does not replace an imported target's explicit `.dll.a` path. `NativeCompiler` clones the module, sets the host triple/DataLayout and emits a PIC object. Clang Driver constructs one platform linker job, which is dispatched to embedded LLD without launching a process. `cmake/NativeCompiler.cmake` runs -`tools/driver/prepare-native-runtime.py` at configure time to capture the build +`tools/driver/prepare-native-runtime.pl` at configure time to capture the build toolchain's link inputs and compress them into generated C++ data. Native compilation extracts startup objects, runtime archives and system link interfaces to a temporary directory; GNU linker scripts are relocated. macOS embeds SDK library stubs, not @@ -276,7 +277,7 @@ source downloads remain available. The Linux compiler and plugin jobs use Ubuntu 24.04 x86_64; the macOS compiler job uses a macOS 15 arm64 runner, and Windows uses Windows Server 2025 x86_64. All four check out the push SHA and run independently. All three -compiler jobs use LLVM/Clang/LLD 23, Python (build-time), Release and EMBEDDED settings, Pandoc, and the +compiler jobs use LLVM/Clang/LLD 23, Perl (build-time), Release and EMBEDDED settings, Pandoc, and the existing `release` target. Linux obtains its toolchain from apt.llvm.org; macOS uses Homebrew's LLVM 23 and builds matching static LLD with the helper above. Windows uses `msys2/setup-msys2@v2` with MINGW64, MSYS2 LLVM/Clang packages, explicit native compiler and LLVM paths, and the @@ -290,7 +291,7 @@ Node.js 22, `npm ci --ignore-scripts` and `npm run package`, then checks VSIX contents. Each job retains its checked package as a separate Actions artifact for one day, failing if the package is missing. Compiler jobs enable -BUILD_TESTING, install Perl for the tests and run all CTest cases with the push SHA as seed before +BUILD_TESTING and run all CTest cases with the push SHA as seed before their package smoke checks and uploads. Failed tests retain inputs and logs as Actions artifacts for 14 days; test summaries appear even on failure. See TESTING.md. The publish job downloads only the current run's `nightly-*` artifacts and checks diff --git a/AGENTS/TESTING.md b/AGENTS/TESTING.md index af66e93..585689a 100644 --- a/AGENTS/TESTING.md +++ b/AGENTS/TESTING.md @@ -1,6 +1,6 @@ # Compiler testing -Compiler tests live in `tests/`; run instructions are in its README. `BUILD_TESTING` defaults to OFF and needs only Perl (core modules) when enabled. Python remains a compiler build dependency. CMake builds independent C++ reference executables with the same host ABI and registers one CTest entry per `case.json`, plus harness and generator checks. +Compiler tests live in `tests/`; run instructions are in its README. `BUILD_TESTING` defaults to OFF and uses the compiler build's Perl interpreter with core modules when enabled. CMake builds independent C++ reference executables with the same host ABI and registers one CTest entry per `case.json`, plus harness and generator checks. Each case directory has `program.cps` and `case.json`. Suite i adds `expected.txt`, optional `input.txt`, input files under `files/`, expected text-file contents under `expected-files/`, and independently written trace notes with human-review status. Suite ii adds `reference.cc` and `generate.pl`; the generator accepts seed and random count, emits the total record count followed by one ASCII record per line, and each program emits one result line per record. Suite iii stores an `errors` list of `{reason: regex, line: integer}` in its manifest. A cause and its line must appear on the same error diagnostic. EOF after a final newline is the following source line. @@ -16,7 +16,7 @@ Suite i and ii cases may list `objects` as `{source, output}` pairs, for example Optional manifest fields are `exit_code` for expected program status (default 0) and `timeout` for execution/reference seconds (default 30; file-intensive cases use 180). Compilation has a 120-second timeout. Do not make a known compiler defect pass by changing the expectation, adding an exemption or comparing only a permissive substring of program output. -The Perl runner (`tests/run.pl`) accepts `--case`, `--cpsc`, `--run-mode`, `--perl`, `--reference`, `--seed`, `--count` and `--results`. CMake provides paths, including executable suffixes, and caches `CPSC_TEST_SEED` and `CPSC_TEST_COUNT`. The default seed is HEAD read at execution, not configure time. CI overrides it with the checked-out push SHA. Both native and enabled runner paths are tested independently; NONE skips only runner execution. Windows CI must configure a native `PERL_EXECUTABLE` (Strawberry Perl) because MSYS perl cannot read the native `D:/` drive paths CMake passes. +The Perl runner (`tests/run.pl`) accepts `--case`, `--cpsc`, `--run-mode`, `--perl`, `--reference`, `--seed`, `--count` and `--results`. CMake provides paths, including executable suffixes, and caches `CPSC_TEST_SEED` and `CPSC_TEST_COUNT`. The default seed is HEAD read at execution, not configure time. CI overrides it with the checked-out push SHA. Both native and enabled runner paths are tested independently; NONE skips only runner execution. Windows builds and tests must configure a native `PERL_EXECUTABLE` (Strawberry Perl) because MSYS perl cannot read the native `D:/` drive paths CMake passes. All commands run without a shell and retain their exact argv, working directory, input, status and output under the case result directory. Each execution path has its own files. Existing results for that case are replaced on re-run. Avoid concurrent runs of the same case into the same results directory. Tests compare CRLF-normalized bytes without stripping whitespace. A case may add `expected-stderr.txt` for runtime diagnostics, compared exactly; without it, successful compilation and ordinary programs require empty stderr. |
