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

Snapshot cross sharing and cleanup #1847

Closed
harendra-kumar opened this issue Feb 27, 2016 · 3 comments
Closed

Snapshot cross sharing and cleanup #1847

harendra-kumar opened this issue Feb 27, 2016 · 3 comments

Comments

@harendra-kumar
Copy link
Collaborator

I don't know of any good ways to clean up the snapshots to free space. So I just rm -rfd the snapshot directories for some snapshots. But that played havoc as I started seeing strange errors even for the remaining snapshots. I had to use ghc-pkg check/unregister for the errors to go away. I guess that might be due to cross sharing of packages across snapshots.

I have two questions:

  1. I found stack rm command #133 for cleanup but that's not yet implemented. Until some cleanup command is implemented what is the recommended way to cleanup snapshots and reclaim space?

  2. I don't know how the cross sharing works but is it possible to make every snapshot self contained so that removal of one does not affect the other? If the sharing is file level then hard linking should be sufficient. What are the issues involved in making snapshots self contained?

@harendra-kumar
Copy link
Collaborator Author

One of the errors that I saw goes like this:

Failed to load interface for ‘Data.Orphans’
Perhaps you haven't installed the "dyn" libraries for package ‘base-orphans-0.5.1’?
Use -v to see a list of the files searched for.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 27, 2016

It would be great to implement something like #133, particularly if it's able to remove snapshots based on which ones were recently used / based on interactive user selection. We're hoping to implement #1265 and related issues soon, and being able to free up storage occupied by old snapshots is required for doing that.

  1. I found stack rm command #133 for cleanup but that's not yet implemented. Until some cleanup command is implemented what is the recommended way to cleanup snapshots and reclaim space?

The best way to do this right now is to delete all the snapshots that use the same GHC version. The other snapshots are guaranteed to not have sharing if the GHC version differs.

  1. I don't know how the cross sharing works but is it possible to make every snapshot self contained so that removal of one does not affect the other? If the sharing is file level then hard linking should be sufficient. What are the issues involved in making snapshots self contained?

I don't recall whether installed packages are relocatable or not. Even if they are, we cannot use hardlinks on windows.

#133 is still feasible even if installed packages are not relocatable. We just need to leave them where they are, and delete everything that isn't shared with other snapshots.

@harendra-kumar
Copy link
Collaborator Author

We just need to leave them where they are, and delete everything that isn't shared with other snapshots.

Except that it will let the directories live (potentially forever) even after we have deleted the old snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants