unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* statedir locations
@ 2014-01-27 11:50 John Darrington
  2014-01-27 12:57 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: John Darrington @ 2014-01-27 11:50 UTC (permalink / raw)
  To: guix-devel

It has come to my attention that guix packages (at least those with gnu build system)
default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
I think we need to update the default configure flags.

J'

[1] http://www.gnu.org/prep/standards/standards.html#Directory-Variables


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.

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

* Re: statedir locations
  2014-01-27 11:50 statedir locations John Darrington
@ 2014-01-27 12:57 ` Ludovic Courtès
  2014-01-27 13:44   ` Mark H Weaver
  2014-01-27 22:48   ` Ludovic Courtès
  0 siblings, 2 replies; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-27 12:57 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

John Darrington <john@darrington.wattle.id.au> skribis:

> It has come to my attention that guix packages (at least those with gnu build system)
> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
> I think we need to update the default configure flags.

Yes.  We actually have a number of local modifications:

  $ grep -e --localstatedir gnu/packages/*.scm | wc -l
  5

I think we should change gnu-build-system.scm to pass
--localstatedir=/var, unless ‘configure-flags’ specify another setting.

I’ll do that in ‘core-updates’.

Thanks,
Ludo’.

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

* Re: statedir locations
  2014-01-27 12:57 ` Ludovic Courtès
@ 2014-01-27 13:44   ` Mark H Weaver
  2014-01-27 14:46     ` Ludovic Courtès
  2014-01-27 22:48   ` Ludovic Courtès
  1 sibling, 1 reply; 10+ messages in thread
From: Mark H Weaver @ 2014-01-27 13:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

> John Darrington <john@darrington.wattle.id.au> skribis:
>
>> It has come to my attention that guix packages (at least those with gnu build system)
>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>> I think we need to update the default configure flags.
>
> Yes.  We actually have a number of local modifications:
>
>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>   5
>
> I think we should change gnu-build-system.scm to pass
> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>
> I’ll do that in ‘core-updates’.

What about 'sharestatedir' and 'runstatedir'?

      Mark

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

* Re: statedir locations
  2014-01-27 13:44   ` Mark H Weaver
@ 2014-01-27 14:46     ` Ludovic Courtès
  2014-01-28  5:05       ` Mark H Weaver
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-27 14:46 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> John Darrington <john@darrington.wattle.id.au> skribis:
>>
>>> It has come to my attention that guix packages (at least those with gnu build system)
>>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>>> I think we need to update the default configure flags.
>>
>> Yes.  We actually have a number of local modifications:
>>
>>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>>   5
>>
>> I think we should change gnu-build-system.scm to pass
>> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>>
>> I’ll do that in ‘core-updates’.
>
> What about 'sharestatedir' and 'runstatedir'?

‘runstatedir’ is in the not-yet-released Autoconf, but otherwise, yeah,
they all deserve the same treatment.

Ludo’.

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

* Re: statedir locations
  2014-01-27 12:57 ` Ludovic Courtès
  2014-01-27 13:44   ` Mark H Weaver
@ 2014-01-27 22:48   ` Ludovic Courtès
  2014-01-28  9:23     ` Ludovic Courtès
  1 sibling, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-27 22:48 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

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

> John Darrington <john@darrington.wattle.id.au> skribis:
>
>> It has come to my attention that guix packages (at least those with gnu build system)
>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>> I think we need to update the default configure flags.
>
> Yes.  We actually have a number of local modifications:
>
>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>   5
>
> I think we should change gnu-build-system.scm to pass
> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>
> I’ll do that in ‘core-updates’.

Done in 65529e49ff5b9052544271b1b7923feed4312849.

Ludo’.

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

* Re: statedir locations
  2014-01-27 14:46     ` Ludovic Courtès
@ 2014-01-28  5:05       ` Mark H Weaver
  2014-01-28  9:49         ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Mark H Weaver @ 2014-01-28  5:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

> Mark H Weaver <mhw@netris.org> skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> John Darrington <john@darrington.wattle.id.au> skribis:
>>>
>>>> It has come to my attention that guix packages (at least those with gnu build system)
>>>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>>>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>>>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>>>> I think we need to update the default configure flags.
>>>
>>> Yes.  We actually have a number of local modifications:
>>>
>>>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>>>   5
>>>
>>> I think we should change gnu-build-system.scm to pass
>>> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>>>
>>> I’ll do that in ‘core-updates’.
>>
>> What about 'sharestatedir' and 'runstatedir'?
>
> ‘runstatedir’ is in the not-yet-released Autoconf, but otherwise, yeah,
> they all deserve the same treatment.

So there's a problem.  Lots of builds are now failing, because "make
install" often tries to create /var or /com and does not have sufficient
permissions to do so.

I'm not sure what to do about this.

      Mark

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

* Re: statedir locations
  2014-01-27 22:48   ` Ludovic Courtès
@ 2014-01-28  9:23     ` Ludovic Courtès
  2014-01-28 17:53       ` John Darrington
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-28  9:23 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

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

> ludo@gnu.org (Ludovic Courtès) skribis:
>
>> John Darrington <john@darrington.wattle.id.au> skribis:
>>
>>> It has come to my attention that guix packages (at least those with gnu build system)
>>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>>> I think we need to update the default configure flags.
>>
>> Yes.  We actually have a number of local modifications:
>>
>>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>>   5
>>
>> I think we should change gnu-build-system.scm to pass
>> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>>
>> I’ll do that in ‘core-updates’.
>
> Done in 65529e49ff5b9052544271b1b7923feed4312849.

I was overconfident: the patch broke everything, because
Automake-generated makefiles typically try to mkdir $localstatedir:

  http://hydra.gnu.org/eval/45514

So I just reverted it, and I think we’re stuck with the status quo until
someone has a better idea.

For the longer term, we could submit an Automake patch such that it
doesn’t insist on creating $localstatedir et al.

Ludo’.

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

* Re: statedir locations
  2014-01-28  5:05       ` Mark H Weaver
@ 2014-01-28  9:49         ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-28  9:49 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Mark H Weaver <mhw@netris.org> skribis:
>>
>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> John Darrington <john@darrington.wattle.id.au> skribis:
>>>>
>>>>> It has come to my attention that guix packages (at least those with gnu build system)
>>>>> default their statedirs to directories under /nix/store/.  Recall that the statedirs (ie: 
>>>>> sharedstatedir localstatedir and runstatedir) are for installing data files *which the programs
>>>>> modify while they run* [1].   Obviously a program cannot modify anything under /nix/store
>>>>> I think we need to update the default configure flags.
>>>>
>>>> Yes.  We actually have a number of local modifications:
>>>>
>>>>   $ grep -e --localstatedir gnu/packages/*.scm | wc -l
>>>>   5
>>>>
>>>> I think we should change gnu-build-system.scm to pass
>>>> --localstatedir=/var, unless ‘configure-flags’ specify another setting.
>>>>
>>>> I’ll do that in ‘core-updates’.
>>>
>>> What about 'sharestatedir' and 'runstatedir'?
>>
>> ‘runstatedir’ is in the not-yet-released Autoconf, but otherwise, yeah,
>> they all deserve the same treatment.
>
> So there's a problem.  Lots of builds are now failing, because "make
> install" often tries to create /var or /com and does not have sufficient
> permissions to do so.

Indeed (notice that I’m reading mail in the wrong order.)

Ludo’.

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

* Re: statedir locations
  2014-01-28  9:23     ` Ludovic Courtès
@ 2014-01-28 17:53       ` John Darrington
  2014-01-28 22:11         ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: John Darrington @ 2014-01-28 17:53 UTC (permalink / raw)
  To: Ludovic Court??s; +Cc: guix-devel

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

On Tue, Jan 28, 2014 at 10:23:16AM +0100, Ludovic Court??s wrote:
     
     I was overconfident: the patch broke everything, because
     Automake-generated makefiles typically try to mkdir $localstatedir:
     
       http://hydra.gnu.org/eval/45514
     
     So I just reverted it, and I think we???re stuck with the status quo until
     someone has a better idea.

So the status quo is, that these packages mkdir /nix/store.../var/com .
Presumably they do that for a reason, viz the program needs to write
to these directories.   But they will not be able to do that because /nix/store
is immutable.  These programs will then break. :(

     
     For the longer term, we could submit an Automake patch such that it
     doesn???t insist on creating $localstatedir et al.

That sounds like a good idea.  In the meantime, couldn't we patch the generated Makefile.in so that it will not die if the mkdir fails?

J'
     

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: statedir locations
  2014-01-28 17:53       ` John Darrington
@ 2014-01-28 22:11         ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2014-01-28 22:11 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

John Darrington <john@darrington.wattle.id.au> skribis:

> On Tue, Jan 28, 2014 at 10:23:16AM +0100, Ludovic Court??s wrote:
>      
>      I was overconfident: the patch broke everything, because
>      Automake-generated makefiles typically try to mkdir $localstatedir:
>      
>        http://hydra.gnu.org/eval/45514
>      
>      So I just reverted it, and I think we???re stuck with the status quo until
>      someone has a better idea.
>
> So the status quo is, that these packages mkdir /nix/store.../var/com .
> Presumably they do that for a reason, viz the program needs to write
> to these directories.

Right.  Apparently Automake doesn’t emit anything for packages that do
not use the ‘localstate’ prefix.

> But they will not be able to do that because /nix/store is immutable.
> These programs will then break. :(

Well, yes.

>      For the longer term, we could submit an Automake patch such that it
>      doesn???t insist on creating $localstatedir et al.
>
> That sounds like a good idea.  In the meantime, couldn't we patch the generated Makefile.in so that it will not die if the mkdir fails?

Yes, as done for DBus for instance.  Unfortunately, I don’t see any
obvious way to do that patching automatically.

Thanks,
Ludo’.

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

end of thread, other threads:[~2014-01-28 22:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 11:50 statedir locations John Darrington
2014-01-27 12:57 ` Ludovic Courtès
2014-01-27 13:44   ` Mark H Weaver
2014-01-27 14:46     ` Ludovic Courtès
2014-01-28  5:05       ` Mark H Weaver
2014-01-28  9:49         ` Ludovic Courtès
2014-01-27 22:48   ` Ludovic Courtès
2014-01-28  9:23     ` Ludovic Courtès
2014-01-28 17:53       ` John Darrington
2014-01-28 22:11         ` Ludovic Courtès

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