Fix for local dependency build issue#5613
Closed
drone29a wants to merge 1 commit into
Closed
Conversation
…nsumer would be installed in the package db for the consumer project but not its own package db.
Contributor
|
@drone-rites Thank you for this PR! By coincidence I was working on the the same bug when you filed #5680 and this PR was a great hint about where the problem was. Upon closer inspection it looks like this PR basically reverts the meat of f641880 (which I confirmed introduced this regression), so I think it would reintroduce the problem that commit was trying to solve (#5578). Therefore I'm going to close this PR. However, I've opened a new PR #5682 that I believe has a more complete fix; it basically keeps track of the last project from which a package was built and reconfigures the package if the project changes. Can you test #5682 to confirm that it also fixes your use case? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for bug where a local dependency that has been built from a local consumer project would be installed in the package db for the consumer project but not in the local dependency's own package db. This results in an error where ghc-pkg is unable to find the cached local package in its own package db and the build fails. This can be resolved by running
stack cleanand thenstack buildfor the local dependency, but then a build for the consumer of the package will fail as it tries to find the local dependency in its own package db. The only fix is then to again runstack cleanfor the local dependency and then runstack buildfor the consumer of the dependency.This fix is extremely simple: remove one line that modifies the setup-config file and causes the trouble. A more satisfying fix for this issue may be to figure out how to adjust the package db search so that cached builds can be used both by the local package and any consumers of the local package.
I'm happy to provide a simple repro case and a short message for the change log.