Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spago upgrade should use a compatible compiler version if no sets for the current one are available #1191

Closed
peterbecich opened this issue Feb 26, 2024 · 7 comments · Fixed by #1256

Comments

@peterbecich
Copy link
Contributor

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

@f-f
Copy link
Member

f-f commented Feb 26, 2024

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.

@f-f f-f added the bug label Feb 26, 2024
@f-f f-f changed the title request for package set for 0.15.15 compiler spago upgrade should use a compatible compiler version if no sets for the current one are available Feb 26, 2024
@thomashoneyman
Copy link
Member

This seems it should be transferred to spago’s repo, as no dev happens here

@peterbecich
Copy link
Contributor Author

peterbecich commented Mar 2, 2024

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

@f-f f-f transferred this issue from purescript/registry Mar 2, 2024
@f-f
Copy link
Member

f-f commented Mar 2, 2024

Oh sorry, I was entirely convinced it was in spago in the first place. I moved it now.

@fsoikin
Copy link
Collaborator

fsoikin commented Jul 25, 2024

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?

@f-f
Copy link
Member

f-f commented Jul 25, 2024

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

@f-f f-f closed this as completed in #1256 Jul 25, 2024
@fsoikin
Copy link
Collaborator

fsoikin commented Jul 25, 2024

Yes, that makes sense, I was going to suggest it. But it doesn't sound like something blocking the milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants