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
Benchmarks fail due to "shadowed dependencies" #2781
Comments
@lehins pointed this out to me. I'm looking at logs that look like this:
And then the shadowing messages. From what I can see, there's nothing we can do in Stack to work around this. It seems like:
I could be mistaken, perhaps something else it happening. But it looks like the only solution will be switching to Cabal 2.0 and using the componentized configuration, which allows for not rebuilding a library. |
I have a different problem the shadowing:
EDIT: with nightly-2017-09-03 (ghc 8.2) |
@alexkazik I stumble upon exactly the same issue recently, which only happens for me with ghc-8.2 (current nightly snapshot), but not ghc-8.0. Naturally cabal versions used are also different. |
@snoyberg Just in case, here are the steps using massiv library that reliably replicate the issue:
|
FWIW, I'm now seeing this bug very regularly, with GHC 8.2 on Windows. Things like touching the cabal file sometimes work, but are far from reliable in my experience. |
I received a similar bug report from a new Yesod users who was using Haskell Platform and cabal-install. I'm concerned that it may be a regression in Cabal 2.0. I'll try to repro this tomorrow. My goal is to get a minimal case and then test it with both cabal-install and plain old |
I've created a minimal reproducing case for this: https://github.com/snoyberg/stack-issue-2781 I'm going to see if I can further reproduce this using just the |
For info, I've had this happen with benchmarks and test suites disabled, so just running |
I was able to reproduce this with just the |
@ndmitchell I just tried simplifying my repro to not use the benchmark and was unable to reproduce. If you have thoughts on how to simplify it, please do take a crack at it, I'm sure it will help the debugging. |
While I see it semi-regularly, I never figured out a pattern, so no suggestions I'm afraid. |
I've definitely started running into this issue quite a bit since upgrading to GHC 8.2 |
I have a hunch that using |
... or having snapshot package depending on local package |
and specifying |
Regarding the life story of cabal-repro.sh:
I don't know what you should make of it. If you configure a package, and change something in the environment, then come back to resume building—but you don't reconfigure—this sounds like obviously risky to me. But maybe you have a need for it, and you could say that Cabal and GHC are being too paranoid. Or you could cherish this basic conservative sanity check and call it "this is not a bug, this is a feature". Or maybe a bit of both---perhaps configure time is too early to record other packages' ABI hashes, perhaps build time is better. I do not know Stack and I do not know the life story of repro.sh. |
Note that the Cabal ticket says that only the full platform is affected, and only on non-Windows. Given I'm getting this issue from Windows with Stack using the raw GHC then either they've misdiagnosed the issue, or there are multiple issues causing the same error message. |
Thanks for the analysis @treblacy. This is in line with @ezyang's comment here: haskell/cabal#4728 (comment). The problem seems to be that Cabal's otherwise-working auto-reconfigure logic isn't kicking in. And Stack isn't noticing that it should force a reconfigure since the package ID hasn't changed. (Side note: this is another reason I think the change to semantics for package IDs to be the same as package keys is a really bad idea. AFAICT, it's the root cause of this bug in Cabal.) Anyway, the workaround is somewhat painless: for each package we build, track if any of its dependencies need to be built as well, and in such a case force a reconfigure, even though none of the flags to |
Force reconfigure when deps are rebuilt #2781
Merged to master, closing. |
Note this is hitting real commercial users on a daily basis, so might deserve a quick point release. |
@snoyberg does this resolve the issue I reported, or "some other issue with shadowed dependencies"? |
@crockeea AFAIK, it solves your issue. If it doesn't, please say so. @ndmitchell We're in the middle of putting together a prerelease announcement for Stack 1.6.0, which will include this fix. It would be great if you'd be able to test that release (or just do a |
The prerelease can be binary installed with
Would be useful to document this at the top of the prerelease description. |
I'm still getting shadowed dependencies on my build at work. I'm on stack 1.6.3 which I'd thought had the workaround. (Workaround merged Oct 21, stack 1.6.3 released Dec 23.) |
@ghorn It does have it. While ideally this'd never be necessary, maybe there is some lingering brokenness in your package DBs, perhaps try renaming ~/.stack (can copy or move ~/.stack/programs to avoid redownloading ghc), and also renaming your project's .stack-work. Then can try a rebuild. If that doesn't fix it, then can delete the new dirs and rename the old ones back so that you haven't blown away your package caches. Might be interesting to try |
Just want to say that with stack 1.6.5, GHC 8.2.2, cabal 1.24.0.2, on Mac OSX, this is happening to me. No reconfiguration step involved. My overall setup is very much like @alexkazik 's. Edit:
|
This problem is described in a Stackage Server issue, but the problem should really be reported here. The problem is this:
library a
library b depends on a
benchmarks for library a depend on a and b
stack bench a
results in the error:Note that the benchmarks compile if a-benches only depends on a or b, but not both. I don't see any reason why the benchmarks should fail to compile when they depend on both a and b; it's clear what the compilation order should be.
As indicated in the Stackage Server issue, this problem affects many packages including
A minimal example is in shadowed-deps.tar.gz.
The text was updated successfully, but these errors were encountered: