unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH]
@ 2014-04-14 13:38 Ludovic Courtès
  2014-04-14 13:45 ` [PATCH] Shea Levy
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2014-04-14 13:38 UTC (permalink / raw)
  To: nix-dev; +Cc: guix-devel

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

The patch below allows files such as /nix/store/foo to be protected from
GC if a root refers to them.  This makes it easy for a build hook to use
such files for its temporary working files.

WDYT?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 482 bytes --]

diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 96e891f..299bf5f 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -287,10 +287,7 @@ static void foundRoot(StoreAPI & store,
     const Path & path, const Path & target, Roots & roots)
 {
     Path storePath = toStorePath(target);
-    if (store.isValidPath(storePath))
     roots[path] = storePath;
-    else
-        printMsg(lvlInfo, format("skipping invalid root from `%1%' to `%2%'") % path % storePath);
 }

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH]
  2014-04-14 13:38 [PATCH] Ludovic Courtès
@ 2014-04-14 13:45 ` Shea Levy
  2014-04-14 14:45   ` [PATCH] Allow roots to refer to arbitrary files in the store Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Shea Levy @ 2014-04-14 13:45 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, nix-dev

Hi Ludo’,

On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
> The patch below allows files such as /nix/store/foo to be protected from
> GC if a root refers to them.  This makes it easy for a build hook to use
> such files for its temporary working files.
> 
> WDYT?
> 

It seems a bit odd to me to be using the store as a temporary file
location. What's wrong with $TMPDIR?

> 
> Thanks,
> Ludo’.
> 

> diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
> index 96e891f..299bf5f 100644
> --- a/src/libstore/gc.cc
> +++ b/src/libstore/gc.cc
> @@ -287,10 +287,7 @@ static void foundRoot(StoreAPI & store,
>      const Path & path, const Path & target, Roots & roots)
>  {
>      Path storePath = toStorePath(target);
> -    if (store.isValidPath(storePath))

Hm, don't we at least want to check that it's in the store at all?

> 
>      roots[path] = storePath;
> -    else
> -        printMsg(lvlInfo, format("skipping invalid root from `%1%' to `%2%'") % path % storePath);
>  }

~Shea

> _______________________________________________
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH] Allow roots to refer to arbitrary files in the store
  2014-04-14 13:45 ` [PATCH] Shea Levy
@ 2014-04-14 14:45   ` Ludovic Courtès
  2014-04-14 14:59     ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2014-04-14 14:45 UTC (permalink / raw)
  To: Shea Levy; +Cc: guix-devel, nix-dev

(Oops, forgot the Subject line; sorry!)

Shea Levy <shea@shealevy.com> skribis:

> On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
>> The patch below allows files such as /nix/store/foo to be protected from
>> GC if a root refers to them.  This makes it easy for a build hook to use
>> such files for its temporary working files.
>> 
>> WDYT?
>> 
>
> It seems a bit odd to me to be using the store as a temporary file
> location. What's wrong with $TMPDIR?

Well, this is useful for build hooks, because it guarantees that any
garbage they leave there will eventually be reclaimed.

>> diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
>> index 96e891f..299bf5f 100644
>> --- a/src/libstore/gc.cc
>> +++ b/src/libstore/gc.cc
>> @@ -287,10 +287,7 @@ static void foundRoot(StoreAPI & store,
>>      const Path & path, const Path & target, Roots & roots)
>>  {
>>      Path storePath = toStorePath(target);
>> -    if (store.isValidPath(storePath))
>
> Hm, don't we at least want to check that it's in the store at all?

‘toStorePath’ does that:

    if (!isInStore(path))
        throw Error(format("path `%1%' is not in the Nix store") % path);

Thanks,
Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH] Allow roots to refer to arbitrary files in the store
  2014-04-14 14:45   ` [PATCH] Allow roots to refer to arbitrary files in the store Ludovic Courtès
@ 2014-04-14 14:59     ` Ludovic Courtès
  2014-04-15 13:11       ` Shea Levy
       [not found]       ` <534D3898.7000503@logicblox.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2014-04-14 14:59 UTC (permalink / raw)
  To: Shea Levy; +Cc: guix-devel, nix-dev

