-
Notifications
You must be signed in to change notification settings - Fork 697
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 looks inside subdirectories, but only with later GHC #6739
Comments
default cabal.project is
packages: *.cabal
optional-packages: */*.cabal
I propose removing the optional packages. They are there since added by @dcoutts, but this is not the first time someone is confused by this implicit (and questionably convenient) behavior.
My rationalization is: if you work on multiple package-project adding a `cabal.project` is a small (and expected) thing to do. Implicit configuration is better to be as minimal as possible. `optional-packages: */*.cabal` assumes that people would add/remove some (temporary?) vendored-in dependencies which is just speculation.
The patch should be simple to write, PR is welcome.
Workaround: add cabal.project which is just
packages: .
… On 25. Apr 2020, at 18.47, tomjaguarpaw ***@***.***> wrote:
Describe the bug
I have a "top-level" directory that contains opaleye.cabal. The directory contains a subdirectory called opaleye-sqlite which contains opaleye-sqlite.cabal. The latter is, by design, not buildable.
If I run cabal v2-configure --with-ghc=<8.4.4> then all is well. It builds opaleye.cabal as expected.
If I run cabal v2-configure --with-ghc=<8.6.5> then it also tries to build opaleye-sqlite.cabal. I don't want it to! The build fails, as expected.
...
cabal: Could not resolve dependencies:
[__0] trying: opaleye-0.6.7004.2 (user goal)
[__1] trying: transformers-0.5.6.2/installed-0.5.6.2 (dependency of opaleye)
[__2] trying: contravariant-1.5.2 (dependency of opaleye)
[__3] trying: base-4.12.0.0/installed-4.12.0.0 (dependency of opaleye)
[__4] next goal: opaleye-sqlite (user goal)
[__4] rejecting: opaleye-sqlite-0.0.1.0 (conflict: contravariant==1.5.2,
opaleye-sqlite => contravariant>=1.2 && <1.5)
[__4] skipping: opaleye-sqlite-0.0.0.1, opaleye-sqlite-0.0.0.0 (has the same
characteristics that caused the previous version to fail: excludes
'contravariant' version 1.5.2)
[__4] fail (backjumping, conflict set: contravariant, opaleye-sqlite)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: contravariant, transformers, base,
opaleye, opaleye-sqlite
Try running with --minimize-conflict-set to improve the error message.
To Reproduce
Clone Opaleye from https://github.com/tomjaguarpaw/haskell-opaleye
Run cabal v2-configure --with-ghc=<your GHC 8.4.4>. It will succeed.
Run cabal v2-configure --with-ghc=<your GHC 8.6.5>. It will fail with the error above.
rm opaleye-sqlite/opaleye-sqlite.cabal
Run cabal v2-configure --with-ghc=<your GHC 8.6.5>. It will succeed, because it no longer tries to build opaleye-sqlite/opaleye-sqlite.cabal.
Expected behavior
I expected that when using GHC 8.6.5 it only try to build opaleye.cabal (like it did with GHC 8.4.4) not opaleye-sqlite/opaleye-sqlite.cabal too.
It seems to be looking into subdirectories, and I'm not sure why. I'm also not sure why this depends on GHC version!
System information
Debian Linux 10.3, cabal 3.2.0.0 via ghcp, ghc 8.4.4 from Debian, ghc 8.6.5 from ghcup
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I can confirm that your workaround works. Thank you! I was so confused. Could you clarify a few things for me?
|
I can confirm this behavior and it was indeed the primary source of confusion. |
And to explain the behavior: default build target is `.` (iirc it was `all` which was found not so nice as well), so when install plan is found for all packages it looks like only the root one is taken into account.
… On 25. Apr 2020, at 18.47, tomjaguarpaw ***@***.***> wrote:
Describe the bug
I have a "top-level" directory that contains opaleye.cabal. The directory contains a subdirectory called opaleye-sqlite which contains opaleye-sqlite.cabal. The latter is, by design, not buildable.
If I run cabal v2-configure --with-ghc=<8.4.4> then all is well. It builds opaleye.cabal as expected.
If I run cabal v2-configure --with-ghc=<8.6.5> then it also tries to build opaleye-sqlite.cabal. I don't want it to! The build fails, as expected.
...
cabal: Could not resolve dependencies:
[__0] trying: opaleye-0.6.7004.2 (user goal)
[__1] trying: transformers-0.5.6.2/installed-0.5.6.2 (dependency of opaleye)
[__2] trying: contravariant-1.5.2 (dependency of opaleye)
[__3] trying: base-4.12.0.0/installed-4.12.0.0 (dependency of opaleye)
[__4] next goal: opaleye-sqlite (user goal)
[__4] rejecting: opaleye-sqlite-0.0.1.0 (conflict: contravariant==1.5.2,
opaleye-sqlite => contravariant>=1.2 && <1.5)
[__4] skipping: opaleye-sqlite-0.0.0.1, opaleye-sqlite-0.0.0.0 (has the same
characteristics that caused the previous version to fail: excludes
'contravariant' version 1.5.2)
[__4] fail (backjumping, conflict set: contravariant, opaleye-sqlite)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: contravariant, transformers, base,
opaleye, opaleye-sqlite
Try running with --minimize-conflict-set to improve the error message.
To Reproduce
Clone Opaleye from https://github.com/tomjaguarpaw/haskell-opaleye
Run cabal v2-configure --with-ghc=<your GHC 8.4.4>. It will succeed.
Run cabal v2-configure --with-ghc=<your GHC 8.6.5>. It will fail with the error above.
rm opaleye-sqlite/opaleye-sqlite.cabal
Run cabal v2-configure --with-ghc=<your GHC 8.6.5>. It will succeed, because it no longer tries to build opaleye-sqlite/opaleye-sqlite.cabal.
Expected behavior
I expected that when using GHC 8.6.5 it only try to build opaleye.cabal (like it did with GHC 8.4.4) not opaleye-sqlite/opaleye-sqlite.cabal too.
It seems to be looking into subdirectories, and I'm not sure why. I'm also not sure why this depends on GHC version!
System information
Debian Linux 10.3, cabal 3.2.0.0 via ghcp, ghc 8.4.4 from Debian, ghc 8.6.5 from ghcup
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I still don't understand. How does that cause a difference between two GHC versions? |
https://matrix.hackage.haskell.org/#/package/contravariant is a hint.
With older GHC opaleye-sqlite constraints don’t cause solver error.
…Sent from my iPhone
On 25. Apr 2020, at 19.43, tomjaguarpaw ***@***.***> wrote:
I still don't understand. How does that cause a difference between two GHC versions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ah, very interesting! I didn't even consider the possibility that it was correct behaviour all along! Thanks, your explanations have been very helpful. |
Describe the bug
I have a "top-level" directory that contains
opaleye.cabal
. The directory contains a subdirectory calledopaleye-sqlite
which containsopaleye-sqlite.cabal
. The latter is, by design, not buildable.If I run
cabal v2-configure --with-ghc=<8.4.4>
then all is well. It buildsopaleye.cabal
as expected.If I run
cabal v2-configure --with-ghc=<8.6.5>
then it also tries to buildopaleye-sqlite.cabal
. I don't want it to! The build fails, as expected.To Reproduce
cabal v2-configure --with-ghc=<your GHC 8.4.4>
. It will succeed.cabal v2-configure --with-ghc=<your GHC 8.6.5>
. It will fail with the error above.rm opaleye-sqlite/opaleye-sqlite.cabal
cabal v2-configure --with-ghc=<your GHC 8.6.5>
. It will succeed, because it no longer tries to buildopaleye-sqlite/opaleye-sqlite.cabal
.Expected behavior
I expected that when using GHC 8.6.5 it only try to build
opaleye.cabal
(like it did with GHC 8.4.4) notopaleye-sqlite/opaleye-sqlite.cabal
too.It seems to be looking into subdirectories, and I'm not sure why. I'm also not sure why this depends on GHC version!
System information
Debian Linux 10.3,
cabal
3.2.0.0 via ghcp,ghc
8.4.4 from Debian,ghc
8.6.5 from ghcupThe text was updated successfully, but these errors were encountered: