Skip to content

Commit 2897a5d

Browse files
fix: prewarm perl runtime for nightly refresh
1 parent fad1dd8 commit 2897a5d

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Released: TBA. [Diff](https://github.com/locutusjs/locutus/compare/v3.0.32...mai
4545

4646
- Restored PHP-style scalar coercion for `strtotime()` numeric input and aligned `bcscale()` with modern PHP getter/setter semantics, including shared default `bcmath` scale across `bc*` helpers.
4747
- Hardened nightly Perl upstream-surface refresh by feeding the discovered namespace catalog through Docker stdin instead of a giant `perl -e` argv payload, and improved `runInDocker()` diagnostics when a container exits non-zero without stderr.
48+
- Marked Perl upstream-surface discovery as Docker-backed so refresh/enumeration pre-pulls `perl:5.40` instead of letting the first `docker run` fail on implicit pull output in nightly CI.
4849

4950
## v3.0.31
5051

docs/prompts/LOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,3 +3160,23 @@ LLMs log key learnings, progress, and next steps in one `### Iteration ${increme
31603160
- Key learnings:
31613161
- The nightly failure signature matched a transport problem, not a catalog or triage problem: local Perl discovery still worked, but the GitHub runner path was too dependent on a huge `argv` payload surviving unchanged.
31623162
- Tightening error messages in shared infra is worth doing while fixing one concrete workflow; otherwise the next runner-only failure again collapses into an unhelpful `exit code 1`.
3163+
3164+
### Iteration 156
3165+
3166+
2026-03-28
3167+
3168+
- **Area: Maintenance (Nightly parity follow-up)**
3169+
- Plan:
3170+
- Verify whether the Perl stdin hardening actually fixed the nightly failure, and if not, isolate the remaining runner-only difference instead of guessing.
3171+
- Prefer a minimal follow-up once the real root cause is visible.
3172+
- Progress:
3173+
- Re-ran `Nightly Parity` manually on the post-merge head and confirmed it still failed inside `Refresh live upstream snapshots`.
3174+
- Pulled the failed log and identified the real root cause: `scripts/upstream-surface-enumeration.ts` only pre-pulls Docker images for languages whose handlers set `discoverUsesDocker`, and `test/parity/lib/languages/perl.ts` incorrectly declared `discoverUsesDocker: false`.
3175+
- Updated the Perl handler to `discoverUsesDocker: true`, so refresh/enumeration now pre-pulls `perl:5.40` through `ensureDockerImage()` instead of letting the first `docker run` emit implicit pull output on stderr.
3176+
- Added a regression assertion in `test/util/upstream-surface.vitest.ts` to keep Perl marked as Docker-backed for upstream-surface discovery.
3177+
- Validation:
3178+
- `corepack yarn exec vitest run test/util/upstream-surface.vitest.ts`
3179+
- `corepack yarn refresh:upstream-surface perl`
3180+
- Key learnings:
3181+
- The stdin hardening was still worth keeping, but it solved the wrong layer first; the actual nightly break was the handler metadata that opted Perl out of image prewarming.
3182+
- For runtime-discovered languages, `discoverUsesDocker` is effectively part of the CI contract, not just optional metadata.

test/parity/lib/languages/perl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const perlHandler: LanguageHandler = {
175175
upstreamSurface: {
176176
discover: discoverPerlUpstreamSurface,
177177
discoverMode: 'live',
178-
discoverUsesDocker: false,
178+
discoverUsesDocker: true,
179179
discoverNamespaceCatalog: discoverPerlUpstreamNamespaceCatalog,
180180
getLocutusEntry: (func) => ({
181181
namespace: func.category,

test/util/upstream-surface.vitest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,12 @@ describe('upstream surface inventory', () => {
10121012
expect(isLanguageSupported('swift')).toBe(false)
10131013
})
10141014

1015+
it('marks Perl upstream-surface discovery as Docker-backed so enumeration pre-pulls the runtime image', async () => {
1016+
const { perlHandler } = await import('../parity/lib/languages/perl.ts')
1017+
1018+
expect(perlHandler.upstreamSurface?.discoverUsesDocker).toBe(true)
1019+
})
1020+
10151021
it('includes source functions even when they do not define examples', () => {
10161022
const root = mkdtempSync(join(tmpdir(), 'locutus-upstream-surface-'))
10171023
const srcDir = join(root, 'src')

0 commit comments

Comments
 (0)