ludo@gnu.org (Ludovic Courtès) skribis:

> Shea Levy <shea@shealevy.com> skribis:
>
>> On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
>>> The patch below allows files such as /nix/store/foo to be protected from
>>> GC if a root refers to them.  This makes it easy for a build hook to use
>>> such files for its temporary working files.
>>> 
>>> WDYT?
>>> 
>>
>> It seems a bit odd to me to be using the store as a temporary file
>> location. What's wrong with $TMPDIR?
>
> Well, this is useful for build hooks, because it guarantees that any
> garbage they leave there will eventually be reclaimed.

It also guarantees that this thing lives on the same file system as the
store, which means that rename(2) can be used to move it to its final
location in the store.

Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH] Allow roots to refer to arbitrary files in the store
  2014-04-14 14:59     ` Ludovic Courtès
@ 2014-04-15 13:11       ` Shea Levy
  2014-04-15 19:34         ` Ludovic Courtès
       [not found]       ` <534D3898.7000503@logicblox.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Shea Levy @ 2014-04-15 13:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, nix-dev

On Mon, Apr 14, 2014 at 04:59:15PM +0200, Ludovic Courtès wrote:
> ludo@gnu.org (Ludovic Courtès) skribis:
> 
> > Shea Levy <shea@shealevy.com> skribis:
> >
> >> On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
> >>> The patch below allows files such as /nix/store/foo to be protected from
> >>> GC if a root refers to them.  This makes it easy for a build hook to use
> >>> such files for its temporary working files.
> >>> 
> >>> WDYT?
> >>> 
> >>
> >> It seems a bit odd to me to be using the store as a temporary file
> >> location. What's wrong with $TMPDIR?
> >
> > Well, this is useful for build hooks, because it guarantees that any
> > garbage they leave there will eventually be reclaimed.
> 
> It also guarantees that this thing lives on the same file system as the
> store, which means that rename(2) can be used to move it to its final
> location in the store.
> 

Hmm using the store as an auto-collected $TMPDIR seems wrong, but this
is a decent argument. Do you have a specific use case already planned?

> 
> Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH] Allow roots to refer to arbitrary files in the store
  2014-04-15 13:11       ` Shea Levy
@ 2014-04-15 19:34         ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2014-04-15 19:34 UTC (permalink / raw)
  To: Shea Levy; +Cc: guix-devel, nix-dev

Shea Levy <shea@shealevy.com> skribis:

> On Mon, Apr 14, 2014 at 04:59:15PM +0200, Ludovic Courtès wrote:
>> ludo@gnu.org (Ludovic Courtès) skribis:
>> 
>> > Shea Levy <shea@shealevy.com> skribis:
>> >
>> >> On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
>> >>> The patch below allows files such as /nix/store/foo to be protected from
>> >>> GC if a root refers to them.  This makes it easy for a build hook to use
>> >>> such files for its temporary working files.
>> >>> 
>> >>> WDYT?
>> >>> 
>> >>
>> >> It seems a bit odd to me to be using the store as a temporary file
>> >> location. What's wrong with $TMPDIR?
>> >
>> > Well, this is useful for build hooks, because it guarantees that any
>> > garbage they leave there will eventually be reclaimed.
>> 
>> It also guarantees that this thing lives on the same file system as the
>> store, which means that rename(2) can be used to move it to its final
>> location in the store.
>> 
>
> Hmm using the store as an auto-collected $TMPDIR seems wrong, but this
> is a decent argument. Do you have a specific use case already planned?

Yup, the build hook, as I wrote (specifically, for the temporary it uses
when restoring from a Nar.)

The other option is to use the temporary root file (that’s what
build-remote.pl does.)  That’s nice, but it requires exposing a lot of
implementation details (GC lock, GC roots directory, etc.)

Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* Re: [PATCH] Allow roots to refer to arbitrary files in the store
       [not found]       ` <534D3898.7000503@logicblox.com>
@ 2014-04-15 20:11         ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2014-04-15 20:11 UTC (permalink / raw)
  To: Eelco Dolstra; +Cc: guix-devel, nix-dev

