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

Dependency conflicts trying to install via cabal update brok #20

Closed
hanfried opened this issue Jul 27, 2020 · 4 comments
Closed

Dependency conflicts trying to install via cabal update brok #20

hanfried opened this issue Jul 27, 2020 · 4 comments

Comments

@hanfried
Copy link

I tried to follow the install instructions and created this straight forward minimal dockerfile

FROM haskell
RUN cabal update
RUN cabal install brok
CMD ["brok"]

As a result I get an unresovable dependency problem:

➜  linkchecker git:(master) ✗ docker build .
Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM haskell
latest: Pulling from library/haskell
Digest: sha256:536d453ba5062bc7265faa6737728b77f3438e81c73225d60f169638a6a0db61
Status: Downloaded newer image for haskell:latest
 ---> c3aff405c35b
Step 2/4 : RUN cabal update
 ---> Using cache
 ---> 78690e1b39d7
Step 3/4 : RUN cabal install brok
 ---> Running in ce7a6198cc02
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: brok-1.0.0 (user goal)
[__1] trying: time-1.9.3/installed-1.9.3 (dependency of brok)
[__2] next goal: text (dependency of brok)
[__2] rejecting: text-1.2.3.2/installed-1.2.3.2 (conflict: brok =>
text>=1.2.4.0 && <1.3)
[__2] trying: text-1.2.4.0
[__3] next goal: base (dependency of brok)
[__3] rejecting: base-4.14.0.0/installed-4.14.0.0 (conflict: text =>
ghc-prim>=0.2 && <0.6, base => ghc-prim==0.6.1/installed-0.6.1)
[__3] rejecting: base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__3] fail (backjumping, conflict set: base, brok, text)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: brok, base, text, time
Try running with --minimize-conflict-set to improve the error message.

The command '/bin/sh -c cabal install brok' returned a non-zero code: 1

Running the install with --minimize-conflict-set resulted in the same error message.
The haskell used is the same docker image as when I use haskell:8 in case it matters.

Maybe it's something obvious for an experienced haskell developer, but I'm stuck here and also think the install via the haskell package manager should work out of the box, so I didn't try what happens with building by slack as an alternative

@smallhadroncollider
Copy link
Owner

I'll try and have a look into this. Docker and Cabal are not things I understand terribly well. I use Stack for all my builds, which avoids any dependency issues. But that's possibly harder to setup with Docker?

@smallhadroncollider
Copy link
Owner

Ah, I see. It's pulling GHC-8.10 which is still not widely supported by packages.

Update the first line of your Dockerfile to the following:

FROM haskell:8.8

@smallhadroncollider
Copy link
Owner

Here you go: https://github.com/smallhadroncollider/brok#docker

@hanfried
Copy link
Author

Thanks a lot and of course, it's good to have a documented docker usage.
It's a good idea not to random execute arbitrary code from the internet without a container (or reading/understanding the code upfront) and it also makes it easier to use it in a CI/CD pipeline (and indeed, here my intention was to link check before committing/merging a bookmarks file). This is even more true to a not so widespread language like haskell (that is also not so intuitive to read), but of course, dependency management is for every language a problem.

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

2 participants