Skip to content

Migrate from Spago 0.21.0 to Spago 1.0.3#323

Merged
IsaacG merged 6 commits intoexercism:mainfrom
FranklinChen:migrate-spago-v1
Feb 13, 2026
Merged

Migrate from Spago 0.21.0 to Spago 1.0.3#323
IsaacG merged 6 commits intoexercism:mainfrom
FranklinChen:migrate-spago-v1

Conversation

@FranklinChen
Copy link
Contributor

Summary

  • Migrate all 32 exercises and template from Spago 0.21.0 (Dhall config) to Spago 1.0.3 (YAML + Registry package set 73.0.0)
  • Rewrite CI scripts for Spago 1.0 compatibility
  • Update CI workflow to use Node.js 22 + spago 1.0.3
  • Add st dependency for mutable state/arrays

Details

Configuration migration

  • Deleted: spago.dhall, packages.dhall, .solution.dhall from template and all 32 exercises
  • Created: spago.yaml for each, using registry: 73.0.0 package set
  • Updated: .meta/config.json invalidators from ["packages.dhall", "spago.dhall"] to ["spago.yaml"]
  • Updated: top-level config.json invalidator

CI workflow

  • Added setup-node with Node.js 22 (Spago 1.0.3 requires >=22.5.0 for node:sqlite)
  • Spago version: 0.21.0 -> 1.0.3
  • Removed psa (no longer needed with Spago 1.0)

Script rewrites

scripts/ci: Pre-compiles shared dependencies once, then for each exercise:

  • Symlinks .spago/ and node_modules/, copies output/ (preserving timestamps)
  • Copies example solution into src/ (replaces .solution.dhall approach, since Spago 1.0 doesn't support custom source paths)
  • Runs npx spago test --offline

scripts/ci-check: Validates all exercises use identical spago.yaml (stripping the name: field before comparison)

bin/update-exercises.sh: Propagates template spago.yaml to all exercises with appropriate package name

Companion PR

Companion test runner PR: exercism/purescript-test-runner#63

Both PRs should be merged together — the track depends on spago 1.0.3 which the test runner also needs.

Test plan

  • All 32 exercises pass CI (scripts/ci shows 32 ✓ Test succeeded)
  • scripts/ci-check validates consistent spago.yaml across exercises
  • No Dhall files remain in any exercise directory
  • All .meta/config.json invalidators updated
  • No student stub files modified (only config/build files changed)

🤖 Generated with Claude Code

Replace Dhall configuration (spago.dhall, packages.dhall, .solution.dhall)
with spago.yaml using registry-based package set 73.0.0 across all 32
exercises and the template.

Key changes:
- All exercises: spago.yaml replaces dhall files, invalidators updated
- CI workflow: spago 1.0.3, removed psa
- scripts/ci: pre-compile shared deps, copy example solutions to src/
  (replaces .solution.dhall approach since Spago 1.0 has no custom sources)
- scripts/ci-check: compare spago.yaml (stripping name field)
- bin/update-exercises.sh: propagate template spago.yaml to exercises

Companion PR needed in exercism/purescript-test-runner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 9, 2026 05:15
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@github-actions github-actions bot closed this Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Hello 👋 Thanks for your PR.

This repo does not currently have dedicated maintainers. Our cross-track maintainers 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/cross-track-maintainers)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

This is an unmaintained repository.

Cross-track maintainers - feel free to merge.

@FranklinChen
Copy link
Contributor Author

This PR changes the build configuration (Dhall → YAML) but does not change any test logic or test files. Student test results will be identical.

Please add to the merge commit message:

[no important files changed]

@FranklinChen
Copy link
Contributor Author

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the PureScript track exercises/template from Spago 0.21 (Dhall + package-sets) to Spago 1.0.3 (YAML + registry package set), and updates CI tooling/scripts accordingly so all exercises can be built/tested under the new Spago workflow.

Changes:

  • Replace spago.dhall/packages.dhall/.solution.dhall with spago.yaml across the template and all exercises (registry package set 73.0.0).
  • Rewrite CI scripts (scripts/ci, scripts/ci-check) for Spago 1.0 behavior and shared dependency caching.
  • Update GitHub Actions CI to use Node.js 22 and Spago 1.0.3; update invalidators to reference spago.yaml.

Reviewed changes

Copilot reviewed 201 out of 203 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
template/spago.yaml Add Spago v1 YAML project config (registry package set).
template/spago.dhall Remove legacy Spago Dhall config.
template/packages.dhall Remove legacy package-set Dhall pin.
template/package.json Bump spago devDependency to ^1.0.3.
template/.gitignore Update ignores for Spago v1 artifacts (.spago/, spago.lock, .purs-repl).
scripts/ci-check Compare normalized spago.yaml across exercises to enforce a shared package set.
scripts/ci Rewrite CI build/test loop for Spago 1 (shared deps + per-exercise test).
exercises/practice/word-count/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/word-count/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/word-count/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/word-count/.solution.dhall Remove legacy solution-only config.
exercises/practice/word-count/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/word-count/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/triangle/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/triangle/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/triangle/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/triangle/.solution.dhall Remove legacy solution-only config.
exercises/practice/triangle/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/triangle/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/sum-of-multiples/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/sum-of-multiples/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/sum-of-multiples/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/sum-of-multiples/.solution.dhall Remove legacy solution-only config.
exercises/practice/sum-of-multiples/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/sum-of-multiples/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/spiral-matrix/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/spiral-matrix/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/spiral-matrix/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/spiral-matrix/.solution.dhall Remove legacy solution-only config.
exercises/practice/spiral-matrix/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/spiral-matrix/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/scrabble-score/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/scrabble-score/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/scrabble-score/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/scrabble-score/.solution.dhall Remove legacy solution-only config.
exercises/practice/scrabble-score/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/scrabble-score/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/rna-transcription/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/rna-transcription/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/rna-transcription/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/rna-transcription/.solution.dhall Remove legacy solution-only config.
exercises/practice/rna-transcription/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/rna-transcription/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/raindrops/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/raindrops/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/raindrops/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/raindrops/.solution.dhall Remove legacy solution-only config.
exercises/practice/raindrops/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/raindrops/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/phone-number/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/phone-number/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/phone-number/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/phone-number/.solution.dhall Remove legacy solution-only config.
exercises/practice/phone-number/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/phone-number/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/pascals-triangle/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/pascals-triangle/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/pascals-triangle/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/pascals-triangle/.solution.dhall Remove legacy solution-only config.
exercises/practice/pascals-triangle/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/pascals-triangle/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/pangram/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/pangram/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/pangram/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/pangram/.solution.dhall Remove legacy solution-only config.
exercises/practice/pangram/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/pangram/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/meetup/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/meetup/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/meetup/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/meetup/.solution.dhall Remove legacy solution-only config.
exercises/practice/meetup/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/meetup/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/matching-brackets/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/matching-brackets/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/matching-brackets/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/matching-brackets/.solution.dhall Remove legacy solution-only config.
exercises/practice/matching-brackets/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/matching-brackets/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/leap/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/leap/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/leap/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/leap/.solution.dhall Remove legacy solution-only config.
exercises/practice/leap/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/leap/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/largest-series-product/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/largest-series-product/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/largest-series-product/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/largest-series-product/.solution.dhall Remove legacy solution-only config.
exercises/practice/largest-series-product/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/largest-series-product/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/knapsack/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/knapsack/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/knapsack/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/knapsack/.solution.dhall Remove legacy solution-only config.
exercises/practice/knapsack/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/knapsack/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/isogram/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/isogram/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/isogram/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/isogram/.solution.dhall Remove legacy solution-only config.
exercises/practice/isogram/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/isogram/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/hello-world/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/hello-world/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/hello-world/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/hello-world/.solution.dhall Remove legacy solution-only config.
exercises/practice/hello-world/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/hello-world/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/hamming/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/hamming/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/hamming/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/hamming/.solution.dhall Remove legacy solution-only config.
exercises/practice/hamming/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/hamming/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/etl/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/etl/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/etl/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/etl/.solution.dhall Remove legacy solution-only config.
exercises/practice/etl/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/etl/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/difference-of-squares/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/difference-of-squares/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/difference-of-squares/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/difference-of-squares/.solution.dhall Remove legacy solution-only config.
exercises/practice/difference-of-squares/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/difference-of-squares/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/diamond/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/diamond/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/diamond/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/diamond/.solution.dhall Remove legacy solution-only config.
exercises/practice/diamond/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/diamond/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/crypto-square/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/crypto-square/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/crypto-square/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/crypto-square/.solution.dhall Remove legacy solution-only config.
exercises/practice/crypto-square/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/crypto-square/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/collatz-conjecture/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/collatz-conjecture/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/collatz-conjecture/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/collatz-conjecture/.solution.dhall Remove legacy solution-only config.
exercises/practice/collatz-conjecture/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/collatz-conjecture/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/bob/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/bob/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/bob/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/bob/.solution.dhall Remove legacy solution-only config.
exercises/practice/bob/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/bob/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/binary-search/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/binary-search/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/binary-search/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/binary-search/.solution.dhall Remove legacy solution-only config.
exercises/practice/binary-search/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/binary-search/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/atbash-cipher/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/atbash-cipher/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/atbash-cipher/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/atbash-cipher/.solution.dhall Remove legacy solution-only config.
exercises/practice/atbash-cipher/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/atbash-cipher/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/anagram/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/anagram/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/anagram/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/anagram/.solution.dhall Remove legacy solution-only config.
exercises/practice/anagram/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/anagram/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/allergies/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/allergies/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/allergies/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/allergies/.solution.dhall Remove legacy solution-only config.
exercises/practice/allergies/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/allergies/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/all-your-base/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/all-your-base/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/all-your-base/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/all-your-base/.solution.dhall Remove legacy solution-only config.
exercises/practice/all-your-base/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/all-your-base/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/acronym/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/acronym/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/acronym/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/acronym/.solution.dhall Remove legacy solution-only config.
exercises/practice/acronym/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/acronym/.gitignore Update ignores for Spago v1 artifacts.
exercises/practice/accumulate/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/practice/accumulate/spago.dhall Remove legacy Spago Dhall config.
exercises/practice/accumulate/packages.dhall Remove legacy package-set Dhall pin.
exercises/practice/accumulate/.solution.dhall Remove legacy solution-only config.
exercises/practice/accumulate/.meta/config.json Update invalidator to spago.yaml.
exercises/practice/accumulate/.gitignore Update ignores for Spago v1 artifacts.
exercises/concept/annalyns-infiltration/spago.yaml Add per-exercise Spago v1 YAML config.
exercises/concept/annalyns-infiltration/spago.dhall Remove legacy Spago Dhall config.
exercises/concept/annalyns-infiltration/packages.dhall Remove legacy package-set Dhall pin.
exercises/concept/annalyns-infiltration/.solution.dhall Remove legacy solution-only config.
exercises/concept/annalyns-infiltration/.meta/config.json Update invalidator to spago.yaml.
exercises/concept/annalyns-infiltration/.gitignore Update ignores for Spago v1 artifacts.
config.json Update top-level invalidators to spago.yaml.
bin/update-exercises.sh Update propagation script to use template spago.yaml + .gitignore.
.github/workflows/ci.yml Update CI to Node 22 and Spago 1.0.3; remove PSA setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