Eelco Dolstra <eelco.dolstra@logicblox.com> skribis:

> On 14/04/14 16:59, Ludovic Courtès wrote:
>
>>>>> The patch below allows files such as /nix/store/foo to be protected from
>>>>> GC if a root refers to them.  This makes it easy for a build hook to use
>>>>> such files for its temporary working files.
>>>>>
>>>>> WDYT?
>>>>
>>>> It seems a bit odd to me to be using the store as a temporary file
>>>> location. What's wrong with $TMPDIR?
>>>
>>> Well, this is useful for build hooks, because it guarantees that any
>>> garbage they leave there will eventually be reclaimed.
>> 
>> It also guarantees that this thing lives on the same file system as the
>> store, which means that rename(2) can be used to move it to its final
>> location in the store.
>
> The problem with your patch is that those roots don't get cleaned up
> automatically.  A better solution is to generalize the handling of temporary
> store paths like lock files and chroot directories; check out the calls to
> isActiveTempFile() in tryToDelete() in gc.cc. Those don't get deleted while the
> associated build is still running, but do get deleted afterwards.

Hmm yes, I know.

I wanted to avoid going at lengths to expose all that but OK.  That
raises the barrier for build hook implementors...

Thanks,
Ludo’.
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

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

* [PATCH]
@ 2016-08-07 16:18 ng0
  0 siblings, 0 replies; 8+ messages in thread
From: ng0 @ 2016-08-07 16:18 UTC (permalink / raw)
  To: guix-devel

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

This fixes the request to honor previous copyright holders. I noticed
for at least dwm.scm -> suckless.scm this was not considered, so I have
to assume this has not been looked at more carefully.

A single commit on top of all the suckless.scm moves will be okay I
hope. Can someone review if I got a name, email or location wrong?

I think the commit message is not perfect but I don't know how to
express it otherwise.


[-- Attachment #2: 0001-gnu-Move-Copyrights-of-contributors-for-st-dmenu-dwm.patch --]
[-- Type: text/x-patch, Size: 2530 bytes --]

From c3c3bf3042215d896f3f314aa2f5674977cf8440 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@we.make.ritual.n0.is>
Date: Sun, 7 Aug 2016 16:05:33 +0000
Subject: [PATCH] gnu: Move Copyrights of contributors for st, dmenu, dwm and
 slock.

* gnu/packages/xdisorg.scm: Add slock copyrights.
* gnu/packages/terminals.scm: Add st copyrights.
* gnu/packages/wm.scm: Add dmenu, dwm copyrights.
---
 gnu/packages/suckless.scm  | 3 ---
 gnu/packages/terminals.scm | 1 +
 gnu/packages/wm.scm        | 2 ++
 gnu/packages/xdisorg.scm   | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 7fe3403..ec5c7d8 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -1,8 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
 ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
-;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 02cb9fa..a832171 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;; Coypright © 2015 amz3 <amirouche@hypermove.net>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
 ;;;
 ;;; This file is part of GNU Guix.
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index b03133f..4ecba5c 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -10,6 +10,8 @@
 ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Coypright © 2014 Sou Bunnbu <iyzsong@gmail.com>
+;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 18b8cb8..531f419 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2014 Tomáš Čech <sleep_walker@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
-- 
2.9.2


[-- Attachment #3: Type: text/plain, Size: 129 bytes --]


-- 
♥Ⓐ  ng0
Current Keys: https://we.make.ritual.n0.is/ng0.txt
For non-prism friendly talk find me on http://www.psyced.org

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

end of thread, other threads:[~2016-08-07 16:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 13:38 [PATCH] Ludovic Courtès
2014-04-14 13:45 ` [PATCH] Shea Levy
2014-04-14 14:45   ` [PATCH] Allow roots to refer to arbitrary files in the store Ludovic Courtès
2014-04-14 14:59     ` Ludovic Courtès
2014-04-15 13:11       ` Shea Levy
2014-04-15 19:34         ` Ludovic Courtès
     [not found]       ` <534D3898.7000503@logicblox.com>
2014-04-15 20:11         ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2016-08-07 16:18 [PATCH] ng0

Code repositories for project(s) associated with this public inbox

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

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