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

Handle the case where the compiler version is newer than the package set compiler version #225

Closed
hdgarrood opened this issue May 30, 2019 · 2 comments · Fixed by #253
Closed
Assignees
Labels

Comments

@hdgarrood
Copy link
Contributor

For example, trying to build a v0.12.5 package set with a v0.13.0 compiler:

spago: Oh noes! It looks like the PureScript version installed on your system is
outdated for the package-set you're using.

installed version:   0.13.0
package-set version: 0.12.5

Please upgrade your `purs` version.

Also, is it possible to tell spago that I know what I'm doing and I'd like to disable this check?

@f-f
Copy link
Member

f-f commented May 30, 2019

This is "handled" meaning that it has been thought about:
https://github.com/spacchetti/spago/blob/82c72fb7418e1a1b36aa00876d7aba5f2053739d/app/Spago/PackageSet.hs#L171-L178

..however the error message is wrong (it should say "too new" instead of "outdated").

Also there is no "nice" way to tell spago to just go on, so I think we should add a flag --no-purs-check that would skip this check entirely.

You can "hack" your way around this for now by adding a layer of indirection when importing the packages.dhall in spago.dhall, so:

  • rename the packages.dhall to something else e.g. packages1.dhall
  • make a packages.dhall containing the following: ./packages1.dhall

(this works because spago looks at the packages.dhall and searches for a GitHub url to determine the version of the package set. This should really be rehauled and we should have the package set version inside the package set data. See https://github.com/purescript/package-sets/issues/96 for more info)

@f-f
Copy link
Member

f-f commented Jun 6, 2019

In the end it looks like we can fix this without adding a new flag, through a combination of #253 and purescript/package-sets#343

TL;DR: changing the version of the supported purs can be now done by changing the version of the metadata package in the set

@f-f f-f closed this as completed in #253 Jun 7, 2019
f-f added a commit that referenced this issue Jun 7, 2019
Before this `spago` would try to find out which `purs` version is supported by
the set by reading the GitHub tag the upstream comes from. This brings a whole 
bunch of issues, e.g. we cannot ensure anything if the package set comes from
somewhere else while the check is hard to override if we do, etc.

With this change we now read the "minimum supported purs version" just as the
version of one of the packages in the set.

This fixes #225, because we:
- fix the error message to just say "SemVer mismatch" instead of newer/older
- make the "minimum purs version" easily overridable, as it's just the version of
  a package, so there's no need for a flag
- make this version check actually robust, as we're not trying to climb the Dhall
  import chain from the AST anymore
elliotdavies pushed a commit to elliotdavies/spago that referenced this issue Jul 1, 2019
…script#253)

Before this `spago` would try to find out which `purs` version is supported by
the set by reading the GitHub tag the upstream comes from. This brings a whole 
bunch of issues, e.g. we cannot ensure anything if the package set comes from
somewhere else while the check is hard to override if we do, etc.

With this change we now read the "minimum supported purs version" just as the
version of one of the packages in the set.

This fixes purescript#225, because we:
- fix the error message to just say "SemVer mismatch" instead of newer/older
- make the "minimum purs version" easily overridable, as it's just the version of
  a package, so there's no need for a flag
- make this version check actually robust, as we're not trying to climb the Dhall
  import chain from the AST anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants