Skip to content

Implement spago update for solver projects#1376

Merged
f-f merged 4 commits intomasterfrom
f-f/update-with-solver
Jan 31, 2026
Merged

Implement spago update for solver projects#1376
f-f merged 4 commits intomasterfrom
f-f/update-with-solver

Conversation

@f-f
Copy link
Member

@f-f f-f commented Jan 29, 2026

Fix #1001: we add spago update support for solver-based projects. The heuristic for doing this is by "extending" the range upwards, while keeping the lower bound intact. The packages that are fixed to a single version will keep being specified as a single (upgraded) version.

@f-f
Copy link
Member Author

f-f commented Jan 29, 2026

@thomashoneyman oh, I now realise that we introduced single-version bounds in #1373 (not yet released); the registry will need to learn to parse those. I think implementing it after this patch will be nicer because we now have a separate type for it in Core, instead of coercing it to a Range.

@thomashoneyman
Copy link
Member

thomashoneyman commented Jan 29, 2026

Gary had contributed this:
purescript/registry-dev#702

It sounds like you're worried the registry will barf if it sees a range specified as "X.Y.Z" in the manifest instead of >=X.Y.Z <X.Y.Z?

@f-f
Copy link
Member Author

f-f commented Jan 29, 2026

Gary had contributed this

Yeah, this new branch is using that code, but now we are also allowing spago configs to have pinned versions instead of only ranges, like prelude: 6.0.1

It sounds like you're worried the registry will barf if it sees a range specified as "X.Y.Z" in the manifest instead of >=X.Y.Z <X.Y.Z?

Yea I think it will?

@thomashoneyman
Copy link
Member

Ah, right. We'd need to change this to have an additional case of Pinned with a single version and update the codecs.
https://github.com/purescript/registry-dev/blob/d189d0debb858062085310200382bfb05e55529a/app/src/App/Manifest/SpagoYaml.purs#L154

upgradedCore = upgradeConstraints currentCore corePlan
upgradedTest = upgradeConstraints currentTest testPlan

-- Write back to config
Copy link
Member

Choose a reason for hiding this comment

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

Not sure how much it matters but this goes ahead and writes the constraints immediately after solving; #1001 describes building the resolved plan first, though, and only persisting changes in the build succeeded. Should we run the build with the solved plan and only then write?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that slipped through, but it makes sense so I will add it.

Copy link
Member

@thomashoneyman thomashoneyman left a comment

Choose a reason for hiding this comment

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

One small comment

@f-f f-f merged commit 6880b07 into master Jan 31, 2026
5 checks passed
@f-f f-f deleted the f-f/update-with-solver branch February 2, 2026 16:49
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.

spago update command should work with solver-packages too

2 participants