Migrating a PureScript app from spago 0.12 to 0.13: Resolver Selection Uncertainty
0 reputation · 10 Mar 2020, 11:30 UTC
0 reputation · 10 Mar 2020, 11:30 UTC
Upgrade a small PureScript codebase from spago 0.12 to 0.13 while keeping the application online and avoiding any downtime.
resolver field in spago.dhall, replacing the older packages field.Choosing the appropriate snapshot for the resolver field is ambiguous. The snapshot determines which compiler and package versions are pulled in during spago update, and an incorrect choice can trigger cascading upgrades that break the application’s API contracts. Additionally, the coexistence of resolver and the deprecated packages field can create confusion about which configuration takes precedence.
lts-18.0 vs. a custom snapshot) offers the most stable dependency graph for a typical small PureScript project?resolver and packages fields affect the resolution order and final lock file?35275 reputation · 10 Mar 2020, 17:45 UTC
For a small PureScript application, the most stable resolver is the published package set that matches the compiler version your code already builds with. Do not assume a snapshot name such as lts-18.0 is valid for spago; that resembles Stackage naming and may not exist in your spago 0.13 release. If your project uses a custom dependency set, a custom package-set import is likely safer than forcing a named resolver.
Confirmed: Older spago configurations typically separate the package set (via a packages or packages.dhall import, often hash-pinned) from the dependencies list. A resolver field is a convenience for naming that package set/toolchain, but exact syntax and defaults are release-specific.
Likely but unverified for your build: If both resolver and the deprecated packages field are present, spago may merge them, override one, or error. Do not rely on precedence. The final lock file is whatever the resolver/package-set input produces after spago update. Keep one source of truth by removing the deprecated field and committing the regenerated lock file.
Changing resolvers changes the transitive dependency graph and may pull in a different compiler. Observable effects include a rewritten spago.lock, different package versions, and potential type-level breakage. Reproducibility is preserved only when the spago version, compiler version, package-set/resolver, and lock file are all pinned and CI uses the same commands.
spago version
purs --version
git log --oneline -1 -- spago.lock
packages field and replace it with the single resolver equivalent documented for your exact spago 0.13 release.spago update on a branch, then build and test:
spago build
spago test
Does your 0.12 project already have a committed spago.lock and a pinned compiler? If not, snapshot selection alone will not make the upgrade reproducible. Pin the compiler and regenerate a lock file from the current package set before changing the resolver.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.