all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What is Guix garbage collector root aka gc root
@ 2017-08-13 13:19 Oleg Pykhalov
  2017-08-13 16:36 ` Leo Famulari
  2017-08-14  4:33 ` Ricardo Wurmus
  0 siblings, 2 replies; 4+ messages in thread
From: Oleg Pykhalov @ 2017-08-13 13:19 UTC (permalink / raw)
  To: help-guix

Hello Guix,

I'm trying to understand what is “garbage collector root” aka “gc root”.

1. Is “$HOME/.guix-profile” a “gc root”?

2. I need to build a package, but don't install it.  Just preserve it
for offloading.  Is “guix build --root=$HOME/.guix-profile PACKAGE” (run
as non root user) what I want?  Or if not, what FILE in “--root=FILE” do
I need to pass?

Thanks.

-- 
Best regards,

Oleg.

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

* Re: What is Guix garbage collector root aka gc root
  2017-08-13 13:19 What is Guix garbage collector root aka gc root Oleg Pykhalov
@ 2017-08-13 16:36 ` Leo Famulari
  2017-08-14  4:33 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2017-08-13 16:36 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

On Sun, Aug 13, 2017 at 04:19:54PM +0300, Oleg Pykhalov wrote:
> I'm trying to understand what is “garbage collector root” aka “gc root”.

Garbage-collector roots (GC roots) are items in /gnu/store that are
registered to protect them from the garbage collector:

https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-gc.html

You can see the GC root symlinks in /var/guix/gcroots. You can make a
new GC root manually by adding a symlink to the store item you want to
preserve. For example:

$ ln --symbolic $(guix build hello) /var/guix/gcroots/my-hello

> 1. Is “$HOME/.guix-profile” a “gc root”?

Yes, this is mentioned in the manual, section Invoking guix package:

https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-package.html

> 2. I need to build a package, but don't install it.  Just preserve it
> for offloading.  Is “guix build --root=$HOME/.guix-profile PACKAGE” (run
> as non root user) what I want?  Or if not, what FILE in “--root=FILE” do
> I need to pass?

I've never used this feature, so I'm not sure if the value of FILE can
be anywhere on the filesystem, or if it has to be in /var/guix/gcroots.
Hopefully someone else can clarify this. Or you can read the code or
experiment :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: What is Guix garbage collector root aka gc root
  2017-08-13 13:19 What is Guix garbage collector root aka gc root Oleg Pykhalov
  2017-08-13 16:36 ` Leo Famulari
@ 2017-08-14  4:33 ` Ricardo Wurmus
  2017-08-14  9:15   ` Oleg Pykhalov
  1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2017-08-14  4:33 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: help-guix


Hi Oleg,

> 2. I need to build a package, but don't install it.  Just preserve it
> for offloading.  Is “guix build --root=$HOME/.guix-profile PACKAGE” (run
> as non root user) what I want?  Or if not, what FILE in “--root=FILE” do
> I need to pass?

You can pass any file to “--root”.  It will *create* a GC root for you.

The manual says this:

--8<---------------cut here---------------start------------->8---
‘--root=FILE’
‘-r FILE’
     Make FILE a symlink to the profile for this environment, and
     register it as a garbage collector root.

     This is useful if you want to protect your environment from garbage
     collection, to make it “persistent”.

     When this option is omitted, the environment is protected from
     garbage collection only for the duration of the ‘guix environment’
     session.  This means that next time you recreate the same
     environment, you could have to rebuild or re-download packages.
--8<---------------cut here---------------end--------------->8---

Since it will create a new symlink, do *not* give it the path to an
existing profile.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

* Re: What is Guix garbage collector root aka gc root
  2017-08-14  4:33 ` Ricardo Wurmus
@ 2017-08-14  9:15   ` Oleg Pykhalov
  0 siblings, 0 replies; 4+ messages in thread
From: Oleg Pykhalov @ 2017-08-14  9:15 UTC (permalink / raw)
  To: Leo Famulari, Ricardo Wurmus; +Cc: help-guix

Hello Leo and Ricardo,

Leo Famulari <leo@famulari.name> writes:

…

> You can see the GC root symlinks in /var/guix/gcroots. You can make a
> new GC root manually by adding a symlink to the store item you want to
> preserve. For example:
>
> $ ln --symbolic $(guix build hello) /var/guix/gcroots/my-hello

Just for the record and other readers.

If I create “GC root” with “guix build --root=$HOME/PACKAGE PACKAGE”, I
will have two symbolic links

--8<---------------cut here---------------start------------->8---
$HOME/PACKAGE -> /gnu/store/…-PACKAGE
/var/guix/gcroots/auto/HASH -> $HOME/PACKAGE
--8<---------------cut here---------------end--------------->8---

To remove this package in next garbage collector invocation just remove
“$HOME/PACKAGE” symbolic link.  First invocation of GC like “guix gc
--list-live” will remove “/var/guix/gcroots/auto/HASH” symbolic link.

Thank you Leo and Ricardo!

-- 
Best regards,

Oleg.

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

end of thread, other threads:[~2017-08-14  9:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-13 13:19 What is Guix garbage collector root aka gc root Oleg Pykhalov
2017-08-13 16:36 ` Leo Famulari
2017-08-14  4:33 ` Ricardo Wurmus
2017-08-14  9:15   ` Oleg Pykhalov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.