cabal icon indicating copy to clipboard operation
cabal copied to clipboard

`cabal new-install --lib` adds process-1.6.5.1 to GHC's environment

Open trajafri opened this issue 5 years ago • 3 comments

Describe the bug Running cabal new-install --lib will silently add process-1.6.5.1 to GHC's environment listing. This causes issues with running new-install in the future:

To Reproduce

  1. Create a new cabal package (I used cabal init)
  2. cabal new-install --lib
  3. cabal new-install --lib

Step 3 should fail.

$ cabal init 
$ cabal new-install --lib
Resolving dependencies...
Up to date

$ cabal new-install --lib
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] trying: ghc-8.6.5/installed-8.6... (user goal)
[__2] next goal: process (user goal)
[__2] rejecting: process-1.6.5.1 (conflict: ghc =>
process==1.6.5.0/installed-1.6...)
[__2] rejecting: process-1.6.5.0/installed-1.6..., process-1.6.5.0,
process-1.6.4.0, process-1.6.3.0, process-1.6.2.0, process-1.6.1.0,
process-1.6.0.0, process-1.5.0.0, process-1.4.3.0, process-1.4.2.0,
process-1.4.1.0, process-1.4.0.0, process-1.3.0.0, process-1.2.3.0,
process-1.2.2.0, process-1.2.1.0, process-1.2.0.0, process-1.1.0.2,
process-1.1.0.1, process-1.1.0.0, process-1.0.1.5, process-1.0.1.4,
process-1.0.1.3, process-1.0.1.2, process-1.0.1.1, process-1.0.0.0 (constraint
from user target requires ==1.6.5.1)
[__2] fail (backjumping, conflict set: ghc, process)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, process, ghc, ghc:buildable

Expected behavior I am new to cabal so new-install failing to install tools like hlint was confusing. Thankfully, folks at #haskell were able to deduce what could have gone wrong.

System informataion

  • Operating system: Manjaro Linux x86_64
  • cabal: 2.4.1.0 , ghc versions: 8.6.5

Additional context In this case, the solution was to delete the process listing under environments/default

trajafri avatar Jul 28 '19 02:07 trajafri

/cc @typedrat

23Skidoo avatar Jul 29 '19 07:07 23Skidoo

There's not a satisfying answer here, since I'm currently rebuilding how the command works, but it should end up fixing this problem among many others. :)

Alexis Williams Sent from Polymail ( https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature )

On Mon, Jul 29th, 2019 at 12:16 AM, Mikhail Glushenkov [email protected] wrote:

/cc @typedrat ( https://github.com/typedrat )

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/haskell/cabal/issues/6165?email_source=notifications&email_token=AAICH7KCO7PGR6UEXN2RWJDQB2KOHA5CNFSM4IHLMNOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD272AAI#issuecomment-515874817 ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAICH7P2G3WEC7FNXT3GSR3QB2KOHANCNFSM4IHLMNOA ).

typedrat avatar Jul 29 '19 07:07 typedrat

This looks like a more egregious instance of #5559, which literally starts with: "Because new-install wants to keep every package that GHC bundles in the environment…". So, not sure if this ticket needs to be open. It's a good reproducer for #5559, though.

With GHC 9.0.2 and cabal 3.8 it fails with analogous error but for directory rather than process.

ulysses4ever avatar Oct 05 '22 13:10 ulysses4ever