scripts/ci Outdated
Comment on lines 56 to 59
# Copy node_modules symlink or directory
if [ ! -e node_modules ]; then
ln -s "${build_dir}/node_modules" node_modules
fi
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If node_modules already exists (e.g. from a previous local run), this leaves it in place rather than linking to the shared "${build_dir}/node_modules". That can lead to inconsistent tool versions (including which spago binary npx resolves) and non-reproducible CI behavior. Consider removing/replacing an existing node_modules (directory or symlink) the same way you handle .spago/output.

Copilot uses AI. Check for mistakes.
Comment on lines 3 to 24
dependencies:
- arrays
- console
- datetime
- effect
- either
- enums
- exceptions
- foldable-traversable
- integers
- lists
- maybe
- numbers
- ordered-collections
- partial
- prelude
- psci-support
- strings
- test-unit
- tuples
- unfoldable
- unicode
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions adding an st dependency, but the new template spago.yaml does not include st in package.dependencies. Either add the dependency here (and propagate to exercises) or update the PR description to match what’s actually changing.

Copilot uses AI. Check for mistakes.

- name: Fetch the PureScript compiler
- name: Set up Node.js
uses: actions/setup-node@v4
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For supply-chain security and consistency with the pinned actions/checkout and setup-purescript steps, actions/setup-node should be pinned to a specific commit SHA instead of a mutable @v4 tag.

Suggested change
uses: actions/setup-node@v4
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8

Copilot uses AI. Check for mistakes.
Comment on lines 28 to 31
echo "Fetching and compiling shared dependencies..."
spago --no-psa build --deps-only
npm install
npx spago install
popd > /dev/null || exit
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script says it is “compiling shared dependencies”, but it only runs npm install + spago install. That typically won’t produce a precompiled output/ directory, so the later cp -R -p "${build_dir}/output" . will fail (or each exercise will rebuild deps anyway). Run a spago build --deps-only (or equivalent) in the build_dir after installing dependencies so output/ is created and contains compiled deps.

