-
Notifications
You must be signed in to change notification settings - Fork 848
Stack fails to build "mutually recursive" packages #2583
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
Comments
Just following up on this - is it a bug, or working as intended? |
Thanks a bunch for the report and repro! We do intend to support this usecase, not sure why it isn't working. |
No problem, and to clarify, is it actually a cycle that can't be built by On Sep 29, 2016 7:00 PM, "Michael Sloan" [email protected] wrote:
|
Hey @mitchellwrosen, sorry for the delay! I have committed a fix to the error reporting. Now the output looks like However, you are correct that this case is intended to work fine with stack. I wrote the code involved, and intended to address the problem soon. Marking it as a P1 bug. Thanks so much for the report and repro! |
Nice error message, and thanks! |
We actually only support such cycles for test-suites and benchmarks. I believe this is a limitation of the Cabal library, but I'm not 100% sure what limitations we'd run into. If I try using cabal-install, I get
|
It should be checked whether Cabal 2/new-build/Backpack support enables supporting this use-case, among other things. |
Here's another example project, for what it's worth: https://github.com/chris-martin/stack-cycle-issue It's the same thing, though I ran into it with a test suite rather than with an executable. Still getting the same ambiguous output:
|
Bump, just ran into this issue as well. @chris-martin's example code is an accurate reflection of what I encountered. Same error. Interestingly, stack will happily build/test either package in isolation, but chokes when asked to do both. $ stack test foo-a --dry-run # this is fine
$ stack test foo-b --dry-run # this is fine
$ stack test foo-a foo-b --dry-run # this is not fine
Error: While constructing the build plan, the following exceptions were
encountered:
Some different approaches to resolving this:
(...)
Plan construction failed.
$ stack --version
Version 1.9.0.1, Git revision a2489de02cb1c7d28b74c69bc66d2402268ccb0a (6123 commits) x86_64 hpack-0.31.0 |
I also encountered this with 1.9.3 — it isn't obvious why the DependencyCycle code isn’t kicking in, but the logs are particularly unhelpful, too. |
Indeed, when you have two packages
and you do
It says This is easy to reproduce by doing
|
@qrilka and me tried: When you have a cross-dependency of test and benchmark like this:
then it usually works when you use As soon as you use |
@mgsloan Do you know if this was ever working? (In other words, did intend here mean that it was working at some point and then it suddenly stopped, or did we only always want it to be working but we don't know if it did?) |
@mgsloan also, do you remember whether you believed this just for real |
We also found out that if you have a "wedge" dependency like this:
then this actually works:
As we can see, in this case stack first builds and registers libraries of So the build of
|
it appears that
and as a way to build Stackage snapshots with Stack for #4217 I'll need to address this issue as with all of the Stackage packages it's quite easy to get a cycle |
I've tried to add cycle resolution to
In any case we will need component-based build plans for Backpack support but that will come later in time. stack/subs/curator/build-constraints.yaml Line 4346 in 0615468
|
@nh2 even a "wedge" dependency could get into a problem if we'll take into account that tests (which probably get easier get to this situation than benchmarks) in
which isn't a cycle by itself as the links are directed. But Stack uses a bit of a hack as haskell/cabal#1575 is still not resolved after 5 years after initial filing and that hack results in multiple builds of |
Uh oh!
There was an error while loading. Please reload this page.
General summary/comments (optional)
I have a two-package project, where the library in package
two
depends on the library in packageone
.However, there's also an executable component in package
one
that depends on librarytwo
. For some reason, plan construction fails, even when I try to build single components.Steps to reproduce
git clone [email protected]:mitchellwrosen/stack-issue-1.git
stack build
Expected
Build succeeds
Actual
Build fails with:
Stack version
Version 1.2.1, Git revision 8ebadf3 (dirty) (4086 commits) x86_64 hpack-0.14.1
Method of installation
Built from source
The text was updated successfully, but these errors were encountered: