guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using ``chmod'' in build phases


From: Mark H Weaver
Subject: Re: Using ``chmod'' in build phases
Date: Thu, 04 Jan 2018 03:33:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Alex Vong <address@hidden> writes:

> Running ``LC_ALL=C grep -r chmod'' on ``guix/gnu/packages'', gives the
> following result. As you can see, various modes are used, such as 644,
> 755, 555, 666, 777, 664. Do we have a guide on which mode should be
> prefered? I personally always used 644 for non-executable files, and 755
> for directories and executable files. Any idea?

I agree that it would be good to have some guidelines for this, and for
most purposes, I agree that 644 and 755 are good choices.  In some
cases, it might make more sense to use 444 or 555.  It's probably
inadvisable to use 666 or 777.

However, it should be noted that when files are added to the store,
their modes are canonicalized to one of only two possible values: 444
and 555.  Directories in the store always have mode 555.  In the NAR
format, there's only one permission bit (executable) stored per file,
and none for directories.  For details, see section 5.2.1 (File system
objects) in the Eelco Dolstra's thesis "The Purely Functional Software
Deployment Model".

      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]