Skip to content
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

With stack head, repeated rebuild of dependency #4578

Closed
mgsloan opened this issue Feb 10, 2019 · 3 comments
Closed

With stack head, repeated rebuild of dependency #4578

mgsloan opened this issue Feb 10, 2019 · 3 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Feb 10, 2019

Similarly to #4566, I'm seeing rebuilds of my xmonad config in https://github.com/mgsloan/mgsloan-dotfiles . Specifically, rio gets unregistered and rebuilt which causes rebuild of the xmonad config.

Locally, I have two versions of stack:

mgsloan@treetop:~/env$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
mgsloan@treetop:~/env$ stack-head --version
Version 1.10.0, Git revision 4e56620615d31324a6abbba09b7de929d6fc56ac (6908 commits) x86_64 hpack-0.31.1

With stack-1.9.3, rebuild works fine:

mgsloan@treetop:~/env$ time stack build

real    0m0.582s
user    0m0.524s
sys     0m0.128s

Then, when I use stack-head build it rebuilds all local packages including rio:

mgsloan@treetop:~/env$ stack-head build
rio-0.1.8.0: unregistering
typed-process-0.2.3.0: unregistering (local file changes: /home/mgsloan/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/include/ghcversion.h /usr/incl...)
xmonad-0.15: unregistering (local file changes: CHANGES.md CONFIG Main.hs README.md STYLE man/xmonad.1 man/xmonad.1.html man/xmonad.1.markdown ma...)
xmonad-contrib-0.15: unregistering (missing dependencies: xmonad)
typed-process-0.2.3.0: configure (lib)
typed-process-0.2.3.0: build (lib)
errlog-filter-0.1.0.0: configure (exe)
typed-process-0.2.3.0: copy/register
errlog-filter-0.1.0.0: build (exe)
xmonad-0.15: configure (lib + exe)
xmonad-0.15: build (lib + exe)
rio-0.1.8.0: configure
errlog-filter-0.1.0.0: copy/register
rio-0.1.8.0: build
xmonad-0.15: copy/register
xmonad-contrib-0.15: configure (lib)
xmonad-contrib-0.15: build (lib)
xmonad-contrib-0.15: copy/register
rio-0.1.8.0: copy/register
xmonad-config-1.0: configure (exe)
xmonad-config-1.0: build (exe)
xmonad-config-1.0: copy/register
Completed 6 action(s).
Log files have been written to: /home/mgsloan/env/.stack-work/logs/

That's not ideal, but I suppose it's fine if it only happens when moving to the newer version. The issue is that subsequent rebuilds always unregister and rebuild rio:

mgsloan@treetop:~/env$ time stack-head build
rio-0.1.8.0: unregistering
rio-0.1.8.0: configure
rio-0.1.8.0: build
rio-0.1.8.0: copy/register
xmonad-config-1.0: configure (exe)
xmonad-config-1.0: build (exe)
xmonad-config-1.0: copy/register
Completed 2 action(s).
Log files have been written to: /home/mgsloan/env/.stack-work/logs/

real    0m11.454s
user    0m10.318s
sys     0m1.234s
@qrilka
Copy link
Contributor

qrilka commented Feb 10, 2019

@mgsloan I think this is a consequence of https://github.com/commercialhaskell/stack/blob/master/doc/build-overview.md#construct-build-plan as :

If a task depends exclusively on immutable packages, mark it as immutable. Otherwise, it's mutable.

It looks like check of project packages modification doesn't work properly so rio depending on typed-process as a project package in your https://github.com/mgsloan/mgsloan-dotfiles/blob/master/env/stack.yaml gets unregistered even without any changes in typed-process. I'll see if I could get a minimal reproduction so it will be easier to see what's going on

@mgsloan
Copy link
Contributor Author

mgsloan commented Feb 10, 2019

@qrilka The new names make sense (mutable database instead of local database). Yes, indeed rio is installed to the mutable database due to using a locally patched version of typed-process. However, no files are being changed yet rio is being rebuilt. A further puzzling thing here is that no reason is given for the dirtiness of the package. To me that seems to suggest that stack isn't aware that rio is already installed in the mutable database.

Thanks for looking into this!

@qrilka
Copy link
Contributor

qrilka commented Feb 11, 2019

Looks like just a stack new test-pkg rio + local checkout of typed-proces as a project package gives the same unregistering of rio and rebuilds, with that it should be easier to dig it deeper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants