Versioning conflict on using some dependencies

There it is some way to use dependencies without conflict problems? I was trying to use cloud haskell or tensorflow. Any of these even when trying to cabal build or stack build in a fresh project came with version conflicts.

Hello Vitor, can you paste the error you got?

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: test-tensorflow-0.1.0.0 (user goal)
[__1] trying: tensorflow-0.2.0.1 (dependency of test-tensorflow)
[__2] trying: tensorflow-proto-0.2.0.1 (dependency of tensorflow)
[__3] next goal: proto-lens-runtime (dependency of tensorflow-proto)
[__3] rejecting: proto-lens-runtime-0.7.0.5 (conflict: tensorflow-proto =>
proto-lens-runtime>=0.4.0 && <0.6.0)
[__3] skipping: proto-lens-runtime-0.7.0.4, proto-lens-runtime-0.7.0.3,
proto-lens-runtime-0.7.0.2, proto-lens-runtime-0.7.0.1,
proto-lens-runtime-0.7.0.0, proto-lens-runtime-0.6.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=0.4.0 && <0.6.0' from 'tensorflow-proto')
[__3] trying: proto-lens-runtime-0.5.0.0
[__4] next goal: base (dependency of test-tensorflow)
[__4] rejecting: base-4.19.0.0/installed-e537 (conflict: proto-lens-runtime =>
base>=4.9 && <4.13)
[__4] skipping: base-4.19.0.0, base-4.18.2.0, base-4.18.1.0, base-4.18.0.0,
base-4.17.2.1, base-4.17.2.0, base-4.17.1.0, base-4.17.0.0, base-4.16.4.0,
base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0, base-4.15.1.0,
base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0,
base-4.13.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=4.9 && <4.13' from 'proto-lens-runtime')
[__4] rejecting: 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)
[__4] fail (backjumping, conflict set: base, proto-lens-runtime,
test-tensorflow)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, proto-lens-protoc,
tensorflow-proto, proto-lens-runtime, tensorflow, test-tensorflow
Try running with --minimize-conflict-set to improve the error message.

In this case I’m using cabal 3.10 and GHC 9.8.1 (I don’t know if is common to use the latest version here in haskell)

Some of it bit-rot. Try cabal build --allow-newer.

--allow-newer ignores upper bounds of dependencies. If compiling works, you could also open a ticket to let maintainer know.

Save for (a) a bug in package c2hs-0.28.6 (b) a missing tensorflow C library (c) problems with the package itself using the tensorflow 1.14.0 C library, I could build tensorflow-0.2.0.1 on Windows 11 with Stack and project-level configuation:

snapshot: lts-14.27 # GHC 8.6.5
extra-deps:
- proto-lens-0.5.1.0@sha256:d959c40aabda1ab208a64b0c5abb5519e7956b665275b38beb4c812f51f95987,3266
- tensorflow-proto-0.2.0.1@sha256:843eb75f1b4eff7892208f1e800cd7dd3f9e01b1526b8a2855f6f702d87aef43,12225
- c2hs-0.28.8@sha256:c399132e2273e70770be403fba4795d7d8c60d7bd147f0ef174342bebbd44392,9397
extra-include-dirs:
- D:\Users\mike\Code\C\libtensorflow-cpu-windows-x86_64-1.14.0\include
extra-lib-dirs:
- D:\Users\mike\Code\C\libtensorflow-cpu-windows-x86_64-1.14.0\lib

lts-14.27 was picked because Stack advised with the most recent LTS snapshot:

In the dependencies for proto-lens-0.5.1.0:
  * base must match >=4.9 && <4.13, but base-4.18.2.0 is in the Stack configuration
    (latest matching version is 4.12.0.0).

I needed, however, to edit the package (module TensorFlow.Internal.Raw) to replace a number of references to CULong with CULLong (as advised by GHC).

1 Like

Hey, that’s works nice! Now is just problems with M1 mac or packages that is not installed on my computer. Thanks!! :grinning_face_with_smiling_eyes:

1 Like