Hello Guixers ! I have few practical questions: - How to replace /tmp during build with another partition to avoid filling it ? - How to compile with fewer parallel processus to avoid compilation errors due to filled memory/swap ? - I accidently deleted one directory under /gnu/store, how to rebuild it ? # guix build ... ROOT ;;; note: source file ..../ROOT.scm ;;; newer than compiled ..../ROOT.scm.go /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 # ls /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 ls: cannot access /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02: No such file or directory Best regards, Emmanuel Medernach
Dear, On Tue, 12 May 2020 at 09:22, Emmanuel Medernach <emmanuel.medernach@gmail.com> wrote: > - How to replace /tmp during build with another partition to avoid filling > it ? I do not know. > - How to compile with fewer parallel processus to avoid compilation errors > due to filled memory/swap ? Do the options '--cores' and '--max-jobs' work? > - I accidently deleted one directory under /gnu/store, how to rebuild it ? > > # guix build ... ROOT > ;;; note: source file ..../ROOT.scm > ;;; newer than compiled ..../ROOT.scm.go > /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 > > # ls /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 > ls: cannot access /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02: > No such file or directory guix build $(guix gc --derivers /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02) Hope that helps, simon
On Tue, May 12, 2020 at 10:04 AM zimoun <zimon.toutoune@gmail.com> wrote: > Dear, > > On Tue, 12 May 2020 at 09:22, Emmanuel Medernach > <emmanuel.medernach@gmail.com> wrote: > > > - How to replace /tmp during build with another partition to avoid > filling > > it ? > > I do not know. > > Or could it be added as an installation option ? > > - How to compile with fewer parallel processus to avoid compilation > errors > > due to filled memory/swap ? > > Do the options '--cores' and '--max-jobs' work? > > Yes thanks that's it. > > > - I accidently deleted one directory under /gnu/store, how to rebuild it > ? > > > > # guix build ... ROOT > > ;;; note: source file ..../ROOT.scm > > ;;; newer than compiled ..../ROOT.scm.go > > /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 > > > > # ls /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 > > ls: cannot access > /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02: > > No such file or directory > > guix build $(guix gc --derivers > /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02) > > Nothing happens, it does not recompile with 'guix build' and the directory does not exist: # guix build $(guix gc --derivers /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02) # ls /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 ls: cannot access /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02: No such file or directory # guix build .. ROOT-6.20 ;;; note: source file ..../ROOT.scm ;;; newer than compiled ..../ROOT.scm.go /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 # ls /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 ls: cannot access /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02: No such file or directory Thanks for your help Emmanuel
On Tue, May 12, 2020 at 09:22:13AM +0200, Emmanuel Medernach wrote: > Hello Guixers ! > > I have few practical questions: > > - How to replace /tmp during build with another partition to avoid filling > it ? This is what the TMPDIR environment variable is for. You can search the manual <https://guix.gnu.org/manual/en/guix.html> for tmpdir/TMPDIR. Hope it helps. Regards, Florian
[-- Attachment #1: Type: text/plain, Size: 894 bytes --] Emmanuel Medernach <emmanuel.medernach@gmail.com> writes: >> > - How to replace /tmp during build with another partition to avoid >> filling >> > it ? >> >> I do not know. >> >> > Or could it be added as an installation option ? From the manual (2.5): "When the daemon performs a build on behalf of the user, it creates a build directory under /tmp or under the directory specified by its TMPDIR environment variable." If you are on a foreign distro, you can add export TMPDIR="/yourBigAndFastDisk" to the init/start script of the guix-daemon. If you are on a guix system (or guix generated vm etc), you can add (service guix-service-type (guix-configuration (tmpdir "/yourBigAndFastDisk"))) to your services. -- I've finally learned what "upward compatible" means. It means we get to keep all our old mistakes. -- Dennie van Tassel [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --]
Thanks, It works ! I had to add the TMPDIR to the guix daemon environment
variables and not to the user.
Emmanuel
On Tue, May 12, 2020 at 11:41 AM pelzflorian (Florian Pelz) <
pelzflorian@pelzflorian.de> wrote:
> On Tue, May 12, 2020 at 09:22:13AM +0200, Emmanuel Medernach wrote:
> > Hello Guixers !
> >
> > I have few practical questions:
> >
> > - How to replace /tmp during build with another partition to avoid
> filling
> > it ?
>
> This is what the TMPDIR environment variable is for. You can search
> the manual <https://guix.gnu.org/manual/en/guix.html> for
> tmpdir/TMPDIR.
>
> Hope it helps.
>
> Regards,
> Florian
>
On Tue, 12 May 2020 at 11:30, Emmanuel Medernach
<emmanuel.medernach@gmail.com> wrote:
>> guix build $(guix gc --derivers
>> /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02)
>
> Nothing happens, it does not recompile with 'guix build' and the directory does not exist:
Could you be more precise about this package ROOT-6.20.02? I am not
aware about such UPPERCASE path in the store.
Could you be more precise about how you deleted it? "guix gc" or other?
On Tue, May 12, 2020 at 1:40 PM zimoun <zimon.toutoune@gmail.com> wrote:
> On Tue, 12 May 2020 at 11:30, Emmanuel Medernach
> <emmanuel.medernach@gmail.com> wrote:
>
> >> guix build $(guix gc --derivers
> >> /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02)
> >
> > Nothing happens, it does not recompile with 'guix build' and the
> directory does not exist:
>
> Could you be more precise about this package ROOT-6.20.02? I am not
> aware about such UPPERCASE path in the store.
> Could you be more precise about how you deleted it? "guix gc" or other?
>
It is the name of a locally defined package, my partition was full and I
deleted the /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02
directory by error. Now I would like to rebuild it but the "guix build"
command only returns the path which does not exist anymore.
Emmanuel
On Tue, 12 May 2020 at 13:55, Emmanuel Medernach
<emmanuel.medernach@gmail.com> wrote:
> It is the name of a locally defined package, my partition was full and I deleted the /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 directory by error. Now I would like to rebuild it but the "guix build" command only returns the path which does not exist anymore.
How did you delete it?
Does it still belong in a profile?
Well, "guix gc" should help in this case; see the option --list-dead,
--delete or --verify.
Hope that helps,
simon
On Tue, May 12, 2020 at 2:04 PM zimoun <zimon.toutoune@gmail.com> wrote: > On Tue, 12 May 2020 at 13:55, Emmanuel Medernach > <emmanuel.medernach@gmail.com> wrote: > > > It is the name of a locally defined package, my partition was full and I > deleted the /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02 > directory by error. Now I would like to rebuild it but the "guix build" > command only returns the path which does not exist anymore. > > How did you delete it? > I deleted it with the very wrong method of "rm -Rf" of this local package in the store, now I learned. > Does it still belong in a profile? > Well, "guix gc" should help in this case; see the option --list-dead, > --delete or --verify. > > > Yes Thanks, I succeeded to remove it by rolling back to an old profile. Emmanuel > Hope that helps, > simon >
On 12/05/2020 13:40, zimoun wrote: > Could you be more precise about this package ROOT-6.20.02? Look here: https://root.cern/ -- Vincent Legoll
[-- Attachment #1: Type: text/plain, Size: 796 bytes --] Emmanuel, Emmanuel Medernach 写道: > I deleted it with the very wrong method of "rm -Rf" of this > local package > in the store, now I learned. It's a common rite of passage. However: I hope it didn't work out of the box and you had to jump through at least one flaming hoop… right? Guix-daemon goes to some trouble to bind-mount the store read-only. Running ‘rm -rf’ (even as root) should simply fail: λ findmnt /gnu/store TARGET SOURCE FSTYPE OPTIONS /gnu/store /dev/sda1[/gnu/store] bcachefs ro,relatime,… ^^ There are probably ways in which bind-mounting could fail. If it really was that easy for you to hork your system, we'd like to know :-) Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --]
[-- Attachment #1: Type: text/plain, Size: 486 bytes --] Tobias Geerinckx-Rice 写道: > λ findmnt /gnu/store TARGET SOURCE FSTYPE > OPTIONS > /gnu/store /dev/sda1[/gnu/store] bcachefs ro,relatime,… And just to show I'm not bluffing: λ sudo rm -rf /gnu/store … … <phew> rm: cannot remove '/gnu/store/…': Read-only file system rm: cannot remove '/gnu/store/…': Read-only file system rm: cannot remove '/gnu/store/…': Read-only file system ^C λ Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --]
Hello,
I believe you, but here it is in my shell history:
sudo rm -Rf /gnu/store/rj2ir3hmaanvwwvyy6d1a1qv0f0xp537-ROOT-6.20.02
Surely because I am using a foreign distro
Regards,
Emmanuel
On Thu, May 14, 2020 at 1:34 PM Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> Tobias Geerinckx-Rice 写道:
> > λ findmnt /gnu/store TARGET SOURCE FSTYPE
> > OPTIONS
> > /gnu/store /dev/sda1[/gnu/store] bcachefs ro,relatime,…
>
> And just to show I'm not bluffing:
>
> λ sudo rm -rf /gnu/store
> …
> …
> <phew>
> rm: cannot remove '/gnu/store/…': Read-only file system
> rm: cannot remove '/gnu/store/…': Read-only file system
> rm: cannot remove '/gnu/store/…': Read-only file system
> ^C
> λ
>
> Kind regards,
>
> T G-R
>
On Thu, 14 May 2020 at 13:34, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> λ sudo rm -rf /gnu/store
Your trust in Guix is impressive! ;-)
--8<---------------cut here---------------start------------->8---
guix gc --list-dead | grep hello
finding garbage collector roots...
determining live/dead paths...
/gnu/store/fnn6lvk6n5a1mkkqa1jybgwv9425gzcv-hello-2.10-guile-builder
/gnu/store/gknm68l0q893bpvyhcd4ccih1bmh0j87-hello-2.10.drv
/gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10
simon@lili$ sudo rm -fr /gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10
[sudo] password for simon:
simon@lili$ guix gc --list-dead | grep hello
finding garbage collector roots...
determining live/dead paths...
/gnu/store/fnn6lvk6n5a1mkkqa1jybgwv9425gzcv-hello-2.10-guile-builder
/gnu/store/gknm68l0q893bpvyhcd4ccih1bmh0j87-hello-2.10.drv
--8<---------------cut here---------------end--------------->8---
On foreign distro.
Cheers,
simon
[-- Attachment #1: Type: text/plain, Size: 641 bytes --] Emmanuel, Emmanuel Medernach 写道: > Surely because I am using a foreign distro You're right (of course). After installing Guix on a foreign distribution: $ findmnt /gnu/store $ A simple $ sudo mount -o bind,ro /gnu/store /gnu/store fixes it for me, so it's not due to SELinux/AppArmour/… restrictions, and presumably the daemon just didn't bother. I freely admit to not knowing the daemon as well as the rest of Guix. Chalk one up to ‘foreign distroes and C++ are strange & scary to nckx’ — especially after this discovery. But has this always been the case? Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --]
Le 14 mai 2020 08:17:51 GMT-04:00, zimoun <zimon.toutoune@gmail.com> a écrit :
>On Thu, 14 May 2020 at 13:34, Tobias Geerinckx-Rice <me@tobias.gr>
>wrote:
>
>> λ sudo rm -rf /gnu/store
>
>Your trust in Guix is impressive! ;-)
>
>--8<---------------cut here---------------start------------->8---
>guix gc --list-dead | grep hello
>finding garbage collector roots...
>determining live/dead paths...
>/gnu/store/fnn6lvk6n5a1mkkqa1jybgwv9425gzcv-hello-2.10-guile-builder
>/gnu/store/gknm68l0q893bpvyhcd4ccih1bmh0j87-hello-2.10.drv
>/gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10
>
>simon@lili$ sudo rm -fr
>/gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10
>[sudo] password for simon:
>
>simon@lili$ guix gc --list-dead | grep hello
>finding garbage collector roots...
>determining live/dead paths...
>/gnu/store/fnn6lvk6n5a1mkkqa1jybgwv9425gzcv-hello-2.10-guile-builder
>/gnu/store/gknm68l0q893bpvyhcd4ccih1bmh0j87-hello-2.10.drv
>--8<---------------cut here---------------end--------------->8---
>
>On foreign distro.
>
>
>Cheers,
>simon
We only bind-mount the store on the Guix System. On systemd systems, we could install an additional service that does that I think. For others, adding a line to /etc/fstab might work too.
[-- Attachment #1: Type: text/plain, Size: 300 bytes --] Simon, zimoun 写道: > Your trust in Guix is impressive! ;-) It's never disappointed me! But yeah, forgetting that other distributions exist is a recurring personal failing of mine. The things that suddenly break (like this) are spooky & arbitrary to me. Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --]
On Thu, 14 May 2020 at 14:35, Julien Lepiller <julien@lepiller.eu> wrote: > We only bind-mount the store on the Guix System. On systemd systems, we could install an additional service that does that I think. For others, adding a line to /etc/fstab might work too. Does it make sense to add these extra steps explanations to the manual? https://guix.gnu.org/manual/devel/en/guix.html#Binary-Installation And the simple 'mount -o bind,ro /gnu/store /gnu/store' proposed by Tobias is not enough in the general case? Cheers, simon
Le 14 mai 2020 08:39:31 GMT-04:00, zimoun <zimon.toutoune@gmail.com> a écrit : >On Thu, 14 May 2020 at 14:35, Julien Lepiller <julien@lepiller.eu> >wrote: > >> We only bind-mount the store on the Guix System. On systemd systems, >we could install an additional service that does that I think. For >others, adding a line to /etc/fstab might work too. > >Does it make sense to add these extra steps explanations to the manual? > >https://guix.gnu.org/manual/devel/en/guix.html#Binary-Installation > > >And the simple 'mount -o bind,ro /gnu/store /gnu/store' proposed by >Tobias is not enough in the general case? It's enough, but not persistent after a reboot. I'll try to start a VM of other distros to see how to achieve that properly and will propose a change to the manual accordingly. > > >Cheers, >simon
On Thu, 14 May 2020 at 15:56, Julien Lepiller <julien@lepiller.eu> wrote:
> >And the simple 'mount -o bind,ro /gnu/store /gnu/store' proposed by
> >Tobias is not enough in the general case?
>
> It's enough, but not persistent after a reboot. I'll try to start a VM of other distros to see how to achieve that properly and will propose a change to the manual accordingly.
Thank you for the explanation.
And thanks Tobias for the patch. I will try on my current foreign
Debian distro.
Cheers,
simon
[-- Attachment #1: Type: text/plain, Size: 214 bytes --] zimoun 写道: > And thanks Tobias for the patch. I will try on my current > foreign > Debian distro. Thanks! Eager to find out which stupid typo makes the whole thing fail. Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --]