typelead/etlas

Dependency resolution for "build" and "install" differs for some reason

JustusAdam opened this issue · 3 comments

This might actually be an issue with cabal itself, but for some reason executing etlas install (with and without --dependencies-only) works fine, whereas etlas build reports dependency resolution errors.

Reproduce

To clarify what I did

  1. I am using this repo
  2. in an etlas sandbox
  3. which pulls in this as an add-source dependency
  4. I installed the dependencies with etlas install --dependencies-only (that worked just fine)

However when I now try etlas build I get this:

Resolving dependencies...
etlas: Could not resolve dependencies:
trying: comonad-5.0.2 (dependency of ohua-jvm-integration-0.7.2)
next goal: semigroupoids (dependency of free-5.0.1)
rejecting: semigroupoids-5.2.1, semigroupoids-5.2, semigroupoids-5.1
(conflict: transformers-compat==0.6.1.6, semigroupoids =>
transformers-compat>=0.5 && <0.6)
rejecting: semigroupoids-5.0.1 (conflict: transformers-compat==0.6.1.6,
semigroupoids => transformers-compat>=0.3 && <0.6)
rejecting: semigroupoids-5.0.0.4, semigroupoids-5.0.0.3,
semigroupoids-5.0.0.2, semigroupoids-5.0.0.1, semigroupoids-5,
semigroupoids-4.3 (conflict: transformers-compat==0.6.1.6, semigroupoids =>
transformers-compat>=0.3 && <0.5)
rejecting: semigroupoids-4.2 (conflict: base-orphans==0.6, semigroupoids =>
base-orphans==0)
trying: semigroupoids-4.0.4
rejecting: semigroupoids-4.0.4:+comonad (conflict: comonad==5.0.2,
semigroupoids-4.0.4:comonad => comonad>=4 && <5)
rejecting: semigroupoids-4.0.4:-comonad (manual flag can only be changed
explicitly)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: ohua-jvm-integration, ohua-core

If, instead, I run etlas install it actually compiles the project just fine. This indicates to me that there's some discrepancy between the build and install command. I always thought that install was like configure + build + copy binaries, but it seems that is not the case.

Additional information

  • I just updated my etlas installation by removing all state (rm -rf ~/.eta ~/.etlas)
  • As well as removing the eta and eta-* binaries and etlas
  • Then I redownloaded etlas and ran etlas update
  • And finally I deleted all dist folders and sandboxes.
  • And I am running
    • etlas 1.3.0.0
    • eta 0.7.2b1 (rev fb8e6f4604e4b94d8d2dc01380256f9c8c28bced)

etlas-1.3.0.0 uses cabal's new-build system which maintains a Nix-like package store and removes the need for sandboxes or the concept of installing packages to a global package database. etlas build automatically installs dependencies into this store now, while etlas install continues to follow the old system. We will eventually deprecate this behavior and currently waiting to see how Cabal devs implement new-install.

You shouldn't have a reason to use etlas install with etlas-1.3.0.0 and above since etlas build + (optional cabal.project) file is all you need for most setups.

Above, running etlas install --dependencies-only permanently installs to the global package store which will mess up your local setup and quickly get you into dependency hell.

Ah, very nice. I had no idea. In the old versions it was still complaining that i have to install deps first.

I'll try that

@JustusAdam Last released etlas (1.5.0.0) already uses by default the nix-like package store so it is in sync with etlas build (no need for --dependencies-only) so i think we can close this.