From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: Using ``chmod'' in build phases Date: Thu, 04 Jan 2018 03:33:54 -0500 Message-ID: <87o9mavx8t.fsf@netris.org> References: <87h8s42uqs.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eX0yd-0002M3-0K for guix-devel@gnu.org; Thu, 04 Jan 2018 03:34:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eX0yX-0007NL-Ap for guix-devel@gnu.org; Thu, 04 Jan 2018 03:34:15 -0500 Received: from world.peace.net ([50.252.239.5]:58130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eX0yX-0007Lg-7E for guix-devel@gnu.org; Thu, 04 Jan 2018 03:34:09 -0500 In-Reply-To: <87h8s42uqs.fsf@gmail.com> (Alex Vong's message of "Tue, 02 Jan 2018 22:36:11 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Vong Cc: guix-devel@gnu.org Alex Vong 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