Skip to content

Fix build with Cabal >= 2.4#18

Merged
andreasabel merged 6 commits intohaskell-hvr:masterfrom
avdv:build-cabal-2.4
Sep 19, 2022
Merged

Fix build with Cabal >= 2.4#18
andreasabel merged 6 commits intohaskell-hvr:masterfrom
avdv:build-cabal-2.4

Conversation

@avdv
Copy link
Contributor

@avdv avdv commented Jan 11, 2022

Fixes #15

@avdv
Copy link
Contributor Author

avdv commented Jan 11, 2022

Hi. This is my attempt at fixing the build with Cabal >= 2.4.

I tested with Cabal 3.6.2.0 and Cabal-3.0.1.0 (in another project). I could not get it to resolve dependencies for Cabal < 2.4 though... I could use some guidance here.

cabal build --minimize-conflict-set
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: hgettext-0.1.31.0 (user goal)
[__1] trying: deepseq-1.4.4.0/installed-1.4.4.0 (dependency of hgettext)
[__2] trying: array-0.5.4.0/installed-0.5.4.0 (dependency of deepseq)
[__3] trying: base-4.14.3.0/installed-4.14.3.0 (dependency of hgettext)
[__4] next goal: Cabal (dependency of hgettext)
[__4] rejecting: Cabal-3.2.1.0/installed-3.2.1.0 (conflict: hgettext =>
Cabal>=1.14 && <1.25 || >=2.0 && <2.1)
[__4] skipping: Cabal-3.6.2.0, Cabal-3.6.1.0, Cabal-3.6.0.0, Cabal-3.4.1.0,
Cabal-3.4.0.0, Cabal-3.2.1.0, Cabal-3.2.0.0, Cabal-3.0.2.0, Cabal-3.0.1.0,
Cabal-3.0.0.0, Cabal-2.4.1.0, Cabal-2.4.0.1, Cabal-2.4.0.0, Cabal-2.2.0.1,
Cabal-2.2.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=1.14 && <1.25 || >=2.0 && <2.1' from
'hgettext')
[__4] trying: Cabal-2.0.1.1
[__5] next goal: unix (dependency of Cabal)
[__5] rejecting: unix-2.7.2.2/installed-2.7.2.2 (conflict: Cabal => time>=1.4
&& <1.9, unix => time==1.9.3/installed-1.9.3)
[__5] trying: unix-2.7.2.2
[__6] next goal: time (dependency of Cabal)
[__6] rejecting: time-1.9.3/installed-1.9.3 (conflict: Cabal => time>=1.4 &&
<1.9)
[__6] skipping: time-1.12.1, time-1.12, time-1.11.1.2, time-1.11.1.1,
time-1.11.1, time-1.11, time-1.10, time-1.9.3, time-1.9.2, time-1.9.1,
time-1.9 (has the same characteristics that caused the previous version to
fail: excluded by constraint '>=1.4 && <1.9' from 'Cabal')
[__6] rejecting: time-1.8.0.4, time-1.8.0.3, time-1.8.0.2, time-1.8.0.1,
time-1.8, time-1.7.0.1, time-1.7, time-1.6.0.1 (conflict: deepseq =>
base==4.14.3.0/installed-4.14.3.0, time => base>=4.7 && <4.13)
[__6] rejecting: time-1.6 (conflict: deepseq =>
base==4.14.3.0/installed-4.14.3.0, time => base>=4.8 && <4.13)
[__6] rejecting: time-1.5.0.1 (conflict: deepseq =>
base==4.14.3.0/installed-4.14.3.0, time => base>=4.4 && <4.13)
[__6] rejecting: time-1.5 (conflict: deepseq==1.4.4.0/installed-1.4.4.0, time
=> deepseq>=1.1 && <1.4)
[__6] skipping: time-1.4.2, time-1.4.1, time-1.4.0.2, time-1.4.0.1, time-1.4
(has the same characteristics that caused the previous version to fail:
excludes 'deepseq' version 1.4.4.0)
[__6] rejecting: time-1.3 (conflict: Cabal => time>=1.4 && <1.9)
[__6] skipping: time-1.2.0.5, time-1.2.0.4, time-1.2.0.3, time-1.2.0.2,
time-1.2.0.1, time-1.2, time-1.1.4, time-1.1.3, time-1.1.2.4, time-1.1.2.3,
time-1.1.2.2, time-1.1.2.1, time-1.1.2.0, time-1.0, time-1.13 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=1.4 && <1.9' from 'Cabal')
[__6] fail (backjumping, conflict set: Cabal, deepseq, time)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: Cabal, time, array, deepseq, base,
hgettext, unix

@danwdart
Copy link

I'll see if I get the same - and see what I have to override.

@danwdart
Copy link

Hmm, buildling with Nix I got:

Setup: Encountered missing or private dependencies:
base >=4.5 && <4.15, containers >=0.4.2 && <0.6

But works fine when I jailbreak with nix expression inside a haskell project:

hgettext = lib.doJailbreak (self.callCabal2nix "hgettext" (builtins.fetchGit {
        url = "https://github.com/avdv/hgettext.git";
        ref = "e580db9d640505ace046ff0a99a34192a118c89c";
      }) {});

Looks like version bounds just need to be relaxed.

Copy link
Member

@andreasabel andreasabel left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

It builds fine for newer GHCs, but breaks build with older versions of Cabal. Please restore build with old versions.

@andreasabel andreasabel added this to the 0.1.40.1 milestone Sep 4, 2022
@andreasabel
Copy link
Member

The error with GHC 8.2/4 is now:

src/Distribution/Simple/I18N/GetText.hs:216:48: error:
    Ambiguous occurrence ‘matchFileGlob’
    It could refer to either ‘Distribution.Simple.Utils.matchFileGlob’,
                             imported from ‘Distribution.Simple.Utils’ at src/Distribution/Simple/I18N/GetText.hs:81:1-42
                          or ‘Internal.matchFileGlob’,
                             imported from ‘Internal’ at src/Distribution/Simple/I18N/GetText.hs:93:71-83
                             (and originally defined at src/Internal.hs:26:1-13)

https://github.com/haskell-hvr/hgettext/runs/8209769966?check_suite_focus=true#step:18:31

With GHC 7.4 - 8.0 it is:

src/Internal.hs:11:18:
    Could not find module `Distribution.Types.PackageDescription'

https://github.com/haskell-hvr/hgettext/runs/8209771066?check_suite_focus=true#step:18:29

@avdv
Copy link
Contributor Author

avdv commented Sep 8, 2022

@andreasabel I think I have addressed the remaining problems, PTAL.

@avdv avdv marked this pull request as ready for review September 8, 2022 07:17
@andreasabel
Copy link
Member

@andreasabel I think I have addressed the remaining problems, PTAL.

Looks like it still fails. I suggest you test locally before pushing the next attempted fix. It is quite easy to install older GHCs (back to 8.0.2) via ghcup.

@avdv
Copy link
Contributor Author

avdv commented Sep 8, 2022

Looks like it still fails. I suggest you test locally before pushing the next attempted fix. It is quite easy to install older GHCs (back to 8.0.2) via ghcup.

Sorry, that does not work on my system (NixOS).

I just realized that I made a stupid off-by-one error and modified the wrong line / the wrong import statement... 😵‍💫 (error message said line 81 and I modified line 80)

Fixed this again. And this time, I ran the Github actions on my own repo first: avdv#1

image

@avdv
Copy link
Contributor Author

avdv commented Sep 14, 2022

@andreasabel Is there anything left to do here?

@andreasabel
Copy link
Member

@andreasabel Is there anything left to do here?

Thanks for fixing! I am on vacation right now, so please expect some delays...

@andreasabel andreasabel merged commit 4eb2225 into haskell-hvr:master Sep 19, 2022
@avdv avdv deleted the build-cabal-2.4 branch September 19, 2022 11:24
@avdv
Copy link
Contributor Author

avdv commented Sep 19, 2022

I am on vacation right now, so please expect some delays...

Thanks for merging. Have a nice holiday!

@andreasabel
Copy link
Member

Released: https://hackage.haskell.org/package/hgettext-0.1.40.1

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.

Build fails with Cabal 2.4

3 participants