René's URL Explorer Experiment


Title: Migrate toolchain to the new Spago (spago.yaml + registry), including the Lua package-set forks · Issue #55 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Migrate toolchain to the new Spago (spago.yaml + registry), including the Lua package-set forks · Issue #55 · purescript-lua/purescript-lua

X Title: Migrate toolchain to the new Spago (spago.yaml + registry), including the Lua package-set forks · Issue #55 · purescript-lua/purescript-lua

Description: Motivation Legacy spago 0.21.x is the last release from the Haskell codebase, and it is the only release that still understands spago.dhall / packages.dhall. All ongoing Spago development happens in the PureScript rewrite (≥ 0.93), which...

Open Graph Description: Motivation Legacy spago 0.21.x is the last release from the Haskell codebase, and it is the only release that still understands spago.dhall / packages.dhall. All ongoing Spago development happens i...

X Description: Motivation Legacy spago 0.21.x is the last release from the Haskell codebase, and it is the only release that still understands spago.dhall / packages.dhall. All ongoing Spago development happens i...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/55

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Migrate toolchain to the new Spago (spago.yaml + registry), including the Lua package-set forks","articleBody":"## Motivation\n\nLegacy `spago` 0.21.x is the last release from the Haskell codebase, and it is the only release that still understands `spago.dhall` / `packages.dhall`. All ongoing Spago development happens in the PureScript rewrite (≥ 0.93), which dropped Dhall entirely in favour of `spago.yaml`, the PureScript Registry, and a `spago.lock` lock file. Staying on the legacy driver means we are pinned to a frozen tool while the ecosystem (package sets, registry, tooling) moves to the new format.\n\nPR #41 already attempted the test-project half of this migration. It is a useful starting point but incomplete in ways that would break our build, so this issue tracks the full migration so it lands correctly rather than merging that PR as-is. See the \"Relationship to PR #41\" section below.\n\n## Current state\n\n- **Dev shell** pins the legacy Haskell spago (`easy-ps.spago` = 0.21.0) and `purs-0_15_16-0`, both from easy-purescript-nix (`flake.nix`).\n- **Test project** (`test/ps`) is configured with `spago.dhall` + `packages.dhall`, where `packages.dhall` is `upstream-ps // upstream-lua`. The right operand (`Unisay/purescript-lua-package-sets`) overrides core packages with Lua FFI forks. That package set ships only `packages.dhall` (no JSON variant).\n- **Golden harness** (`test/Language/PureScript/Backend/Lua/Golden/Spec.hs`) shells out to `spago build -u '-g corefn'` and then reads `test/ps/output/**/corefn.json`.\n\n## Target state\n\n- Dev shell provides the new spago (≥ 0.93). The toolchain itself already comes from `purescript-overlay` (see the prerequisite issue), so this is a one-attribute swap of the spago pin; `purs` stays at 0.15.16.\n- `test/ps` uses `spago.yaml`: a `registry` package-set baseline plus `extraPackages` git overrides for the FFI-bearing Lua forks.\n- The build reliably emits CoreFn, goldens are regenerated against current package versions, and `spago.lock` is committed for reproducibility.\n\n## Migration plan\n\n### 1. Bump spago to the new release (`flake.nix`)\n\nPrerequisite: the separate \"source the toolchain from purescript-overlay\" issue (#54), which moves the dev shell to the overlay while keeping legacy spago 0.21. With the overlay already providing the toolchain, this step is just a pin swap.\n\n- [ ] Replace the legacy `spago-bin.spago-0_21_0` pin with the overlay's stable `spago` (new release, ≥ 0.93).\n- [ ] Keep `purs` at 0.15.16 (the overlay's stable `purs`), so only the package-set and build changes drive any golden churn.\n- [ ] Confirm `spago --version` ≥ 0.93 inside `nix develop`.\n\n### 2. Test-project config (`test/ps`)\n\n- [ ] Scaffold `spago.yaml` with `spago-legacy migrate` (the only release carrying the `migrate` command), then delete `spago.dhall` and `packages.dhall`.\n- [ ] Set `workspace.packageSet.registry: \u003cversion>` as the baseline.\n- [ ] Add `extraPackages` git overrides for the **FFI-bearing** forks only. Packages that ship `.lua` FFI and therefore require a Lua fork: `arrays`, `console`, `control`, `effect`, `enums`, `foldable-traversable`, `functions`, `integers`, `numbers`, `partial`, `prelude`, `refs`, `st`, `strings`, `unfoldable`, `unsafe-coerce`.\n- [ ] Leave pure (no-FFI) packages to come straight from the registry: `bifunctors`, `const`, `contravariant`, `distributive`, `either`, `exists`, `functors`, `gen`, `identity`, `invariant`, `maybe`, `newtype`, `nonempty`, `orders`, `profunctor`, `safe-coerce`, `tailrec`, `tuples`, `type-equality`. Verify each resolves against the chosen registry version; promote any that turn out to be incompatible.\n- [ ] Pin every git override to a tag, not a branch. The new spago strongly discourages branch refs, and the lock file records the resolved commit anyway.\n\n### 3. CoreFn generation (`Golden/Spec.hs`)\n\nThe new spago defaults to JS codegen; CoreFn is not produced unless asked for. PR #41's plain `spago build` would not generate `corefn.json` at all. The suite only appears to pass there because committed `Golden*/corefn.json` files are read as stale inputs, which silently defeats the point of recompiling from source.\n\n- [ ] Change the build command to pass CoreFn through purs, e.g. `spago build --purs-args \"--codegen corefn,js\"`. Use `corefn,js` rather than `corefn` alone: incremental-build caching can leave CoreFn stale when only one codegen target is requested (purescript/spago#643).\n- [ ] Confirm the build actually refreshes `corefn.json` (touch a source file, rebuild, diff) so the harness validates freshly compiled output rather than committed copies.\n\n### 4. `.gitignore` and the lock file\n\n- [ ] Commit `spago.lock` rather than ignoring it. For a golden-test project, pinning the exact resolved fork commits is what we want. (PR #41 ignored it; reverse that decision here.)\n- [ ] Ignore the dependency output directories and `.js` / `.js.map` artifacts while keeping `Golden*/corefn.json` tracked.\n\n### 5. Goldens and docs\n\n- [ ] Regenerate goldens with `./scripts/golden_reset` against current package versions.\n- [ ] Update the toolchain section of `CLAUDE.md` (spago version, the new build command, and how the override-based package set works).\n\n### 6. The Lua package-set forks (\"all packages\")\n\n`extraPackages` git entries need each package's dependency list. There are two ways to supply it:\n\n- **(a) Inline `dependencies:`** per git entry in `test/ps/spago.yaml` (fast; this is what PR #41 did; duplicates each fork's dep graph in our config and drifts over time).\n- **(b) Add a `spago.yaml` to each Lua fork repo** so consumers don't inline deps (reusable, single source of truth; ~16 FFI fork repos to touch, all under accounts we control).\n\n- [ ] Choose (a) or (b). Recommendation: (b) long-term since we own the forks, with (a) acceptable as an interim step to unblock the test project.\n\n## New spago features worth adopting\n\n- **Lock file (`spago.lock`)**: pins the exact fork commits behind every git override, giving reproducible golden inputs that complement the Nix pin. Commit it.\n- **Custom backend (`workspace.backend.cmd`)**: longer term, register `pslua` as a Spago backend so downstream users get first-class `spago build` / `spago bundle` / `spago run` targeting Lua instead of wiring the compiler by hand. Good for adoption, but worth a separate follow-up issue rather than folding it into this migration.\n- **Registry solver (`--use-solver`)**: deliberately not recommended here. Golden stability wants exact pins, not range solving, so the package set with pinned overrides is the better fit.\n\n## Open questions\n\n- Which registry package-set version aligns with `purs` 0.15.16 and the fork versions? (We plan to keep `purs` at 0.15.16; the registry baseline must be compatible with it.)\n- Strategy (a) vs (b) for fork dependency lists.\n- Do the FFI forks themselves need a one-time bump to be registry-resolvable (versions/bounds), or do the existing tags work as-is via git overrides?\n\n## Relationship to PR #41\n\nPR #41 (\"migrate test project from spago.dhall to spago.yaml\") is the prior art for steps 2, 4, and the inline-deps variant of step 6. What it is missing, and what this issue exists to get right:\n\n- It does not touch `flake.nix`, so the pinned legacy spago in the dev shell (and therefore CI) cannot read the new `spago.yaml`.\n- Its `spago build` does not request CoreFn codegen, so it would stop generating fresh `corefn.json` (masked by committed goldens).\n- Its regenerated goldens are now stale relative to `main` (the package set has since moved), and it drops a `luacheck --no-redefined` flag whose inline comment explains why it is needed.\n\n## References\n\n- [Spago README / migration guide](https://github.com/purescript/spago/blob/master/README.md)\n- [purescript/spago#643: CoreFn not refreshed by incremental build](https://github.com/purescript/spago/issues/643)\n- [purescript-overlay (new spago + purs via Nix)](https://github.com/thomashoneyman/purescript-overlay)\n- PR #41: prior art for the test-project migration\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-06-14T08:03:45Z","url":"https://github.com/purescript-lua/purescript-lua/issues/55"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:947e7c29-d816-7f0b-f286-1efaa98bde07
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB9FA:4BB79:544DA7:6D72EE:6B00DB5C
html-safe-nonce64e7954c6f28e48e12d3525cdb54a7c16fcf7960823a6c68bdcb13b4e5a775a5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUZBOjRCQjc5OjU0NERBNzo2RDcyRUU6NkIwMERCNUMiLCJ2aXNpdG9yX2lkIjoiNDkwMDc4Mjg1NDQ4NjY3ODM2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd602191f023f452a4c2aab86f5c0e56a6f2d07468e156d7d98cd7dc0f1e13937
hovercard-subject-tagissue:4658381851
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/55/issue_layout
twitter:imagehttps://opengraph.githubassets.com/91b10706739f830bc02817749e5e2fd619abeb9bdb148eb311e8a254610771a0/purescript-lua/purescript-lua/issues/55
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/91b10706739f830bc02817749e5e2fd619abeb9bdb148eb311e8a254610771a0/purescript-lua/purescript-lua/issues/55
og:image:altMotivation Legacy spago 0.21.x is the last release from the Haskell codebase, and it is the only release that still understands spago.dhall / packages.dhall. All ongoing Spago development happens i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameUnisay
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/55#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F55
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F55
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/55
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/55
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/55
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/55
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/55
#114https://github.com/purescript-lua/purescript-lua/pull/114
Migrate toolchain to the new Spago (spago.yaml + registry), including the Lua package-set forkshttps://github.com/purescript-lua/purescript-lua/issues/55#top
#114https://github.com/purescript-lua/purescript-lua/pull/114
https://github.com/Unisay
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jun 14, 2026https://github.com/purescript-lua/purescript-lua/issues/55#issue-4658381851
#41https://github.com/purescript-lua/purescript-lua/pull/41
#41https://github.com/purescript-lua/purescript-lua/pull/41
#54https://github.com/purescript-lua/purescript-lua/issues/54
#41https://github.com/purescript-lua/purescript-lua/pull/41
spago build didn't update corefn in output directory purescript/spago#643https://github.com/purescript/spago/issues/643
simple PR to get this project building with the new Spago #41https://github.com/purescript-lua/purescript-lua/pull/41
simple PR to get this project building with the new Spago #41https://github.com/purescript-lua/purescript-lua/pull/41
#41https://github.com/purescript-lua/purescript-lua/pull/41
#41https://github.com/purescript-lua/purescript-lua/pull/41
Spago README / migration guidehttps://github.com/purescript/spago/blob/master/README.md
purescript/spago#643: CoreFn not refreshed by incremental buildhttps://github.com/purescript/spago/issues/643
purescript-overlay (new spago + purs via Nix)https://github.com/thomashoneyman/purescript-overlay
simple PR to get this project building with the new Spago #41https://github.com/purescript-lua/purescript-lua/pull/41
Unisayhttps://github.com/Unisay
on Jun 14, 2026https://github.com/purescript-lua/purescript-lua/issues/55#event-26724347446
Unisayhttps://github.com/Unisay
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
on Jun 15, 2026https://github.com/purescript-lua/purescript-lua/issues/55#event-26762770723
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#114https://github.com/purescript-lua/purescript-lua/pull/114
on Jun 23, 2026https://github.com/purescript-lua/purescript-lua/issues/55#event-27096997094
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/55
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/55
Unisayhttps://github.com/Unisay
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.