help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove build


From: Leo Famulari
Subject: Re: Remove build
Date: Sat, 21 Aug 2021 17:04:54 -0400

On Sat, Aug 21, 2021 at 07:41:28PM +0200, excalamus--- via wrote:
> I'm trying to update stenography.scm to use a later version of plover.  I 
> made a few changes (given below), some appropriate, others not, and ran guix 
> build -K --file=xc.stenography.scm.  It built and runs directly from the 
> store.  Great.  I want to fix the inappropriate changes and create a proper 
> package.  But, how can I remove the build from the store?

In general, you delete things in the store like this:

------
$ guix gc --delete /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10
finding garbage collector roots...
[0 MiB] deleting '/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10'
deleting `/gnu/store/trash'
deleting unused links...
note: currently hard linking saves 5670.77 MiB
------

`guix gc` [0] is the *only* way to remove things from the store that is
okay. On certain configurations it may be possible to remove or edit
files in the store using other tools, but that's totally unsupported and
absolutely not recommended. The Guix model assumes that store items
(i.e. directories in /gnu/store) are immutable after building, and that
nothing except the guix-daemon can add or delete them.

Note that "removing builds" from the store is not necessary or even
useful for testing changes to package definitions. Every time a package
definition or dependency of a package is changed, building the package
will create a new store item.

> It looks like guix gc is what I need.  However, it won't delete store items 
> which are "live".  I understand "live" to mean "reachable from a root" where 
> a "root" is a symlink returned by guix gc --list-roots.  Checking the link 
> corresponding to my latest generation, the build isn't anywhere in bin.  I 
> expected this, as it wasn't packaged or added to a profile afaik.  The 
> symlinks in /var/guix/profiles/per-user/ahab/guix-profile-80-link/bin all 
> point toward the old version of plover.  

To clarify, are you saying that you tried to remove a store item using
`guix gc --delete` and that you could not? Despite not understanding why
the store item was alive?

For figuring out why something is alive, I would try something like
this, to see if any profiles refer to the store item:

------
guix gc --referrers /gnu/store/5l6zdapgxmcrs2sfldcf3m66dc8s0km9-borg-1.1.17 | 
grep profile
/gnu/store/2bcxm82ifky1115ydcrqh6pwqj7c5b6w-profile.drv                         
                     
/gnu/store/7qal71jjrfpav42m6zq8f3rn3wwf5blk-profile
/gnu/store/9qyjfvlhs77nrz26102kvz1lg4lncnp8-profile.drv
/gnu/store/bskv7y5x249mxh1bzyh8f63rqghsfzlw-profile
/gnu/store/j5hfn3f5ds4i3fy06mm5f71ymlprnxcm-profile
/gnu/store/n63rjvdy10f96wjxkg0fi528lrlinl0r-profile
/gnu/store/qym0jr3pak5svd8rn0n2c7psx3sfdj9p-profile.drv
------

It's not as good as a command that simply answered "why is X alive?"
Maybe there is a command line for that that I don't know about... help
wanted!

There is also `guix gc --list-live` although you'll want to filter or
save its output for inspection because it's kinda slow.

> Doing info-apropos within Emacs, I found the guix-store-item command.  It had 
> this tempting "delete" button which, as far as I could tell, was not 
> documented.  I pressed it.  To my surprise, it deleted the file.  Great.  But 
> the manual also says,
> 
> "removing files or directories manually may break it beyond repair!"
> 
> Have I borked my /gnu/store?  How can I, or could I have if it's too late, 
> removed the build?

I doubt it. It looks like emacs-guix does the right thing:

https://gitlab.com/emacs-guix/emacs-guix/-/blob/master/elisp/guix-ui-store-item.el#L146

Besides, on Guix System, the store is mounted read-only, and we try to
do the same on other distros if you use the installer script.

You could check more carefully by running `guix gc --verify`.

As you see, `guix gc` is the tool for interacting with the store.

Do these replies help at all? Please don't hesitate to ask follow-up
questions.

[0] https://guix.gnu.org/manual/en/html_node/Invoking-guix-gc.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]