fix(crystal): install stdlib at $ORIGIN-relative path so the compiler can find it #61

Merged
alex merged 2 commits from pi/issue60-1792337721250 into master 2026-10-18 15:43:50 +00:00

Fixes #60

The Crystal binary resolves its stdlib and libgc relative to its own location ($ORIGIN/../share/crystal/src and $ORIGIN/../lib/crystal). Since the binary is copied to /usr/local/bin, it looks in /usr/local/share/crystal/src — but the Containerfile placed the stdlib at /usr/share/crystal, so the compiler always failed with Error: can't find file 'prelude', which agents reported as "the Crystal stdlib is missing in this sandbox".

Changes

  • Copy the stdlib to /usr/local/share/crystal and libgc to /usr/local/lib/crystal, matching the binary's $ORIGIN-relative lookup paths.
  • Add a build-time smoke test (crystal run of a one-liner printing "stdlib ok") so a broken stdlib fails the image build instead of surfacing later in agent runs.

Verification

  • Reproduced the failure locally with the old layout (can't find file 'prelude').
  • Confirmed that with the fixed layout, crystal --version, crystal run, and crystal build all succeed using the exact binaries/files copied by the Containerfile.
Fixes #60 The Crystal binary resolves its stdlib and libgc **relative to its own location** (`$ORIGIN/../share/crystal/src` and `$ORIGIN/../lib/crystal`). Since the binary is copied to `/usr/local/bin`, it looks in `/usr/local/share/crystal/src` — but the Containerfile placed the stdlib at `/usr/share/crystal`, so the compiler always failed with `Error: can't find file 'prelude'`, which agents reported as "the Crystal stdlib is missing in this sandbox". ## Changes - Copy the stdlib to `/usr/local/share/crystal` and libgc to `/usr/local/lib/crystal`, matching the binary's `$ORIGIN`-relative lookup paths. - Add a build-time smoke test (`crystal run` of a one-liner printing "stdlib ok") so a broken stdlib fails the image build instead of surfacing later in agent runs. ## Verification - Reproduced the failure locally with the old layout (`can't find file 'prelude'`). - Confirmed that with the fixed layout, `crystal --version`, `crystal run`, and `crystal build` all succeed using the exact binaries/files copied by the Containerfile.
alex merged commit a5f136e40a into master 2026-10-18 15:43:50 +00:00
alex deleted branch pi/issue60-1792337721250 2026-10-18 15:43:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
dependencies
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/runner-image!61
No description provided.