Skip to content

Conversation

@drone29a
Copy link

@drone29a drone29a commented Aug 27, 2021

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 clean and then stack build for 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 run stack clean for the local dependency and then run stack build for 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.

  • Any changes that could be relevant to users have been recorded in the ChangeLog.md
  • The documentation has been updated, if necessary.

…nsumer would be installed in the package db for the consumer project but not its own package db.
@borsboom
Copy link
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?

@borsboom borsboom closed this Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants