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

Upgrade to GHC 8.8.1 #8

Closed
andreasabel opened this issue Nov 3, 2019 · 6 comments
Closed

Upgrade to GHC 8.8.1 #8

andreasabel opened this issue Nov 3, 2019 · 6 comments

Comments

@andreasabel
Copy link
Member

haskell-src does not build with ghc 8.8.1:

$ cabal install haskell-src
...
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: haskell-src-1.0.3.0 (user goal)
[__1] next goal: base (dependency of haskell-src)
[__1] rejecting: base-4.13.0.0/installed-4.1... (conflict: haskell-src =>
base>=4.3 && <4.13)
...

HTF depends on haskell-src, for instance.

hvr added a commit that referenced this issue Nov 9, 2019
This constitutes a special GHC 8.8.1/base-4.13 only compatibility
release to support `MonadFail`

The next non-micro-pointrelease will support a wider compat window
again.

Addresses #8
@hvr
Copy link
Contributor

hvr commented Nov 9, 2019

@hvr hvr closed this as completed Nov 9, 2019
@andreasabel
Copy link
Member Author

andreasabel commented Dec 7, 2019

Thanks!

May I ask why the new release supports ONLY ghc 8.8? https://matrix.hackage.haskell.org/#/package/haskell-src
The constraint on base is >= 4.13, but on the other hand, the cabal file says:

tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4

(That seems not fully up-to-date, missing 8.8 and 8.6).

Is this an oversight? Was the intention to put base >= 4.3, like it is on github?

build-depends: base >= 4.3 && < 4.14

I am asking since I have problem installing haskell-src as a dependency of HTF in my travis test for BNFC on ghc 8.8: https://travis-ci.org/BNFC/bnfc/jobs/622005387

next goal: haskell-src (dependency of HTF-0.14.0.1)
rejecting: haskell-src-1.0.3.1 (unsupported spec-version 2.4)

The culprit seems to be that haskell-src-1.0.3.1 asks for cabal-version: 2.4, unlike the current HEAD, which just wants cabal-version: >=1.10.

I fail to understand why the released version on hackage differs from the current HEAD. (On the other hand, I am not a cabal expert.)
What would go wrong if the latest HEAD (which does not have all the tight bounds) was released on hackage as 1.0.3.2 ?

@hvr
Copy link
Contributor

hvr commented Dec 8, 2019

@andreasabel The haskell-src-1.0.3.1 release has been done in this particular way deliberately and it's a pattern I've started for some time now; specifically I try to avoid nedlessly exploding the build-plan configuration space to avoid useless degrees of freedoms, especially if the new release has been done for the sole purpose and benefit of supporting a new major GHC version. I've meaning to document this recommended practice but never got around to it; it's very related to the concepts that underly the recommendations in https://github.com/haskell-infra/hackage-trustees/blob/master/cookbook.md#best-practice-for-managing-meta-data

Also, you might notice that the haskell-src-1.0.3.1 release was done from the https://github.com/haskell-pkg-janitors/haskell-src/tree/1.0.3._ maintenance branch I created for this very purpose (also in case a future GHC release needs yet another release that can't be addressed by a simple meta-data update); that's why there is this apparent divergence w/ master; the master branch is intended for the the next minor or major version of haskell-src which will support a wider range of GHC versions again.

@neongreen
Copy link

I have to say that this practice is rather intuition-breaking. If I stumbled upon https://hackage.haskell.org/package/haskell-src on Hackage, I would definitely make a mental note "okay, this package probably depends on latest GHC features or something so I can't use it, moving on". It would not occur to me that I should look at 1.0.3.0 or further in the past.

@hvr
Copy link
Contributor

hvr commented Dec 8, 2019

@neongreen sure, but why would you have two releases for the same minor version then? i.e. you have two releases that expose the very same API (otherwise they wouldn't be allowed to share the same minor API version), and by definition micro-releases are supposed to be a way to make internal changes not observable by API consumers which say depend on haskell-src == 1.0.3.* -- this gives us the ability to avoid CPP completely in packages and the solver pick the compatible micro-release that satisfies constraints. This technique is rather old, and was also for instance used for discriminating over the version of transformers used in http://hackage.haskell.org/package/transformers-compat-0.6.0.2 through 0.6.0.6 -- an API consumer would depend on transformers-compat == 0.6.0.* and the cabal solver would pick the micro-release that matches the version of transformers. I think the intuition needs to evolve otherwise we would risk being held back from being more creative in finding ways to exploit the features available to us by virtue of having a proper constraint-solver at our disposal that is able to compute a lot more than other ecosystems are able to which are limited to far more basic update problems...

@neongreen
Copy link

Sure, but "being creative" vs. "being boring and predictable" is a tradeoff – and I just wanted to give you an extra data point for balancing the tradeoff.

For what it's worth, I also had no idea that transformers-compat-0.6.0.x was using this technique – I thought it was done by the Cabal solver juggling the two, three, etc flags (and never looked into details).

Perhaps it would help if Hackage allowed prominently marking all "active" versions of a package when there is more than one.

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

No branches or pull requests

3 participants