From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Subject: Re: proposal: with-file-writeable Date: Thu, 15 Feb 2018 08:25:33 +0100 Message-ID: References: <87wozfp2wk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11444d1a20bb1005653b2210" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emDvG-0003P7-7B for guix-devel@gnu.org; Thu, 15 Feb 2018 02:25:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emDvF-0000nE-3j for guix-devel@gnu.org; Thu, 15 Feb 2018 02:25:38 -0500 In-Reply-To: <87wozfp2wk.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: Guix-devel --001a11444d1a20bb1005653b2210 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2018-02-15 0:28 GMT+01:00 Ludovic Court=C3=A8s : > G=C3=A1bor Boskovits skribis: > > > the make-file-writeable function seems a bit too imperative to me, it > would > > look better if we could have a with-file-writeable function, so that we > can > > constrain the size effect, and more. Moreover if a file is read-only to > > start with, it might be a good idea to keep it that way anyways. WDYT? > > Now that I found the function in (guix build utils) (thanks for guiding > me!), I see what you mean. =E2=80=98make-file-writable=E2=80=99 is imper= ative, true, > but I=E2=80=99d say that file system operations are imperative in nature. > > A =E2=80=98with-file-writeable=E2=80=99 form would give a false sense of = =E2=80=9Ccontainment=E2=80=9D I > think. Contrary to what the name suggests, its effect would *not* be > limited to the dynamic extent of its body, in the current thread; > instead, the effect would be globally visible on the system. > > Last, the style of (guix build utils) is a lesser concern in a way > because its primary use case is package builds. All this code is > =E2=80=9Cplumbing=E2=80=9D and mostly imperative. > > So, all in all, I=E2=80=99d rather keep it this way. > > Thoughts? > > Ok, the keep it this way. Another question, this came up, as I was trying to find a nice solution to reset-gzip-timestamps failing. I got different pieces of advice if I should reset the permissions after resetting the timestamp, but I'm still not sure. It seems that the easiest way to this would be to just add a call to make-file-writable to the phase at the beginning, as we finally end up with a read-only one in the store anyway. I feel that reseting the permissions is unneccesary additional complexity. WDYT? > Ludo=E2=80=99. > --001a11444d1a20bb1005653b2210 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
2018= -02-15 0:28 GMT+01:00 Ludovic Court=C3=A8s <ludo@gnu.org>:
G=C3=A1bor Boskovits <boskovits@gmail.com> skribis:

> the make-file-writeable function seems a bit too imperative to me, it = would
> look better if we could have a with-file-writeable function, so that w= e can
> constrain the size effect, and more. Moreover if a file is read-only t= o
> start with, it might be a good idea to keep it that way anyways. WDYT?=

Now that I found the function in (guix build utils) (thanks for= guiding
me!), I see what you mean.=C2=A0 =E2=80=98make-file-writable=E2=80=99 is im= perative, true,
but I=E2=80=99d say that file system operations are imperative in nature.
A =E2=80=98with-file-writeable=E2=80=99 form would give a false sense of = =E2=80=9Ccontainment=E2=80=9D I
think.=C2=A0 Contrary to what the name suggests, its effect would *not* be<= br> limited to the dynamic extent of its body, in the current thread;
instead, the effect would be globally visible on the system.

Last, the style of (guix build utils) is a lesser concern in a way
because its primary use case is package builds.=C2=A0 All this code is
=E2=80=9Cplumbing=E2=80=9D and mostly imperative.

So, all in all, I=E2=80=99d rather keep it this way.

Thoughts?


Ok, the keep it this way. Another ques= tion, this came up, as
I was trying to find a nice solution to re= set-gzip-timestamps failing.
I got different pieces of advice if = I should reset the permissions after
resetting the timestamp, but= I'm still not sure. It seems that the easiest
way to this wo= uld be to just add a call to make-file-writable to the phase
at t= he beginning, as we finally end up with a read-only one in the store
<= div>anyway. I feel that reseting the permissions is unneccesary additional<= /div>
complexity. WDYT?
=C2=A0
Ludo=E2=80=99.

--001a11444d1a20bb1005653b2210--