mark executable-only packages as installed when copied from cache #1043
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.
Executable only packages don't get an entry in the pkgdb. Instead stack marks them via a dummy file in installed-packages. If a package is copied from another snapshot it gets registered if it has library, but when it has not the binaries are copied but the snapshot, which they are copied to doesn't get to know this. That means every time you do stack build they get copied again. That alone isn't a big problem, but they can trigger rebuilds of other packages, which can get out of hand. A solution would be to mark them as installed. Writing this in copyPreCompiled does the trick:
But I wasn't sure about the full implications of this. So I opted for simply not caching them instead. The downside is that people who already cached executable-only packages need to nuke them manually from the cache.