commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.95k stars 842 forks source link

Circular dependencies no longer working #3892

Open tswelsh opened 6 years ago

tswelsh commented 6 years ago

General summary/comments (optional)

We have a project with package A that exposes a library and has a test module. Package B depends on A and exposes a library that is used by A's test suite (the reason for this is that package B is used by other packages). So there is a circularish dependency going on, which works when building with GHC 8.0.2 but not GHC 8.2.2. Not sure if this is stack or cabal or GHC or what, but I thought that stack has code to deal with this situation (checking whether it can do an all in one build, I think?), so perhaps something changed in GHC or cabal that stops it from working.

Steps to reproduce

Minimal example here: https://github.com/dten/CouldntMatchTypeRepro. Changing the resolver in the stack.yaml between LTS 9 and LTS 10 exhibits the change in behaviour.

Expected

stack builds the project regardless of LTS.

Actual

A configuration that uses GHC 8.2.2 fails to build the project.

Stack version

$ stack --version
Version 1.7.0, Git revision a6ae6a51e1b0b12c37786c27bdd3e0a7e9497c03 (dirty) (5697 commits) x86_64 hpack-0.21.2

Method of installation

Built from master.

tswelsh commented 6 years ago

Building with -v shows that stack is constructing the same build plan in both cases, and executing the plan in the same way. So it looks like an upstream change. The next place to poke around in is probably the cabal layer to look for a change from 1.24.2 to 2.0.1, I might take a look at that another day.

mgsloan commented 6 years ago

Thanks for investigating deeply, it may be worth opening up an issue on the cabal tracker for this.