Skip to content

Mysterious user goal dependency added #7356

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

Open
JosephLucas opened this issue Apr 12, 2021 · 1 comment
Open

Mysterious user goal dependency added #7356

JosephLucas opened this issue Apr 12, 2021 · 1 comment

Comments

@JosephLucas
Copy link

JosephLucas commented Apr 12, 2021

On NixOS, running cabal build tries to resolve a mysterious dependency (user goal) from a previous project.

To Reproduce

(with probably a local state somewhere : not ~/.{ghc,cabal,ghci}

mkdir new-project
cd new-project
cabal init
cabal build

I get

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: B-0.0.0 (user goal)
[__1] unknown package: p1 (dependency of B)
[__1] fail (backjumping, conflict set: B, p1)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: B, p1

B and p1 are previous package/libraries that I built successfully in another multi-project

Expected behavior
I do not expect B and p1 here, since they are not in the current project dependencies.

System information

  • NixOS
  • cabal version 3.4.0.0, ghc ersion 8.8.4

FIX:

Adding a cabal.project file with

optional-packages:
  *
write-ghc-environment-files: never

Fixes the issue. The issue may thus be caused by ghc-environment-files written by cabal run.

@fgaz
Copy link
Member

fgaz commented Apr 12, 2021

Could there be a cabal.project or cabal.project.* file in an upper directory? The environment file shouldn't have an effect

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