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

mark executable-only packages as installed when copied from cache #1043

Merged
merged 1 commit into from
Sep 27, 2015

Conversation

ljli
Copy link
Contributor

@ljli ljli commented Sep 24, 2015

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:

case (mlib, exes) of
    (Nothing, _:_) -> markExeInstalled (taskLocation task) taskProvides
    _ -> return ()

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.

@snoyberg
Copy link
Contributor

Actually, your other approach of calling markExeInstalled looks much better to me. Would you be able to update this PR to use that instead?

@ljli
Copy link
Contributor Author

ljli commented Sep 25, 2015

Done, thanks for the feedback!

@ljli ljli changed the title dont cache executable only packages mark executable-only packages as installed when copied from cache Sep 25, 2015
@snoyberg
Copy link
Contributor

Thanks!

@snoyberg snoyberg merged commit 2f3b8bc into commercialhaskell:master Sep 27, 2015
snoyberg added a commit that referenced this pull request Sep 27, 2015
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