From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts. Date: Wed, 10 Feb 2016 22:30:46 +0100 Message-ID: <87h9hgi77d.fsf@gnu.org> References: <87egcpeono.fsf@gnu.org> <87egcmkvwr.fsf@gnu.org> <87ziv9elo2.fsf@gnu.org> <87io1xr45c.fsf@gnu.org> <87a8n9edir.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]:49094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTcLv-0003m2-QC for guix-devel@gnu.org; Wed, 10 Feb 2016 16:31:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTcLq-0008JL-RI for guix-devel@gnu.org; Wed, 10 Feb 2016 16:31:11 -0500 In-Reply-To: <87a8n9edir.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 09 Feb 2016 23:15:40 +0100") 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: Jan Nieuwenhuizen Cc: guix-devel@gnu.org Jan Nieuwenhuizen skribis: > Ludovic Court=C3=A8s writes: > >> How does the script determines its location? Using $0 is unreliable, >> and using /proc/self/exe is non portable. > > It uses node.js's __dirname. I would have to dive into node.js > internals to figure that out... I would think it does /proc/self/exe > and has fallbacks for other platforms? That's plausible. > From 2d17c6bd7c7dd466c0aee14beaa47055af0ceb6d Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sun, 7 Feb 2016 16:45:25 +0100 > Subject: [PATCH] build-system/gnu: Do not patch symlinks, v2. > > This fixes location-aware scripts. > > * guix/build/gnu-build-system.scm (file-is-symlink?): new function. > (patch-source-shebangs): use it to skip symlinks. This one changes =E2=80=98patch-source-shebangs=E2=80=99, which is about pa= tching files in the source tree. It makes sense to avoid patching symlinks there too, but are you sure this has anything to do with the problem you noticed? Thanks, Ludo=E2=80=99.