Migrate from Spago 0.21.0 to Spago 1.0.3#63
Migrate from Spago 0.21.0 to Spago 1.0.3#63FranklinChen wants to merge 1 commit intoexercism:mainfrom
Conversation
Replace Dhall configuration with spago.yaml using registry-based package set 73.0.0. Update Docker image and test runner for Spago 1.0 compatibility. Key changes: - Dockerfile: node:22-bookworm-slim (Spago 1.0.3 needs node:sqlite), documented dependencies, npm cache cleanup - bin/run.sh: rewrite package name to match pre-compiled lockfile for --offline --pure mode, HOME=/tmp for read-only Docker, sanitize Spago 1.0 output (strip stack traces, new preamble format) - pre-compiled: spago.yaml replaces dhall files - Test examples: spago.yaml, regenerated expected_results.json Companion PR needed in exercism/purescript. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
|
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our guardians team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/guardians) |
|
Companion track PR: exercism/purescript#322 |
There was a problem hiding this comment.
Pull request overview
Migrates the PureScript test-runner tooling from Spago 0.21 (Dhall) to Spago 1.0.3 (YAML + Registry package set), updating the Docker runtime and runner scripts to support fully sandboxed execution.
Changes:
- Replace
spago.dhall/packages.dhallwithspago.yamlacrosspre-compiled/and all test examples (registry package set73.0.0). - Update Docker image to Node 22 (bookworm) and adjust build steps for Spago 1.
- Update runner scripts/output sanitization and regenerate expected test outputs for Spago 1 formatting.
Reviewed changes
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Dockerfile | Switch to Node 22 image; update dependency installation and precompiled project install step. |
| .dockerignore | Update ignored precompiled artifacts list for Docker build context. |
| bin/run.sh | Update runner to Spago 1 workflow (spago.yaml, --offline --pure, lockfile usage) and revise output sanitization. |
| bin/run-tests.sh | Update test harness to discover spago.yaml projects instead of spago.dhall. |
| bin/update-tests.sh | Reword script intent for YAML-based configs (currently no-op). |
| pre-compiled/spago.yaml | New Spago 1 YAML config for the precompiled dependency workspace. |
| pre-compiled/spago.dhall | Remove legacy Dhall config. |
| pre-compiled/packages.dhall | Remove legacy package-set Dhall reference. |
| pre-compiled/package.json | Bump spago devDependency to ^1.0.3. |
| tests/example-all-fail/spago.yaml | New Spago 1 YAML config for the test example. |
| tests/example-all-fail/spago.dhall | Remove legacy Dhall config. |
| tests/example-all-fail/packages.dhall | Remove legacy package-set Dhall reference. |
| tests/example-all-fail/expected_results.json | Update expected failure output to match Spago 1 sanitized output. |
| tests/example-partial-fail/spago.yaml | New Spago 1 YAML config for the test example. |
| tests/example-partial-fail/spago.dhall | Remove legacy Dhall config. |
| tests/example-partial-fail/packages.dhall | Remove legacy package-set Dhall reference. |
| tests/example-partial-fail/expected_results.json | Update expected failure output to match Spago 1 sanitized output. |
| tests/example-syntax-error/spago.yaml | New Spago 1 YAML config for the test example. |
| tests/example-syntax-error/spago.dhall | Remove legacy Dhall config. |
| tests/example-syntax-error/packages.dhall | Remove legacy package-set Dhall reference. |
| tests/example-syntax-error/expected_results.json | Update expected compiler error output to match Spago 1 formatting. |
| tests/example-empty-file/spago.yaml | New Spago 1 YAML config for the test example. |
| tests/example-empty-file/spago.dhall | Remove legacy Dhall config. |
| tests/example-empty-file/packages.dhall | Remove legacy package-set Dhall reference. |
| tests/example-empty-file/expected_results.json | Update expected compiler error output to match Spago 1 formatting. |
| tests/example-success/spago.yaml | New Spago 1 YAML config for the test example. |
| tests/example-success/spago.dhall | Remove legacy Dhall config. |
| tests/example-success/packages.dhall | Remove legacy package-set Dhall reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| COPY pre-compiled pre-compiled/ | ||
| RUN cd pre-compiled \ | ||
| && npm install \ | ||
| && npx spago install \ |
There was a problem hiding this comment.
Dockerfile comment says dependencies are “pre-compiled” and runtime reuses pre-compiled/output and pre-compiled/.spago, but the build stage now only runs npx spago install. If spago install doesn’t produce output/, the runtime cp -R -p pre-compiled/output in bin/run.sh will fail and you’ll lose the intended cache/precompile behavior (or potentially fail in stricter shells). Consider adding an explicit dependency build step (e.g., Spago’s deps-only build) or otherwise ensuring output/ is generated during image build.
| && npx spago install \ | |
| && npx spago install \ | |
| && npx spago build --deps-only \ |
|
Companion track PR: exercism/purescript#323 (replaces #322) |
| # sed -e "s/pre-compiled/${slug}/" < "${project_dir}/spago.dhall" > "${exercise_dir}/spago.dhall" | ||
| cp "${project_dir}/packages.dhall" "${exercise_dir}/packages.dhall" | ||
| # Test examples use a minimal dependency set, not the full pre-compiled one. | ||
| # Only update if the test's spago.yaml workspace section needs to change. |
There was a problem hiding this comment.
Is this loop supposed to do anything?
|
This PR cannot be reopened as it was force pushed |
Summary
node:20-bullseye-slimtonode:22-bookworm-slim(Spago 1.0.3 requires Node.js >= 22.5.0 fornode:sqlite)bin/run.shfor Spago 1.0 compatibility in Docker's--read-only --network noneenvironmentexpected_results.jsonfor all 5 test examples with Spago 1.0 output formatDetails
Docker changes
node:sqlitebuilt-in module, requiring Node.js >= 22.5.0npm cache clean --forceto reduce image sizerun.sh changes
spago.yamlhas its package name rewritten to "pre-compiled" to match the pre-compiled lockfile, enabling--puremode (no registry access needed)HOME=/tmp: Spago's SQLite cache needs a writable directory; Docker runs with--read-onlyso we redirect HOME to the tmpfs mount--offline --pure: Fully sandboxed execution with no network or registry accessConfiguration
spago.yamlreplacesspago.dhall+packages.dhallin pre-compiled/ and all test examples73.0.0(for PureScript >=0.15.15 <0.16.0)Companion PR
Requires companion PR in exercism/purescript (will link once created).
Test plan
bin/run-tests-in-docker.sh)--platform linux/amd64--network none --read-onlyconstraints🤖 Generated with Claude Code