unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Remove build
@ 2021-08-21 17:41 excalamus--- via
  2021-08-21 21:04 ` Leo Famulari
  2021-08-22 13:26 ` excalamus--- via
  0 siblings, 2 replies; 3+ messages in thread
From: excalamus--- via @ 2021-08-21 17:41 UTC (permalink / raw)
  To: Help Guix

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?

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.  

ahab@pequod /var/guix/profiles/per-user/ahab/guix-profile-80-link$ fd -L plover
share/doc/plover-4.0.0.dev8
bin/plover
lib/python3.8/site-packages/plover-4.0.0.dev8-py3.8.egg-info
lib/python3.8/site-packages/plover
lib/python3.8/site-packages/plover/gui_qt/messages/plover.pot
lib/python3.8/site-packages/plover/gui_qt/resources/plover.png
lib/python3.8/site-packages/plover/gui_qt/messages/fr/LC_MESSAGES/plover.po
lib/python3.8/site-packages/plover/assets/plover.ico
lib/python3.8/site-packages/plover/assets/plover-icon.svg
lib/python3.8/site-packages/plover/assets/plover.png
lib/python3.8/site-packages/plover_build_utils

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?

*** /home/ahab/Projects/my_plover/xc.stenography.scm    2021-08-21 12:19:46.512876928 -0400
--- /home/ahab/.config/guix/current/share/guile/site/3.0/gnu/packages/stenography.scm    1969-12-31 19:00:01.000000000 -0500
***************
*** 17,23 ****
  ;;; You should have received a copy of the GNU General Public License
  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
  
! (define-module (plover)
    #:use-module (guix build-system python)
    #:use-module (guix git-download)
    #:use-module ((guix licenses) #:prefix license:)
--- 17,23 ----
  ;;; You should have received a copy of the GNU General Public License
  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
  
! (define-module (gnu packages stenography)
    #:use-module (guix build-system python)
    #:use-module (guix git-download)
    #:use-module ((guix licenses) #:prefix license:)
***************
*** 30,48 ****
    #:use-module (gnu packages python-xyz)
    #:use-module (gnu packages wxwidgets))
  
! (define-public xc/plover
    (package
      (name "plover")
!     (version "4.0.0.dev10")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
!          (url "https://github.com/openstenoproject/plover")
!          (commit (string-append "v" version))))
         (file-name (git-file-name name version))
         (sha256
!     (base32 "1nyllqv4jq4idgn4cp5mypransw3rh3x8c1h9p6ld1anfr3zx7m0"))))
      (build-system python-build-system)
      (native-inputs
       `(("python-mock" ,python-mock)
--- 30,48 ----
    #:use-module (gnu packages python-xyz)
    #:use-module (gnu packages wxwidgets))
  
! (define-public plover
    (package
      (name "plover")
!     (version "4.0.0.dev8")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
!              (url "https://github.com/openstenoproject/plover")
!              (commit (string-append "v" version))))
         (file-name (git-file-name name version))
         (sha256
!         (base32 "1b2ys77bkjsdmyg97i7lq3lj45q56bycvsm06d4rs656kxhvc0a3"))))
      (build-system python-build-system)
      (native-inputs
       `(("python-mock" ,python-mock)
***************
*** 65,68 ****
  speeds of 200WPM and beyond.")
      (license license:gpl2+)))
  
- xc/plover
--- 65,67 ----



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remove build
  2021-08-21 17:41 Remove build excalamus--- via
@ 2021-08-21 21:04 ` Leo Famulari
  2021-08-22 13:26 ` excalamus--- via
  1 sibling, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2021-08-21 21:04 UTC (permalink / raw)
  To: excalamus--- via

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remove build
  2021-08-21 17:41 Remove build excalamus--- via
  2021-08-21 21:04 ` Leo Famulari
@ 2021-08-22 13:26 ` excalamus--- via
  1 sibling, 0 replies; 3+ messages in thread
From: excalamus--- via @ 2021-08-22 13:26 UTC (permalink / raw)
  To: Help Guix



>
> "removing files or directories manually may break it beyond repair!"
>
> Have I borked my /gnu/store?  
>
No, the 'guix-store-item' command runs 'guix gc' under the hood, so it's safe.  Removing manually here refers to using rm.


> How can I, or could I have if it's too late, removed the build?
>
It's not too late.  There are two approaches.  The most recommended is:

1. Delete the generations of the user profiles (e.g. 'guix package --delete-generations')
2. Delete the generations of the system profiles (e.g. 'sudo guix system delete-generations')
3. Run 'guix gc'

The emacs-guix (guix.el) package has 'guix-generations' and 'guix-system-generations' which allow these to be applied to a list of profiles ('m' to mark, 'd' to delete).

Another approach is to remove the build files one-by-one with 'guix-store-item', although it's not recommended (because it's a more manual process).


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-22 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21 17:41 Remove build excalamus--- via
2021-08-21 21:04 ` Leo Famulari
2021-08-22 13:26 ` excalamus--- via

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).