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

cabal new-install --lib lens fails #5888

Open
phadej opened this issue Feb 12, 2019 · 8 comments
Open

cabal new-install --lib lens fails #5888

phadej opened this issue Feb 12, 2019 · 8 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Feb 12, 2019

% cabal new-install --lib lens                               
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: binary-0.8.6.0 (user goal)
[__1] next goal: ghc (user goal)
[__1] rejecting: ghc-8.6.1 (constraint from user target requires ==8.4.4)
[__1] rejecting: ghc-8.4.4/installed-8.4... (conflict: binary==0.8.6.0, ghc =>
binary==0.8.5.1/installed-0.8...)
[__1] rejecting: ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1 (constraint from
user target requires ==8.4.4)
[__1] fail (backjumping, conflict set: binary, ghc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, ghc
@phadej
Copy link
Collaborator Author

phadej commented Feb 12, 2019

Ah, I have binary-0.8.6.0-222faad0b96ef53407dce965dc89112e160faf581189155f9f85c78ac94c8925 in '.ghc/x86_64-linux-8.4.4/environments/default`, how to remove it?

@phadej
Copy link
Collaborator Author

phadej commented Feb 12, 2019

I tried with a clean environment, installing lens (with ghc-8.4.4) there; why

package-id unix-2.7.2.2-953b32e4e99583a69a7d744cd659fdafb48201a0167b29e542dbaa31b66f98df
package-id binary-0.8.6.0-222faad0b96ef53407dce965dc89112e160faf581189155f9f85c78ac94c8925
package-id text-1.2.3.1-30c2d2c5658da41475e0d6ff2b03e5f0a3d2125cb0e7e1cd1cfe1d5d1d7312f6
package-id lens-4.17-82c556af7bbffe41e3c93fa447e77117b4711e6322f3d7dd7f2feb4e0de29dab

pops into that environment? It doesn't make sense to me. If I try later to install something in that environment, it will fail as above.

@hvr
Copy link
Member

hvr commented Feb 12, 2019

Isn't this basically #5559 ?

@phadej
Copy link
Collaborator Author

phadej commented Feb 12, 2019

This turns out to be a little different:

[FL973] ~ % rm -rf ~/.ghc/x86_64-linux-8.4.4/environments
[FL973] ~ % cabal new-install --lib lens
Resolving dependencies...
Up to date
[FL973] ~ % cabal new-install --lib lens
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: binary-0.8.6.0 (user goal)
[__1] next goal: ghc (user goal)
[__1] rejecting: ghc-8.6.1 (constraint from user target requires ==8.4.4)
[__1] rejecting: ghc-8.4.4/installed-8.4... (conflict: binary==0.8.6.0, ghc =>
binary==0.8.5.1/installed-0.8...)
[__1] rejecting: ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1 (constraint from
user target requires ==8.4.4)
[__1] fail (backjumping, conflict set: binary, ghc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, ghc

I'd expect new-install --lib foo to be idempotent.

@hvr
Copy link
Member

hvr commented Feb 12, 2019

The failure of cabal v2-install --lib foo to be idempotent is a symptom of #5559 too... which is why #5559 is high-prio :-)

cc @typedrat

@gbaz
Copy link
Collaborator

gbaz commented Feb 12, 2019

Just ran into on IRC someone with this as well -- in that case they ran new-install on a lib, just to test building it, and later tried to new-install the ghcid binary, and got a weird constraint error. I think at a minimum, new-installing a binary should just not make use of any ambient env files, since the user doesn't care about putting that into a consistent store, just getting the working executable.

Further, I think that we should have, absent any fancy heuristics, at least just a good check and warning if there's env-file induced constraints causing a failure, so it can direct users to the source of the problem immediately.

@hvr
Copy link
Member

hvr commented Feb 12, 2019

@gbaz do we have a repro for env files affecting v2-install of executables? So far I was only aware that (by design) an in-scope cabal.project file will affect v2-install, but not that environments would be picked up.

@jneira
Copy link
Member

jneira commented Mar 30, 2022

So is not this a manifestation of #5559 at the end?, maybe we should bring them together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants