unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Leo Famulari <leo@famulari.name>
To: excalamus--- via <help-guix@gnu.org>
Subject: Re: Remove build
Date: Sat, 21 Aug 2021 17:04:54 -0400	[thread overview]
Message-ID: <YSFqdnQ0jWQf99Hp@jasmine.lan> (raw)
In-Reply-To: <MhdnOkT--3-2@tutanota.com>

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	other threads:[~2021-08-21 21:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 17:41 Remove build excalamus--- via
2021-08-21 21:04 ` Leo Famulari [this message]
2021-08-22 13:26 ` excalamus--- via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YSFqdnQ0jWQf99Hp@jasmine.lan \
    --to=leo@famulari.name \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).