UU-ComputerScience / uuagc

3 stars 9 forks source link

Installing uuagc (0.9.52.2) via cabal new-install fails #3

Closed tomsmeding closed 4 years ago

tomsmeding commented 5 years ago

This may be a bug in Cabal instead of in uuagc, but you'll know that better than I do. :)

When installing uuagc using the new-style commands, i.e. cabal new-install uuagc, the dependency resolution phase fails due to a conflicting dependency on Cabal. Somehow, it determines that uuagc, directly or indirectly, depends on both Cabal >= 2.5 and <1.25, which clearly is not going to work.

Installing with the command cabal new-install uuagc --constraint='uuagc==0.9.52.2' --verbose=3 (where the constraint is added to prevent cabal from trying older versions of uuagc), the following dependency resolution logs are generated: uuagc-conflicts.txt

From some cursory looking around, I have not been able to find the directive that requires Cabal to have a version <1.25, but that is probably my unfamiliarity with the dependency tree.

Thanks!

System info:

carliros commented 5 years ago

I guess it is happening the same to me. I have ghc 8.6.5 and cabal 3.0 (new build style enabled by default) and I am getting the same:

> cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: uuagc-0.9.52.2 (user goal)
[__1] next goal: uuagc:setup.Cabal (dependency of uuagc)
[__1] rejecting: uuagc:setup.Cabal-2.4.0.1/installed-2.4...,
uuagc:setup.Cabal-3.0.0.0, uuagc:setup.Cabal-2.4.1.0,
uuagc:setup.Cabal-2.4.0.1, uuagc:setup.Cabal-2.4.0.0 (conflict: uuagc =>
uuagc:setup.Cabal>=1.8 && <1.25)
[__1] rejecting: uuagc:setup.Cabal-2.2.0.1, uuagc:setup.Cabal-2.2.0.0,
uuagc:setup.Cabal-2.0.1.1, uuagc:setup.Cabal-2.0.1.0,
uuagc:setup.Cabal-2.0.0.2, uuagc:setup.Cabal-1.24.2.0,
uuagc:setup.Cabal-1.24.0.0, uuagc:setup.Cabal-1.22.8.0,
uuagc:setup.Cabal-1.22.7.0, uuagc:setup.Cabal-1.22.6.0,
uuagc:setup.Cabal-1.22.5.0, uuagc:setup.Cabal-1.22.4.0,
uuagc:setup.Cabal-1.22.3.0, uuagc:setup.Cabal-1.22.2.0,
uuagc:setup.Cabal-1.22.1.1, uuagc:setup.Cabal-1.22.1.0,
uuagc:setup.Cabal-1.22.0.0, uuagc:setup.Cabal-1.20.0.4,
uuagc:setup.Cabal-1.20.0.3, uuagc:setup.Cabal-1.20.0.2,
uuagc:setup.Cabal-1.20.0.1, uuagc:setup.Cabal-1.20.0.0,
uuagc:setup.Cabal-1.18.1.7, uuagc:setup.Cabal-1.18.1.6,
uuagc:setup.Cabal-1.18.1.5, uuagc:setup.Cabal-1.18.1.4,
uuagc:setup.Cabal-1.18.1.3, uuagc:setup.Cabal-1.18.1.2,
uuagc:setup.Cabal-1.18.1.1, uuagc:setup.Cabal-1.18.1,
uuagc:setup.Cabal-1.18.0, uuagc:setup.Cabal-1.16.0.3,
uuagc:setup.Cabal-1.16.0.2, uuagc:setup.Cabal-1.16.0.1,
uuagc:setup.Cabal-1.16.0, uuagc:setup.Cabal-1.14.0, uuagc:setup.Cabal-1.12.0,
uuagc:setup.Cabal-1.10.2.0, uuagc:setup.Cabal-1.10.1.0,
uuagc:setup.Cabal-1.10.0.0, uuagc:setup.Cabal-1.8.0.6,
uuagc:setup.Cabal-1.8.0.4, uuagc:setup.Cabal-1.8.0.2,
uuagc:setup.Cabal-1.6.0.3, uuagc:setup.Cabal-1.6.0.2,
uuagc:setup.Cabal-1.6.0.1, uuagc:setup.Cabal-1.4.0.2,
uuagc:setup.Cabal-1.4.0.1, uuagc:setup.Cabal-1.4.0.0,
uuagc:setup.Cabal-1.2.4.0, uuagc:setup.Cabal-1.2.3.0,
uuagc:setup.Cabal-1.2.2.0, uuagc:setup.Cabal-1.2.1, uuagc:setup.Cabal-1.1.6,
uuagc:setup.Cabal-1.24.1.0 (constraint from minimum version of Cabal used by
Setup.hs requires >=2.4)
[__1] fail (backjumping, conflict set: uuagc, uuagc:setup.Cabal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: uuagc:setup.Cabal, uuagc

Any hints on this?

doaitse commented 5 years ago

Can you try the version a https://github.com/UU-ComputerScience/uuagc

Doaitse

On 20 Sep 2019, at 13:43, Carlos Gómez notifications@github.com wrote:

I guess it is happening the same to me. I have ghc 8.6.5 and cabal 3.0 (new build style enabled by default) and I am getting the same:

cabal build Resolving dependencies... cabal: Could not resolve dependencies: [0] trying: uuagc-0.9.52.2 (user goal) [1] next goal: uuagc:setup.Cabal (dependency of uuagc) [1] rejecting: uuagc:setup.Cabal-2.4.0.1/installed-2.4..., uuagc:setup.Cabal-3.0.0.0, uuagc:setup.Cabal-2.4.1.0, uuagc:setup.Cabal-2.4.0.1, uuagc:setup.Cabal-2.4.0.0 (conflict: uuagc => uuagc:setup.Cabal>=1.8 && <1.25) [1] rejecting: uuagc:setup.Cabal-2.2.0.1, uuagc:setup.Cabal-2.2.0.0, uuagc:setup.Cabal-2.0.1.1, uuagc:setup.Cabal-2.0.1.0, uuagc:setup.Cabal-2.0.0.2, uuagc:setup.Cabal-1.24.2.0, uuagc:setup.Cabal-1.24.0.0, uuagc:setup.Cabal-1.22.8.0, uuagc:setup.Cabal-1.22.7.0, uuagc:setup.Cabal-1.22.6.0, uuagc:setup.Cabal-1.22.5.0, uuagc:setup.Cabal-1.22.4.0, uuagc:setup.Cabal-1.22.3.0, uuagc:setup.Cabal-1.22.2.0, uuagc:setup.Cabal-1.22.1.1, uuagc:setup.Cabal-1.22.1.0, uuagc:setup.Cabal-1.22.0.0, uuagc:setup.Cabal-1.20.0.4, uuagc:setup.Cabal-1.20.0.3, uuagc:setup.Cabal-1.20.0.2, uuagc:setup.Cabal-1.20.0.1, uuagc:setup.Cabal-1.20.0.0, uuagc:setup.Cabal-1.18.1.7, uuagc:setup.Cabal-1.18.1.6, uuagc:setup.Cabal-1.18.1.5, uuagc:setup.Cabal-1.18.1.4, uuagc:setup.Cabal-1.18.1.3, uuagc:setup.Cabal-1.18.1.2, uuagc:setup.Cabal-1.18.1.1, uuagc:setup.Cabal-1.18.1, uuagc:setup.Cabal-1.18.0, uuagc:setup.Cabal-1.16.0.3, uuagc:setup.Cabal-1.16.0.2, uuagc:setup.Cabal-1.16.0.1, uuagc:setup.Cabal-1.16.0, uuagc:setup.Cabal-1.14.0, uuagc:setup.Cabal-1.12.0, uuagc:setup.Cabal-1.10.2.0, uuagc:setup.Cabal-1.10.1.0, uuagc:setup.Cabal-1.10.0.0, uuagc:setup.Cabal-1.8.0.6, uuagc:setup.Cabal-1.8.0.4, uuagc:setup.Cabal-1.8.0.2, uuagc:setup.Cabal-1.6.0.3, uuagc:setup.Cabal-1.6.0.2, uuagc:setup.Cabal-1.6.0.1, uuagc:setup.Cabal-1.4.0.2, uuagc:setup.Cabal-1.4.0.1, uuagc:setup.Cabal-1.4.0.0, uuagc:setup.Cabal-1.2.4.0, uuagc:setup.Cabal-1.2.3.0, uuagc:setup.Cabal-1.2.2.0, uuagc:setup.Cabal-1.2.1, uuagc:setup.Cabal-1.1.6, uuagc:setup.Cabal-1.24.1.0 (constraint from minimum version of Cabal used by Setup.hs requires >=2.4) [__1] fail (backjumping, conflict set: uuagc, uuagc:setup.Cabal) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: uuagc:setup.Cabal, uuagc Any hints on this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/UU-ComputerScience/uuagc/issues/3?email_source=notifications&email_token=AAGEQE53KJAHYRJ5C2FTWP3QKSZN5A5CNFSM4HNZ3542YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7GNYNA#issuecomment-533519412, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGEQE4HOIIS5CCFAQ7RKBDQKSZN5ANCNFSM4HNZ354Q.

carliros commented 5 years ago

Hi Doaitse, I tried that as well. I am getting the same error. I guess Cabal 3 has broken the build installation for uuagc.

carliros commented 5 years ago

I made the repo (https://github.com/UU-ComputerScience/uuagc) work for GHC 8.6.5 and Cabal 3.0.

Here are the things I did in case someone else needs it:

All this changes are on directory uuagc/trunk of uuagc reposiroty that I forked and cloned locally.

First, I saw some warnings on cabal check

> cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: From version 1.24 cabal supports specifying explicit dependencies for
Custom setup scripts. Consider using cabal-version >= 1.24 and adding a
'custom-setup' section with a 'setup-depends' field that specifies the
dependencies of the Setup.hs script itself. The 'setup-depends' field uses the
same syntax as 'build-depends', so a simple example would be 'setup-depends:
base, Cabal'.
➜  trunk git:(master) cabal check
➜  trunk git:(master) ✗ cabal check
No errors or warnings could be found in the package.
➜  trunk git:(master) ✗ cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: uuagc-0.9.52.2 (user goal)
[__1] trying: base-4.12.0.0/installed-4.1... (dependency of uuagc)
[__2] next goal: uuagc-diagrams (user goal)
[__2] rejecting: uuagc-diagrams-0.1.1.0 (conflict:
base==4.12.0.0/installed-4.1..., uuagc-diagrams => base>=4.7 && <4.8)
[__2] rejecting: uuagc-diagrams-0.1.0.0 (constraint from user target requires
==0.1.1.0)
[__2] fail (backjumping, conflict set: base, uuagc-diagrams)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: uuagc, base, uuagc-diagrams

So, I added a custom-setup as the warnings recommended, I added this into uuagc.cabal file:

custom-setup
  setup-depends: base, Cabal

Then, when I tried to build, it was less errors:

> cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: uuagc-0.9.52.2 (user goal)
[__1] trying: base-4.12.0.0/installed-4.1... (dependency of uuagc)
[__2] next goal: uuagc-diagrams (user goal)
[__2] rejecting: uuagc-diagrams-0.1.1.0 (conflict:
base==4.12.0.0/installed-4.1..., uuagc-diagrams => base>=4.7 && <4.8)
[__2] rejecting: uuagc-diagrams-0.1.0.0 (constraint from user target requires
==0.1.1.0)
[__2] fail (backjumping, conflict set: base, uuagc-diagrams)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: uuagc, base, uuagc-diagrams

It is trying to build uuagc-diagrams but the base library was conflicting. I saw also that that library is located in the same repo. So, I jumped into diagrams and tried to build it. I got a lot of errors.

I reviewed if we have any dependency for uuagc-diagrams in uuagc.cabal. I found nothing. I do not know why this lib is not described in the cabal file of uuagc.

I also tried to build ´cabal-plugin´, this is uuagc-cabal library. And I got the same error, a dependency over uuagc-diagrams. Again, the cabal file does not describe the uuagc-diagrams dependency. Humm.

I had the idea of modifying uuagc-diagrams, and for that I would need a way to use my local modified package. So, I added a cabal.project in the uuagc directory with this content:

packages: ./
          cabal-plugin/
          diagrams/

Then I tried to make to compile uuagc-diagrams. I modified the cabal file uuagc-diagrams.cabal to consider a wider base versions, I changed from base >=4.7 && <4.8 to base >=4.7 && <5.

With these, it proceeded to build, but failed again over some errors on kinds and types:

UU/UUAGC/Diagrams.hs:94:20: error:
    • Expected kind ‘((* -> *) -> Constraint) -> k0’,
        but ‘Diagram b’ has kind ‘*’
    • In the type ‘Diagram b R2’
      In the type declaration for ‘AGDiagram’
   |
94 | type AGDiagram b = Diagram b R2
   |                    ^^^^^^^^^^^^

Weirdly, I moved to cabal-plugin and the build just passed without errors!, and then when I did the same for uuagc, it also passed without errors. I got surprised of this. Some how, we do not need a build success for uuagc-diagrams to build uuagc. But, I got what I wanted. UUAGC build passed successfully!

I hope this helps others who want to use uuagc, it is an amazing tool.