-
Notifications
You must be signed in to change notification settings - Fork 843
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
Packages shared between multiples projects aren't rebuilt #3130
Comments
Thanks for the report! This is a similar issue as #2904 . The solution there was to unregister downstream packages when rebuilding The only straightforward solution to this that comes to mind is putting the path to the project's root directory (location of stack.yaml) into the ConfigCache. This would force rebuild whenever switching the location of project configurations. Does that seem like reasonable behavior? I think it's safe to use the project dir, as in the case of configurations that share the same root directory, if they also share the same dist path, then they will also be sharing the same package DB, and |
I don't know enough about Stack's internals, but that sounds good to me. |
This issue has been a development pain point for a while, and today I experienced a production issue because one of the downstream dependencies wasn't built properly due to not picking up a shared change. Is there any way I can help accelerate this? Thanks! |
Would be nice to track this bug down the codebase and see what causes it. |
I think @mgsloan described above what needs to happen--if a Stack developer gave me an outline of what to do I could take a stab at it? |
Yes, he did, I see it now, but that was a year ago and the code has changed (probably not by much). |
AFAIK the code has not changed much in this respect. However, the solution I described earlier seems like a hack - what is so special about a change in Instead I think there needs to be a mechanism to record which package DBs a local package has been installed to. I think the issue here might be that the build of the package is correct and matches what both configurations want, but it's only installed to one DB - the other has the older install. Sorry for the vagueness, but it has been a while since I've looked at this, and generally my in-brain cache of info about stack is not quite as populated as it once was. I hope someone with a more up-to-date cache can comment and provide guidance. |
Speaking as someone totally unfamiliar with Stack internals -- could the downstream dependencies simply check the hash of the package that they have installed against the latest-built hash of the local package? (Assuming that Stack uses hashes to keep track of build products...) |
@mgsloan thanks for your help. One more question, do you know who would be best to ping about this? :) |
@thomasjm No problem! Seems like @mihaimaruseac and @snoyberg are good folks to ping about this. Indeed, I agree that this is a pretty gnarly correctness flaw and I hope it gets resolved cleanly. |
I'll need to learn more about that part of the build plan code but will try to help if there are questions. |
I'm reviewing issues now, but I'd be happy to advise on this @thomasjm if you're still interested. |
I would like to see this fixed. If you can point me in the right direction I'd be happy to take a look @snoyberg ? |
I'd start by adding the appropriate field for project root to the |
I have not been bitten by this bug recently, but I was combing through old issues and figured I'd see if this was still an issue with Stack 2.1.3. Unfortunately it still is 😢 |
This issue seems to have changed slightly in 2.1.3. Instead of silently getting a stale package, I'm now seeing builds fail completely with |
Sorry, this is a weird one 🙂
Let's say you have 3 packages:
a
,b
, andc
. Botha
andb
depend onc
. Furthermore,a
andb
are in separate Stack projects. Both specifyc
as a package in their project. This makesc
a shared package betweena
andb
.If you build
a
, it will of course buildc
. Then make a change toc
and buildb
, which will re-buildc
. Finally re-builda
. I would expect that to re-build (or at least re-link)c
but instead it does nothing. This means thatb
has the newc
buta
has the oldc
.Here's exactly how to reproduce:
The text was updated successfully, but these errors were encountered: