spago
spago copied to clipboard
`spago upgrade` should use a compatible compiler version if no sets for the current one are available
The latest package set 50.1.1 https://github.com/purescript/registry/blob/main/package-sets/50.1.1.json specifies PureScript 0.15.14.
Can that be updated to solve this error from spago upgrade?
❌ No package set found for the current compiler version.
Thanks
If you have [email protected] you can use any package set made for [email protected], if Y >= Z.
So [email protected] can use any package set made for any purs 0.15.X.
FWIW, you can see which is the latest package set for each version:
spago registry package-sets --latest
+---------+------------+----------+
| VERSION | DATE | COMPILER |
+---------+------------+----------+
| 10.0.0 | 2023-01-05 | 0.15.4 |
| 20.0.3 | 2023-04-08 | 0.15.7 |
| 27.2.0 | 2023-06-17 | 0.15.8 |
| 29.1.0 | 2023-07-18 | 0.15.9 |
| 43.3.0 | 2023-10-23 | 0.15.10 |
| 46.2.0 | 2023-11-23 | 0.15.12 |
| 47.10.0 | 2023-12-28 | 0.15.13 |
| 50.1.1 | 2024-02-23 | 0.15.14 |
+---------+------------+----------+
So the issue here is that spago upgrade should use any of these, as long as they are higher than your current version.
It should also allow you to specify a set to use with the --package-set flag, just like spago init does.
This seems it should be transferred to spago’s repo, as no dev happens here
Would someone transfer this? I don't have the ability; "Transfer issue" should be at the right side: https://docs.github.com/en/issues/tracking-your-work-with-issues/transferring-an-issue-to-another-repository Happy to create a new issue at https://github.com/purescript/spago of course
Oh sorry, I was entirely convinced it was in spago in the first place. I moved it now.
From what I understand, the Y >= Z condition is already the case, as specified here: https://github.com/fsoikin/spago/blame/3c2b1ce92a5d9d1edbd236181eb821cabafd9c6a/src/Spago/Registry.purs#L295
And indeed, in my local testing, I was able to upgrade to the latest package set with compiler version lower than the current installed one:
λ npx purs --version
0.15.16-3
λ npx spago registry package-sets
+---------+------------+----------+
| VERSION | DATE | COMPILER |
+---------+------------+----------+
| .... skipped lots .... |
| 53.2.0 | 2024-07-01 | 0.15.15 |
| 53.2.1 | 2024-07-09 | 0.15.15 |
| 53.3.0 | 2024-07-10 | 0.15.15 |
| 53.3.1 | 2024-07-11 | 0.15.15 |
| 54.0.0 | 2024-07-12 | 0.15.15 |
| 55.0.0 | 2024-07-14 | 0.15.15 |
| 55.1.0 | 2024-07-18 | 0.15.15 |
| 55.2.0 | 2024-07-21 | 0.15.15 |
| 55.3.0 | 2024-07-24 | 0.15.15 |
+---------+------------+----------+
λ npx spago upgrade
Reading Spago workspace configuration...
✅ Selecting package to build: spago-pg
Upgrading the package set to the latest version: 55.3.0
✅ Upgrade successful!
λ npx spago install
Reading Spago workspace configuration...
✅ Selecting package to build: spago-pg
Downloading dependencies...
Building...
Src Lib All
Warnings 0 0 0
Errors 0 0 0
✅ Build succeeded.
λ cat .spago/BuildInfo.purs
...
pursVersion :: String
pursVersion = "0.15.16"
...
The only requirement remaining is the support for --package-set parameter.
Is that right?
From what I understand, the Y >= Z condition is already the case
Ah yeah, it looks like I accidentally fixed this in #1228 😄
Tangential thought: looking at your .... skipped lots .... makes me think that maybe the default for spago registry package-sets should be use to just show the latest package sets for each compiler (which now you need the --latest flag for), and have like a --all flag to show all of them instead
Yes, that makes sense, I was going to suggest it. But it doesn't sound like something blocking the milestone.