Copilot uses AI. Check for mistakes.
for config in "$exercises_dir"/*/*/spago.dhall; do
exercise_dir=$(dirname "${config}")
for exercise_dir in "$base_dir"/exercises/*/*; do
[ -d "${exercise_dir}" ] || continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ -d "${exercise_dir}" ] || continue
[[ -d "${exercise_dir}" ]] || continue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a per-exercise .gitignore vs a common one at the root?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea to have exercise-scoped .gitignore because if someone downloads an independent exercise, we don't know what context it might exist in, as someone could want to work on an exercise within their own Git repo, so being self-contained guarantees that the right things will be ignored.

BTW, this PR is a mess because I screwed things up, so I'm preparing to address other stuff and create a new PR when I'm ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant, the test runner one, where I have a new one exercism/purescript-test-runner#64

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None (or very few) of the other tracks use per-exercise .gitignores. If the user is checking in their code, would it make sense to let them manage their own .gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think packaging directories with their own scoped .gitignore is the best way to go, and that it's a mistake that it's not a standard practice throughout Exercism.

scripts/ci Outdated
Comment on lines 64 to 73
if [ -d "examples/src" ] && ls examples/src/*.purs 1>/dev/null 2>&1; then
cp examples/src/*.purs src/
elif [ -f ".meta/Exemplar.purs" ]; then
# Find the single .purs file in src/ and replace it with the exemplar
src_file=$(ls src/*.purs | head -1)
cp ".meta/Exemplar.purs" "${src_file}"
else
echo "ERROR: No example solution found for ${slug}"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ -d "examples/src" ] && ls examples/src/*.purs 1>/dev/null 2>&1; then
cp examples/src/*.purs src/
elif [ -f ".meta/Exemplar.purs" ]; then
# Find the single .purs file in src/ and replace it with the exemplar
src_file=$(ls src/*.purs | head -1)
cp ".meta/Exemplar.purs" "${src_file}"
else
echo "ERROR: No example solution found for ${slug}"
exit 1
fi
if [ "$exercise_dir" = ./exercises/practice/* ]; then
files=( examples/src/*.purs )
if ! [ -f $files ]; then
echo "ERROR: No example solution found for practice exercise ${slug}"
exit 1
fi
cp examples/src/*.purs src/
else
if ! [ -f ".meta/Exemplar.purs" ]; then
echo "ERROR: No example solution found for concept exercise ${slug}"
exit 1
fi
# Find the single .purs file in src/ and replace it with the exemplar
src_file=( src/*.purs )
cp ".meta/Exemplar.purs" "${src_file}"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use the approach of ci-check and check all exercises prior to exiting?

@IsaacG IsaacG reopened this Feb 9, 2026
for config in "$exercises_dir"/*/*/spago.dhall; do
exercise_dir=$(dirname "${config}")
for exercise_dir in "$base_dir"/exercises/*/*; do
[[ -d "${exercise_dir}" ]] || continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note if you add a trailing / to the glob, you don't need this check

scripts/ci Outdated

for exercise_dir in ./exercises/{concept,practice}/*/; do
exercise_dir="${exercise_dir%/}"
slug=$(basename "${exercise_dir}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slug=$(basename "${exercise_dir}")
slug="${exercise_dir##*/}"

scripts/ci Outdated
if [ -h .spago ] || [ -d .spago ]; then
echo "Removing existing spago local cache..."
# Link/copy pre-compiled dependencies (clean up any existing artifacts)
if [[ -h .spago ]] || [[ -d .spago ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ -h .spago ]] || [[ -d .spago ]]; then
if [[ -h .spago || -d .spago ]]; then

scripts/ci Outdated

# Build and test the solution
spago --no-psa --config .solution.dhall test
if [[ -h node_modules ]] || [[ -d node_modules ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ -h node_modules ]] || [[ -d node_modules ]]; then
if [[ -h node_modules || -d node_modules ]]; then

scripts/ci Outdated
# Concept exercises: copy .meta/Exemplar.purs over the single src/*.purs file
if [[ "$exercise_dir" == ./exercises/practice/* ]]; then
files=( examples/src/*.purs )
if ! [[ -f ${files[0]} ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ! [[ -f ${files[0]} ]]; then
if [[ ! -f ${files[0]} ]]; then

scripts/ci Outdated
fi
cp examples/src/*.purs src/
else
if ! [[ -f ".meta/Exemplar.purs" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ! [[ -f ".meta/Exemplar.purs" ]]; then
if [[ ! -f ".meta/Exemplar.purs" ]]; then

scripts/ci Outdated
popd > /dev/null || exit
continue
fi
cp examples/src/*.purs src/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cp examples/src/*.purs src/
cp "${files[@]}" src/

scripts/ci Outdated
popd > /dev/null || exit
done

exit $rc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exit $rc
exit "$rc"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the Bash improvements in 0de23da

@IsaacG IsaacG merged commit 0730cf9 into exercism:main Feb 13, 2026
3 checks passed
IsaacG pushed a commit to exercism/purescript-test-runner that referenced this pull request Feb 13, 2026
Migrate from Spago 0.21.0 (Dhall) to Spago 1.0.3 (YAML + Registry)

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 in exercism/purescript](exercism/purescript#323).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments