Closed gromakovsky closed 6 years ago
We'll be looking into this.
Note that it's a better idea for repros to give a commit than a branch. Right now, the vanya branch is pointing at 6c109584a6a7f182334eedc79c063a591626cca9.
Also, as a side note: due to the extremely large number of extra-deps in this stack.yaml, I'd recommend moving over to a custom snapshot, which will allow for more precompiled cache usage.
I'm going to start a debug log in this comment. I'll be editing it as I move along.
My first step is to confirm that this bug reproduces with the Stack on master. Also, in order to avoid wasting lots of CPU cycles, I'm going to be using the following command as a replacement for step 3 above:
stack build --fast cardano-sl-txp --dry-run
This way I'll keep the same broken state between attempts to play with this bug. I'm also almost certainly going to throw in a --verbose
, and then begin adding a bunch of logInfo
calls to the Stack codebase to get more info on why it's decided to unregister the packages in question.
I'm still building the absolute latest master, but I've tested with:
Version 1.8.0, Git revision d20833a5c0d3b2b62495fb126ecfd8fdbf1f6864 (5895 commits) x86_64 hpack-0.28.2
I get the following output, indicating that the bug no longer exists:
$ stack build --fast cardano-sl-txp --dry-run
Warning: There were multiple candidates for the Cabal entry " hlint.hs
* /Users/michael/Documents/cardano-sl/.stack-work/downloaded/XTTklt4ROs4T/hlint.hs
picking:
/Users/michael/Documents/cardano-sl/.stack-work/downloaded/XTTklt4ROs4T/tests/hlint.hs
Would unregister locally:
cardano-sl-txp-1.2.0 (local file changes: src/Pos/Txp/Base.hs)
Would build:
cardano-sl-txp-1.2.0: database=local, source=/Users/michael/Documents/cardano-sl/txp/
No executables to be installed.
However, building with Stack 1.7.1 produces the same bug as reported here:
Meaning I'm fairly certain that this bug is already resolved on master. It will take more investigation to determine what change on master could have resolved this.
I couldn't fetch d20833a5c0d3b2b62495fb126ecfd8fdbf1f6864
, so I tried using its parent: dbc74ecce2e31b47626d87a1cf3ea6129fed1e99
.
d20833a5c0d3b2b62495fb126ecfd8fdbf1f6864
has only cosmetic changes, so it shouldn't matter.
For me it still unregisters packages that it shouldn't, here's the output of stack build --fast cardano-sl-txp --dry-run
: https://gist.github.com/gromakovsky/7ca7bac5b4f5fedaf269665985eadb5a
It might be helpful to have a minimum example, though it seems that might be tricky. Would you try to produce one, @gromakovsky?
I was successfully minimizing this example while keeping the bug reproducible, but then I did stack clean --full
and since then I can't reproduce this bug anymore, even when I return to where I started (6c109584a6a7f182334eedc79c063a591626cca9) and use the same version of stack
as before (681c800873816c022739ca7ed14755e85a579565) :man_shrugging:
Probably something bad appeared in .stack-work
, I don't know how :(
I suceeded to reproduce it using version 1.6.5 (revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9). I also minimized it as much as I could. Commit 571fd554b3e1613fc27e26563f4d9dee823b4de6 is the minimal example where the bug is present. It's a bit different though. Steps:
stack clean --full
.stack build --fast cardano-sl-core
.stack build --fast cardano-sl-core
again rebuilds hedgehog
and others.Commit adb0e36ab6be0d0f4c907d1b9fc866e67bcdf673 is the next one in the vanya
branch and there doing stack build --fast cardano-sl-core
again doesn't rebuild anything.
I stopped at that point.
Once again, after stack clean --full
the bug reproduces only with stack
revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9. I can't reproduce it using latest release or master anymore (I could before probably because I didn't do stack clean --full
).
OK, it's good that there's a resolution. Thank you for digging around (I editied your commit refs to links so I could follow them). I suspect you're right about something in the .stack-work
folder being a culprit — and the extra-deps appear to have contributed, too.
I'd recommend @snoyberg's advice: it is worth using a custom snapshot.
I'm going to close — do get in touch if there's anything else you'd need, on this.
General summary/comments (optional)
If I build one package, modify one file there and built it again, for some reason more than one package is rebuilt.
Steps to reproduce
Can be reproduced using this code: https://github.com/serokell/cardano-sl/tree/vanya (
serokell/cardano-sl
repository,vanya
branch).Build the
cardano-sl-txp
package:Modify some file:
Build
cardano-sl-txp
again:Expected
Only one file is recompiled and the command finishes quickly.
Actual
Stack decides to unregister
cardano-sl-core
,pretty-show
,cardano-sl-crypto-test
and some other packages. Then it builds these packages:Here is the output in
--verbose
mode: https://gist.github.com/gromakovsky/a23b77cb9bcf3cc0e415b9a65f5f422dStack version
Method of installation
I am using version 1.7.1 downloaded from https://github.com/commercialhaskell/stack/releases.