From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Using symlinks in 'local-file' Date: Tue, 16 Jun 2015 21:05:33 +0300 Message-ID: <87616ny1ea.fsf@gmail.com> References: <87si9uglli.fsf@gmail.com> <878ubk66ss.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4vEy-0007XH-NO for guix-devel@gnu.org; Tue, 16 Jun 2015 14:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4vEu-0001OD-Mp for guix-devel@gnu.org; Tue, 16 Jun 2015 14:05:40 -0400 In-Reply-To: <878ubk66ss.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 15 Jun 2015 22:44:03 +0200") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2015-06-15 23:44 +0300) wrote: > Alex Kost skribis: > >> If one uses a relative symlink in 'local-file', it will lead to a broken >> symlink in the store as illustrated in the attached example. So I think >> it either: >> >> - should be documented explicitly that 'local-file' adds a specified >> file to the store blindly, which may lead to the problem with a broken >> symlink. >> >> - or 'local-file' (or a deeper procedure) should take care of that case >> and dereference a symlink if needed. >> >> WDYT? > > Actually, this only happens with #:recursive? #t, which is currently the > default. > > With #:recursive? #f, you get an error: > > > scheme@(guile-user)> ,enter-store-monad > store-monad@(guile-user) [1]> (gexp->derivation "foo" #~(symlink #$(local= -file "/tmp/symlink1" #:recursive? #f) #$output)) > guix/store.scm:604:22: In procedure add-to-store: > guix/store.scm:604:22: Throw to key `srfi-34' with args `(#)'. > > So I think we should first make #:recursive? default to #f, since that=E2= =80=99s > what we want by default, and optionally have the gexp > expander resolve symlinks. > > WDYT? I agree, getting an error is better than a broken link, so I'm for making (#:recursive? #f) a default. And resolving symlinks would probably be even better. >> (define (call-derivation drv) >> (apply system* >> (cons (derivation-builder drv) >> (derivation-builder-arguments drv)))) > > This is quite original. ;-) I suppose that's a polite version of "That's not how it should be done". I just don't know what the proper way to "call" derivation is :-) --=20 Alex