From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 08 Jun 2016 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 23723@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146534405320290 (code B ref -1); Wed, 08 Jun 2016 00:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2016 00:00:53 +0000 Received: from localhost ([127.0.0.1]:59269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAQvU-0005HC-P3 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 20:00:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAQdy-0003Co-6e for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAQds-0007GE-88 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQds-0007FV-53 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQdp-00072O-UF for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAQdl-0007ET-Os for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:36 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQdl-0007EO-JG for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:33 -0400 Received: by mail-wm0-f46.google.com with SMTP id m124so134478931wme.1 for ; Tue, 07 Jun 2016 16:42:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=iSHy6ioY0lkHO2p7+Qvwatsm+XaJ5jK6+1VRJD8wrYE=; b=cgrL33rV+aflMu7owqW813BjqOsSHWHBRgr1jyWh60LyBLvf/sJIry1jip2zKcuFsY QqewMHFrnjOlpOk0D8U7u2RBtIq7iW2p4ccf9m1LHEVYcYtfu/QU0pPK0A7rdLPYgU62 R6x+RV82j1K0p3NB6v29LMlH6NKmbbp3JhFHVKBEAox0t8cET56HBDpc+JYH/RZ8MTZN o+ddOPpGWCovpFU0wHCJeVvQGslkN3LKiZ84VTZlkhw7MuOxIesQnV9N8n3w5sMI6gLu R8tv4JGTfc+J4fCWyraa7sIHKw9sUkGFD83MnwAADS0NJfJirvktz+BmBsI1QBcfFeIg PQFg== X-Gm-Message-State: ALyK8tIB1dkyb0Z9uHKfpP1lgoPHhU4+RC6+05oxBF2rAgIIaPMTY6O8eD3A2w2VoKthIw== X-Received: by 10.194.110.234 with SMTP id id10mr1549209wjb.30.1465342952729; Tue, 07 Jun 2016 16:42:32 -0700 (PDT) Received: from veritas ([179.43.151.66]) by smtp.gmail.com with ESMTPSA id h8sm2480278wjg.9.2016.06.07.16.42.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 16:42:31 -0700 (PDT) User-agent: mu4e 0.9.16; emacs 24.5.1 From: Jelle Licht Date: Wed, 08 Jun 2016 01:42:31 +0200 Message-ID: <87fusowopk.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Mailman-Approved-At: Tue, 07 Jun 2016 20:00:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) Hi Guix, It seems that the patch-shebang functionality does not deal gracefully with symlinks: it just overwrites them! After struggling somewhat with getting the recently packaged node 6.0.0 to behave, I found out that `patch-shebang' in (guix build gnu-build-system) does not work properly on symlinks. To illustrate, in this specific case, there was an executable script included with the node tarball, namely `lib/node-modules/npm/bin/npm-cli.js' with an env-based shebang: `/usr/bin/env node'. As the `node' executable will only be available after the `install' phase of the build system, it is not patched before hand. During the `install' phase, a symlink is created from `bin/npm' to `lib/node-modules/npm/bin/npm-cli.js' (in the store output directory this time, of course). Then the `patch-shebangs' phase finds this symlink and proceeds to patch it. Instead of transparently following the symlink and patching the `npm-cli.js' script, the `npm' symlink is overwritten with a shebang-patched copy of `npm-cli.js'. For node, this is a problem because of how node loads run-time dependencies; load paths are resolved relative to the actual file, not the symlink. - Jelle From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 10 Jun 2016 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Jelle Licht Cc: 23723@debbugs.gnu.org Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146556257328902 (code B ref 23723); Fri, 10 Jun 2016 12:43:02 +0000 Received: (at 23723) by debbugs.gnu.org; 10 Jun 2016 12:42:53 +0000 Received: from localhost ([127.0.0.1]:35219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBLm1-0007W6-EJ for submit@debbugs.gnu.org; Fri, 10 Jun 2016 08:42:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBLm0-0007Vu-2N for 23723@debbugs.gnu.org; Fri, 10 Jun 2016 08:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBLlq-0003m8-W7 for 23723@debbugs.gnu.org; Fri, 10 Jun 2016 08:42:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBLlq-0003lc-T4; Fri, 10 Jun 2016 08:42:42 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:60562 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bBLlp-0004kt-4I; Fri, 10 Jun 2016 08:42:41 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87fusowopk.fsf@fsfe.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Prairial an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 10 Jun 2016 14:42:39 +0200 In-Reply-To: <87fusowopk.fsf@fsfe.org> (Jelle Licht's message of "Wed, 08 Jun 2016 01:42:31 +0200") Message-ID: <87r3c51agw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Hello! Jelle Licht skribis: > It seems that the patch-shebang functionality does not deal gracefully > with symlinks: it just overwrites them! > > After struggling somewhat with getting the recently packaged node 6.0.0 > to behave, I found out that `patch-shebang' in (guix build > gnu-build-system) does not work properly on symlinks. There=E2=80=99s =E2=80=98patch-shebangs=E2=80=99 (plural) in this file, but= it explicitly touches only regular files (see =E2=80=98list-of-files=E2=80=99). However, =E2=80=98patch-source-shebangs=E2=80=99 indeed overwrites symlinks= . Is it the one that=E2=80=99s causing problems? > To illustrate, in this specific case, there was an executable > script included with the node tarball, namely > `lib/node-modules/npm/bin/npm-cli.js' with an env-based shebang: > `/usr/bin/env node'. > > As the `node' executable will only be available after the `install' > phase of the build system, it is not patched before hand. During the > `install' phase, a symlink is created from `bin/npm' to > `lib/node-modules/npm/bin/npm-cli.js' (in the store output directory > this time, of course). Then the `patch-shebangs' phase finds this > symlink and proceeds to patch it. Instead of transparently following the > symlink and patching the `npm-cli.js' script, the `npm' symlink is > overwritten with a shebang-patched copy of `npm-cli.js'. I don=E2=80=99t think =E2=80=98patch-shebangs=E2=80=99 is to blame; could i= t be =E2=80=98patch-source-shebangs=E2=80=99? Thanks! Ludo=E2=80=99. From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 11 Jun 2016 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 23723@debbugs.gnu.org, Jelle Licht Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146565195726174 (code B ref 23723); Sat, 11 Jun 2016 13:33:02 +0000 Received: (at 23723) by debbugs.gnu.org; 11 Jun 2016 13:32:37 +0000 Received: from localhost ([127.0.0.1]:36517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBj1g-0006o6-Uu for submit@debbugs.gnu.org; Sat, 11 Jun 2016 09:32:37 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBj1e-0006nr-9H for 23723@debbugs.gnu.org; Sat, 11 Jun 2016 09:32:34 -0400 Received: by mail-wm0-f48.google.com with SMTP id n184so23863426wmn.1 for <23723@debbugs.gnu.org>; Sat, 11 Jun 2016 06:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=8SDQCepB6mDHY0bfmk3LG+dsCvWIJsKINTLTwP+E/IU=; b=RAB2d8YqFMaly/ndM9+Lhre1FiBWBdw32bDa+loM3Yw9hEFX9fVfjgA5IGYuFgjkMz jDOTQ6ETd44V6WQvjTIehD+SzuAsnzNqvmhw2jTre8acsyzWfXWmVvekJca2T5DRVPRs KssVq0fFdNsR0QAHftsdjHJG33c4W1Kb/mMU4ES+Lsjr3S/iWR1/A8xI8VEu5BWQSIJI bIJktVAMYjTVXIvOPJzxXk479ttjmCgVOSmy3ZIbc+VBXAnNFS6Rr+f6Ks3nw0ANBtWH Z38easU6Hb1ofttW0upxt6eVPNzmA3/OQkcxPZDgcYN3S7YFN29xL30T8iChOnTu4AeK XV1Q== X-Gm-Message-State: ALyK8tLowqPKTK+Nkak6SYb186PQhRAJMk0tdeUK9h5PdRuHgGwjSSrFGnVKcD79KK5k0A== X-Received: by 10.194.146.180 with SMTP id td20mr6245366wjb.86.1465651948582; Sat, 11 Jun 2016 06:32:28 -0700 (PDT) Received: from veritas (ipbcc0f78b.dynamic.kabel-deutschland.de. [188.192.247.139]) by smtp.gmail.com with ESMTPSA id a191sm4237591wme.5.2016.06.11.06.32.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jun 2016 06:32:27 -0700 (PDT) References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> User-agent: mu4e 0.9.16; emacs 24.5.1 From: Jelle Licht In-reply-to: <87r3c51agw.fsf@gnu.org> Date: Sat, 11 Jun 2016 15:32:26 +0200 Message-ID: <87r3c33l79.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Hi Ludovic Courtès writes: > Hello! > > Jelle Licht skribis: > >> It seems that the patch-shebang functionality does not deal gracefully >> with symlinks: it just overwrites them! >> >> After struggling somewhat with getting the recently packaged node 6.0.0 >> to behave, I found out that `patch-shebang' in (guix build >> gnu-build-system) does not work properly on symlinks. > > There’s ‘patch-shebangs’ (plural) in this file, but it explicitly > touches only regular files (see ‘list-of-files’). > It seems I made a mistake when writing the bug report; I am talking about the `patch-shebang' defined in (guix build utils). My apologies. Also, seeing as my experience with the stat utility and similarly styled programming libraries was lacking, I decided to play around with the definition of `list-of-files': It actually does include symlinks, as (stat:type (stat "some-symlinked-file")) gives us a plain old 'regular. Looking into this a bit more, it seems that calling `stat' gives the exact same results on both the linked-to-file and the symlink to that file. For the particular problem I ran into to be fixed, it is imperative that `list-of-files' of `patch-shebangs' includes the symlink; it does after all need to be patched. The way this patching currently happens just clobbers symlinks. > However, ‘patch-source-shebangs’ indeed overwrites symlinks. Is it the > one that’s causing problems? > >> To illustrate, in this specific case, there was an executable >> script included with the node tarball, namely >> `lib/node-modules/npm/bin/npm-cli.js' with an env-based shebang: >> `/usr/bin/env node'. >> >> As the `node' executable will only be available after the `install' >> phase of the build system, it is not patched before hand. During the >> `install' phase, a symlink is created from `bin/npm' to >> `lib/node-modules/npm/bin/npm-cli.js' (in the store output directory >> this time, of course). Then the `patch-shebangs' phase finds this >> symlink and proceeds to patch it. Instead of transparently following the >> symlink and patching the `npm-cli.js' script, the `npm' symlink is >> overwritten with a shebang-patched copy of `npm-cli.js'. > > I don’t think ‘patch-shebangs’ is to blame; could it be > ‘patch-source-shebangs’? AFAIK, it is definitely the 'patch-shebangs' phase that is to blame for my woes; removing it using modify-phases makes the issue disappear, when looking at the build dir in the store. > > Thanks! > > Ludo’. Looking forward to your thoughts on the matter - Jelle From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 12 Jun 2016 10:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Jelle Licht Cc: 23723@debbugs.gnu.org Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146572740717021 (code B ref 23723); Sun, 12 Jun 2016 10:31:02 +0000 Received: (at 23723) by debbugs.gnu.org; 12 Jun 2016 10:30:07 +0000 Received: from localhost ([127.0.0.1]:37665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bC2ed-0004QT-8M for submit@debbugs.gnu.org; Sun, 12 Jun 2016 06:30:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bC2eb-0004Om-Ey for 23723@debbugs.gnu.org; Sun, 12 Jun 2016 06:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bC2eR-0005O4-Gy for 23723@debbugs.gnu.org; Sun, 12 Jun 2016 06:30:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bC2eR-0005O0-D8; Sun, 12 Jun 2016 06:29:55 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:41568 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bC2eQ-0003ek-FL; Sun, 12 Jun 2016 06:29:55 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 Prairial an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Sun, 12 Jun 2016 12:29:52 +0200 In-Reply-To: <87r3c33l79.fsf@fsfe.org> (Jelle Licht's message of "Sat, 11 Jun 2016 15:32:26 +0200") Message-ID: <8737oiog2n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jelle Licht skribis: > Ludovic Court=C3=A8s writes: >> Hello! >> >> Jelle Licht skribis: >> >>> It seems that the patch-shebang functionality does not deal gracefully >>> with symlinks: it just overwrites them! >>> >>> After struggling somewhat with getting the recently packaged node 6.0.0 >>> to behave, I found out that `patch-shebang' in (guix build >>> gnu-build-system) does not work properly on symlinks. >> >> There=E2=80=99s =E2=80=98patch-shebangs=E2=80=99 (plural) in this file, = but it explicitly >> touches only regular files (see =E2=80=98list-of-files=E2=80=99). >> > > It seems I made a mistake when writing the bug report; I am talking > about the `patch-shebang' defined in (guix build utils). My apologies. > > Also, seeing as my experience with the stat utility and similarly styled > programming libraries was lacking, I decided to play around with the > definition of `list-of-files': It actually does include symlinks, as > (stat:type (stat "some-symlinked-file")) gives us a plain old 'regular. > Looking into this a bit more, it seems that calling `stat' gives the > exact same results on both the linked-to-file and the symlink to that > file. > > For the particular problem I ran into to be fixed, it is imperative that > `list-of-files' of `patch-shebangs' includes the symlink; it does after > all need to be patched. The way this patching currently happens just > clobbers symlinks. My bad, indeed, =E2=80=98list-of-files=E2=80=99 should use =E2=80=98lstat= =E2=80=99 instead of =E2=80=98stat=E2=80=99. I think a patch like attached should solve the problem. WDYT? We can apply it to core-updates-next if that=E2=80=99s fine with you. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 2abaa6e..299eb5d 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -172,9 +172,8 @@ files such as `.in' templates. Most scripts honor $SHELL and $CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's `missing' script." (for-each patch-shebang - (remove (lambda (file) - (or (not (file-exists? file)) ;dangling symlink - (file-is-directory? file))) + (filter (lambda (file) + (eq? 'regular (lstat file))) (find-files ".")))) (define (patch-generated-file-shebangs . rest) @@ -303,7 +302,7 @@ makefiles." (define (list-of-files dir) (map (cut string-append dir "/" <>) (or (scandir dir (lambda (f) - (let ((s (stat (string-append dir "/" f)))) + (let ((s (lstat (string-append dir "/" f)))) (eq? 'regular (stat:type s))))) '()))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 12 16:29:30 2016 Received: (at control) by debbugs.gnu.org; 12 Jun 2016 20:29:30 +0000 Received: from localhost ([127.0.0.1]:38333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCC0f-00089d-Px for submit@debbugs.gnu.org; Sun, 12 Jun 2016 16:29:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCC0d-00089R-TE for control@debbugs.gnu.org; Sun, 12 Jun 2016 16:29:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCC0V-0007oD-Ie for control@debbugs.gnu.org; Sun, 12 Jun 2016 16:29:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCC0V-0007o0-FO for control@debbugs.gnu.org; Sun, 12 Jun 2016 16:29:19 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:54712 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bCC0T-0000E1-Ki for control@debbugs.gnu.org; Sun, 12 Jun 2016 16:29:18 -0400 Date: Sun, 12 Jun 2016 22:29:15 +0200 Message-Id: <87eg82jgmc.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #23723 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) tags 23723 patch From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 13 Jun 2016 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 23723@debbugs.gnu.org, Jelle Licht Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146584741416310 (code B ref 23723); Mon, 13 Jun 2016 19:51:02 +0000 Received: (at 23723) by debbugs.gnu.org; 13 Jun 2016 19:50:14 +0000 Received: from localhost ([127.0.0.1]:39279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCXsE-0004F0-Hl for submit@debbugs.gnu.org; Mon, 13 Jun 2016 15:50:14 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCXsC-0004En-H3 for 23723@debbugs.gnu.org; Mon, 13 Jun 2016 15:50:12 -0400 Received: by mail-wm0-f67.google.com with SMTP id n184so17340354wmn.1 for <23723@debbugs.gnu.org>; Mon, 13 Jun 2016 12:50:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=cQR9NPIavbmX3y4g6nyz13Rf35zr41hfbOgv9oYY7Vs=; b=OoyxQns9/f+zWif9ZkNe8CkagYoavyI5gZu0IMdbJn2ePXY3r1dMcNB0hJqbl7/xC6 hJO27oQ/dQbgW2hTSE8xSxfdvd8CVGLWEko+wKTgnHXICz1UknyzsaTpLbdmqACZuowl XJIVyzu191Fa3ZLg1v0f204h0edVeiL6gxWAM7yeQnrmsl6u/1UHkQ9WZe4f/AWMx7qp QLCrqrp6HeyjnR9RrxCaTw9xetFSR7oX6Yh6j8NZjbVqjIKhnsmvHdB/byO1Mb37kIXT GMRWboYVeUZEfghHJKwZLDpbyub1XlYTnBzlIH/l6yQHWIQlR8A19U0AeXDEkFGEtyck 2okg== X-Gm-Message-State: ALyK8tKKZFWknFtR7sZ74ALa86EO/xDTtaPqMlo7Y7l0JNFKsEmMXUS7mtfkrTVvasgONw== X-Received: by 10.28.85.3 with SMTP id j3mr1220052wmb.0.1465847405897; Mon, 13 Jun 2016 12:50:05 -0700 (PDT) Received: from veritas (tmo-097-150.customers.d1-online.com. [80.187.97.150]) by smtp.gmail.com with ESMTPSA id y6sm307708wmy.8.2016.06.13.12.50.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jun 2016 12:50:04 -0700 (PDT) References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> User-agent: mu4e 0.9.16; emacs 24.5.1 From: Jelle Licht In-reply-to: <8737oiog2n.fsf@gnu.org> Date: Mon, 13 Jun 2016 21:50:01 +0200 Message-ID: <87bn3427iu.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Ludovic Courtès writes: > Jelle Licht skribis: > >> Ludovic Courtès writes: >>> Hello! >>> >>> Jelle Licht skribis: >>> >>>> It seems that the patch-shebang functionality does not deal gracefully >>>> with symlinks: it just overwrites them! >>>> >>>> After struggling somewhat with getting the recently packaged node 6.0.0 >>>> to behave, I found out that `patch-shebang' in (guix build >>>> gnu-build-system) does not work properly on symlinks. >>> >>> There’s ‘patch-shebangs’ (plural) in this file, but it explicitly >>> touches only regular files (see ‘list-of-files’). >>> >> >> It seems I made a mistake when writing the bug report; I am talking >> about the `patch-shebang' defined in (guix build utils). My apologies. >> >> Also, seeing as my experience with the stat utility and similarly styled >> programming libraries was lacking, I decided to play around with the >> definition of `list-of-files': It actually does include symlinks, as >> (stat:type (stat "some-symlinked-file")) gives us a plain old 'regular. >> Looking into this a bit more, it seems that calling `stat' gives the >> exact same results on both the linked-to-file and the symlink to that >> file. >> >> For the particular problem I ran into to be fixed, it is imperative that >> `list-of-files' of `patch-shebangs' includes the symlink; it does after >> all need to be patched. The way this patching currently happens just >> clobbers symlinks. > > My bad, indeed, ‘list-of-files’ should use ‘lstat’ instead of ‘stat’. This would be one way of fixing this bug. I'd rather see that `patch-shebang' in (guix build utils) checks for symlinks, and if so, patches the actual file instead of the symlink. This is the approach I currently use in my tree to use node 6.0. Would there be any downside to this approach? > > I think a patch like attached should solve the problem. WDYT? > > We can apply it to core-updates-next if that’s fine with you. > > Thanks, > Ludo’. If this is the approach you'd rather follow, that is okay with me as well. I just think that a phase that transparently patches all files in bin/sbin, whether they are actual files or symlinks, would be more useful. Greetings, - Jelle From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 14 Jun 2016 07:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Jelle Licht Cc: 23723@debbugs.gnu.org Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146589103122293 (code B ref 23723); Tue, 14 Jun 2016 07:58:02 +0000 Received: (at 23723) by debbugs.gnu.org; 14 Jun 2016 07:57:11 +0000 Received: from localhost ([127.0.0.1]:39583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCjDj-0005nU-J8 for submit@debbugs.gnu.org; Tue, 14 Jun 2016 03:57:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCjDi-0005nG-3T for 23723@debbugs.gnu.org; Tue, 14 Jun 2016 03:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCjDY-00055S-3r for 23723@debbugs.gnu.org; Tue, 14 Jun 2016 03:57:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCjDY-00055N-0R; Tue, 14 Jun 2016 03:57:00 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:58002 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bCjDX-0000NG-DZ; Tue, 14 Jun 2016 03:56:59 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> <87bn3427iu.fsf@fsfe.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 Prairial an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 14 Jun 2016 09:56:57 +0200 In-Reply-To: <87bn3427iu.fsf@fsfe.org> (Jelle Licht's message of "Mon, 13 Jun 2016 21:50:01 +0200") Message-ID: <878ty8jj92.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Jelle Licht skribis: > Ludovic Court=C3=A8s writes: > >> Jelle Licht skribis: >> >>> Ludovic Court=C3=A8s writes: >>>> Hello! >>>> >>>> Jelle Licht skribis: >>>> >>>>> It seems that the patch-shebang functionality does not deal gracefully >>>>> with symlinks: it just overwrites them! >>>>> >>>>> After struggling somewhat with getting the recently packaged node 6.0= .0 >>>>> to behave, I found out that `patch-shebang' in (guix build >>>>> gnu-build-system) does not work properly on symlinks. >>>> >>>> There=E2=80=99s =E2=80=98patch-shebangs=E2=80=99 (plural) in this file= , but it explicitly >>>> touches only regular files (see =E2=80=98list-of-files=E2=80=99). >>>> >>> >>> It seems I made a mistake when writing the bug report; I am talking >>> about the `patch-shebang' defined in (guix build utils). My apologies. >>> >>> Also, seeing as my experience with the stat utility and similarly styled >>> programming libraries was lacking, I decided to play around with the >>> definition of `list-of-files': It actually does include symlinks, as >>> (stat:type (stat "some-symlinked-file")) gives us a plain old 'regular. >>> Looking into this a bit more, it seems that calling `stat' gives the >>> exact same results on both the linked-to-file and the symlink to that >>> file. >>> >>> For the particular problem I ran into to be fixed, it is imperative that >>> `list-of-files' of `patch-shebangs' includes the symlink; it does after >>> all need to be patched. The way this patching currently happens just >>> clobbers symlinks. >> >> My bad, indeed, =E2=80=98list-of-files=E2=80=99 should use =E2=80=98lsta= t=E2=80=99 instead of =E2=80=98stat=E2=80=99. > > This would be one way of fixing this bug. I'd rather see that > `patch-shebang' in (guix build utils) checks for symlinks, and if so, > patches the actual file instead of the symlink. This is the approach I > currently use in my tree to use node 6.0. Would there be any downside to > this approach? Both would work, but I think the =E2=80=9Cspirit=E2=80=9D is that symlinks = are supposed to be transparent, and tools/procedures that operate on files shouldn=E2=80= =99t try to do anything smart about symlinks. Thus I have a slight preference for pushing the smartness to the edges. WDYT? Thanks, Ludo=E2=80=99. From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 14 Jun 2016 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 23723@debbugs.gnu.org Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146589257124835 (code B ref 23723); Tue, 14 Jun 2016 08:23:02 +0000 Received: (at 23723) by debbugs.gnu.org; 14 Jun 2016 08:22:51 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCjcY-0006SU-Pq for submit@debbugs.gnu.org; Tue, 14 Jun 2016 04:22:51 -0400 Received: from cavendish.fsfeurope.org ([217.69.89.162]:59435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCjcU-0006SE-5y for 23723@debbugs.gnu.org; Tue, 14 Jun 2016 04:22:48 -0400 Received: from localhost (localhost [127.0.0.1]) by cavendish.fsfeurope.org (Postfix) with ESMTP id DD36163BABC for <23723@debbugs.gnu.org>; Tue, 14 Jun 2016 10:22:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cavendish Received: from cavendish.fsfeurope.org ([127.0.0.1]) by localhost (cavendish.fsfeurope.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rDycvDwSWqZN for <23723@debbugs.gnu.org>; Tue, 14 Jun 2016 10:22:34 +0200 (CEST) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: jlicht) by cavendish.fsfeurope.org (Postfix) with ESMTPSA id A231663BAAD for <23723@debbugs.gnu.org>; Tue, 14 Jun 2016 10:22:34 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id k204so111324600wmk.0 for <23723@debbugs.gnu.org>; Tue, 14 Jun 2016 01:22:34 -0700 (PDT) X-Gm-Message-State: ALyK8tKMeVxyJJyBLG4iFC4iKVswXfZksDQSmlCSzz8D9kh1qB3v3zQwnUz2LcGJB0HbDZCZ+1nbb1PA3bbCsQ== MIME-Version: 1.0 X-Received: by 10.194.2.44 with SMTP id 12mr4751568wjr.61.1465892553421; Tue, 14 Jun 2016 01:22:33 -0700 (PDT) Received: by 10.28.153.74 with HTTP; Tue, 14 Jun 2016 01:22:33 -0700 (PDT) Received: by 10.28.153.74 with HTTP; Tue, 14 Jun 2016 01:22:33 -0700 (PDT) In-Reply-To: <878ty8jj92.fsf@gnu.org> References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> <87bn3427iu.fsf@fsfe.org> <878ty8jj92.fsf@gnu.org> Date: Tue, 14 Jun 2016 10:22:33 +0200 X-Gmail-Original-Message-ID: Message-ID: From: Jelle Licht Content-Type: multipart/alternative; boundary=047d7b3a8900ecff3f053538b441 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --047d7b3a8900ecff3f053538b441 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Seems like a good policy in general. I'll apply your patch and fix up node then. Thanks a lot for the quick follow up. - Jelle On Jun 14, 2016 9:57 AM, "Ludovic Court=C3=A8s" wrote: > Jelle Licht skribis: > > > Ludovic Court=C3=A8s writes: > > > >> Jelle Licht skribis: > >> > >>> Ludovic Court=C3=A8s writes: > >>>> Hello! > >>>> > >>>> Jelle Licht skribis: > >>>> > >>>>> It seems that the patch-shebang functionality does not deal > gracefully > >>>>> with symlinks: it just overwrites them! > >>>>> > >>>>> After struggling somewhat with getting the recently packaged node > 6.0.0 > >>>>> to behave, I found out that `patch-shebang' in (guix build > >>>>> gnu-build-system) does not work properly on symlinks. > >>>> > >>>> There=E2=80=99s =E2=80=98patch-shebangs=E2=80=99 (plural) in this fi= le, but it explicitly > >>>> touches only regular files (see =E2=80=98list-of-files=E2=80=99). > >>>> > >>> > >>> It seems I made a mistake when writing the bug report; I am talking > >>> about the `patch-shebang' defined in (guix build utils). My apologies= . > >>> > >>> Also, seeing as my experience with the stat utility and similarly > styled > >>> programming libraries was lacking, I decided to play around with the > >>> definition of `list-of-files': It actually does include symlinks, as > >>> (stat:type (stat "some-symlinked-file")) gives us a plain old 'regula= r. > >>> Looking into this a bit more, it seems that calling `stat' gives the > >>> exact same results on both the linked-to-file and the symlink to that > >>> file. > >>> > >>> For the particular problem I ran into to be fixed, it is imperative > that > >>> `list-of-files' of `patch-shebangs' includes the symlink; it does aft= er > >>> all need to be patched. The way this patching currently happens just > >>> clobbers symlinks. > >> > >> My bad, indeed, =E2=80=98list-of-files=E2=80=99 should use =E2=80=98ls= tat=E2=80=99 instead of =E2=80=98stat=E2=80=99. > > > > This would be one way of fixing this bug. I'd rather see that > > `patch-shebang' in (guix build utils) checks for symlinks, and if so, > > patches the actual file instead of the symlink. This is the approach I > > currently use in my tree to use node 6.0. Would there be any downside t= o > > this approach? > > Both would work, but I think the =E2=80=9Cspirit=E2=80=9D is that symlink= s are supposed > to be transparent, and tools/procedures that operate on files shouldn=E2= =80=99t > try to do anything smart about symlinks. Thus I have a slight > preference for pushing the smartness to the edges. WDYT? > > Thanks, > Ludo=E2=80=99. > --047d7b3a8900ecff3f053538b441 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Seems like a good policy in general.
I'll apply your patch and fix up node then.
Thanks a lot for the quick follow up.
- Jelle

On Jun 14, 2016 9:57 AM, "Ludovic Court=C3= =A8s" <ludo@gnu.org> wrote:<= br type=3D"attribution">
Jelle Licht <jlicht@fsfe.org> skribis:

> Ludovic Court=C3=A8s <ludo@gnu.org<= /a>> writes:
>
>> Jelle Licht <
jlicht@fsfe.org= > skribis:
>>
>>> Ludovic Court=C3=A8s <ludo@= gnu.org> writes:
>>>> Hello!
>>>>
>>>> Jelle Licht <jlicht@= fsfe.org> skribis:
>>>>
>>>>> It seems that the patch-shebang functionality does not= deal gracefully
>>>>> with symlinks: it just overwrites them!
>>>>>
>>>>> After struggling somewhat with getting the recently pa= ckaged node 6.0.0
>>>>> to behave, I found out that `patch-shebang' in (gu= ix build
>>>>> gnu-build-system) does not work properly on symlinks.<= br> >>>>
>>>> There=E2=80=99s =E2=80=98patch-shebangs=E2=80=99 (plural) = in this file, but it explicitly
>>>> touches only regular files (see =E2=80=98list-of-files=E2= =80=99).
>>>>
>>>
>>> It seems I made a mistake when writing the bug report; I am ta= lking
>>> about the `patch-shebang' defined in (guix build utils). M= y apologies.
>>>
>>> Also, seeing as my experience with the stat utility and simila= rly styled
>>> programming libraries was lacking, I decided to play around wi= th the
>>> definition of `list-of-files': It actually does include sy= mlinks, as
>>> (stat:type (stat "some-symlinked-file")) gives us a = plain old 'regular.
>>> Looking into this a bit more, it seems that calling `stat'= gives the
>>> exact same results on both the linked-to-file and the symlink = to that
>>> file.
>>>
>>> For the particular problem I ran into to be fixed, it is imper= ative that
>>> `list-of-files' of `patch-shebangs' includes the symli= nk; it does after
>>> all need to be patched. The way this patching currently happen= s just
>>> clobbers symlinks.
>>
>> My bad, indeed, =E2=80=98list-of-files=E2=80=99 should use =E2=80= =98lstat=E2=80=99 instead of =E2=80=98stat=E2=80=99.
>
> This would be one way of fixing this bug. I'd rather see that
> `patch-shebang' in (guix build utils) checks for symlinks, and if = so,
> patches the actual file instead of the symlink. This is the approach I=
> currently use in my tree to use node 6.0. Would there be any downside = to
> this approach?

Both would work, but I think the =E2=80=9Cspirit=E2=80=9D is that symlinks = are supposed
to be transparent, and tools/procedures that operate on files shouldn=E2=80= =99t
try to do anything smart about symlinks.=C2=A0 Thus I have a slight
preference for pushing the smartness to the edges.=C2=A0 WDYT?

Thanks,
Ludo=E2=80=99.
--047d7b3a8900ecff3f053538b441-- From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 16 Jun 2016 05:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 23723@debbugs.gnu.org, Jelle Licht Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.146605413324886 (code B ref 23723); Thu, 16 Jun 2016 05:16:01 +0000 Received: (at 23723) by debbugs.gnu.org; 16 Jun 2016 05:15:33 +0000 Received: from localhost ([127.0.0.1]:42824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDPeP-0006TJ-D1 for submit@debbugs.gnu.org; Thu, 16 Jun 2016 01:15:33 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:57765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDPeO-0006TB-0h for 23723@debbugs.gnu.org; Thu, 16 Jun 2016 01:15:32 -0400 Received: from localhost (178.112.122.80.wireless.dyn.drei.com [178.112.122.80]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 68A7F1CA0348; Thu, 16 Jun 2016 07:15:29 +0200 (CEST) Date: Thu, 16 Jun 2016 07:15:28 +0200 From: Danny Milosavljevic Message-ID: <20160616071528.1e56e75b@scratchpost.org> In-Reply-To: <8737oiog2n.fsf@gnu.org> References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Ludo, are you sure that's correct? Compare: On Sun, 12 Jun 2016 12:29:52 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > + (filter (lambda (file) > + (eq? 'regular (lstat file))) ^^^^^ to > - (let ((s (stat (string-append dir "/" f)))) > + (let ((s (lstat (string-append dir "/" f)))) > (eq? 'regular (stat:type s))))) ^^^^^^^^^ . I think the first is missing a call to stat:type . From unknown Fri Aug 15 04:08:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23723: patch-shebang phase breaks symlinks Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 16 Jun 2016 08:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 23723@debbugs.gnu.org, Jelle Licht Received: via spool by 23723-submit@debbugs.gnu.org id=B23723.14660649899311 (code B ref 23723); Thu, 16 Jun 2016 08:17:02 +0000 Received: (at 23723) by debbugs.gnu.org; 16 Jun 2016 08:16:29 +0000 Received: from localhost ([127.0.0.1]:42872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDSTU-0002Q7-UX for submit@debbugs.gnu.org; Thu, 16 Jun 2016 04:16:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDSTR-0002Pt-O3 for 23723@debbugs.gnu.org; Thu, 16 Jun 2016 04:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDSTJ-0004F3-8L for 23723@debbugs.gnu.org; Thu, 16 Jun 2016 04:16:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDSTJ-0004Ej-57; Thu, 16 Jun 2016 04:16:17 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:35620 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bDSTH-00007l-8I; Thu, 16 Jun 2016 04:16:15 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> <20160616071528.1e56e75b@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 Prairial an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 16 Jun 2016 10:16:13 +0200 In-Reply-To: <20160616071528.1e56e75b@scratchpost.org> (Danny Milosavljevic's message of "Thu, 16 Jun 2016 07:15:28 +0200") Message-ID: <8760t9k0qa.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Danny Milosavljevic skribis: > are you sure that's correct? > > Compare: > > On Sun, 12 Jun 2016 12:29:52 +0200 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> + (filter (lambda (file) >> + (eq? 'regular (lstat file))) > ^^^^^ > to > >> - (let ((s (stat (string-append dir "/" f)))) >> + (let ((s (lstat (string-append dir "/" f)))) >> (eq? 'regular (stat:type s))))) > ^^^^^^^^^ > . > > I think the first is missing a call to stat:type . Good catch! I=E2=80=99ll adjust it when I commit to =E2=80=98core-updates-= next=E2=80=99. Thank you! Ludo=E2=80=99. From unknown Fri Aug 15 04:08:10 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jelle Licht Subject: bug#23723: closed (Re: bug#23723: patch-shebang phase breaks symlinks) Message-ID: References: <87lgywzz70.fsf@gnu.org> <87fusowopk.fsf@fsfe.org> X-Gnu-PR-Message: they-closed 23723 X-Gnu-PR-Package: guix X-Gnu-PR-Keywords: patch Reply-To: 23723@debbugs.gnu.org Date: Mon, 12 Sep 2016 19:39:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1473709142-15191-1" This is a multi-part message in MIME format... ------------=_1473709142-15191-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #23723: patch-shebang phase breaks symlinks which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 23723@debbugs.gnu.org. --=20 23723: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23723 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1473709142-15191-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23723-done) by debbugs.gnu.org; 12 Sep 2016 19:38:09 +0000 Received: from localhost ([127.0.0.1]:57945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjX3R-0003vl-5A for submit@debbugs.gnu.org; Mon, 12 Sep 2016 15:38:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjX3P-0003vZ-BM for 23723-done@debbugs.gnu.org; Mon, 12 Sep 2016 15:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjX3G-0003RR-6K for 23723-done@debbugs.gnu.org; Mon, 12 Sep 2016 15:38:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjX3G-0003RL-2k; Mon, 12 Sep 2016 15:37:58 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:51868 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1bjX3F-0007Jb-Dj; Mon, 12 Sep 2016 15:37:57 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Jelle Licht Subject: Re: bug#23723: patch-shebang phase breaks symlinks In-Reply-To: <8737oiog2n.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 12 Jun 2016 12:29:52 +0200") References: <87fusowopk.fsf@fsfe.org> <87r3c51agw.fsf@gnu.org> <87r3c33l79.fsf@fsfe.org> <8737oiog2n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Date: Mon, 12 Sep 2016 21:37:55 +0200 Message-ID: <87lgywzz70.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.3 (-------) X-Debbugs-Envelope-To: 23723-done Cc: 23723-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.3 (-------) ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Jelle Licht skribis: [...] >> Also, seeing as my experience with the stat utility and similarly styled >> programming libraries was lacking, I decided to play around with the >> definition of `list-of-files': It actually does include symlinks, as >> (stat:type (stat "some-symlinked-file")) gives us a plain old 'regular. >> Looking into this a bit more, it seems that calling `stat' gives the >> exact same results on both the linked-to-file and the symlink to that >> file. >> >> For the particular problem I ran into to be fixed, it is imperative that >> `list-of-files' of `patch-shebangs' includes the symlink; it does after >> all need to be patched. The way this patching currently happens just >> clobbers symlinks. > > My bad, indeed, =E2=80=98list-of-files=E2=80=99 should use =E2=80=98lstat= =E2=80=99 instead of =E2=80=98stat=E2=80=99. This was fixed some time ago in core-updates by commit c13a9feb5b64fd819eaed38a17da0284bbe2b8d9; closing this bug! Ludo=E2=80=99. ------------=_1473709142-15191-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Jun 2016 00:00:53 +0000 Received: from localhost ([127.0.0.1]:59269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAQvU-0005HC-P3 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 20:00:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAQdy-0003Co-6e for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAQds-0007GE-88 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQds-0007FV-53 for submit@debbugs.gnu.org; Tue, 07 Jun 2016 19:42:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQdp-00072O-UF for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAQdl-0007ET-Os for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:36 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAQdl-0007EO-JG for bug-guix@gnu.org; Tue, 07 Jun 2016 19:42:33 -0400 Received: by mail-wm0-f46.google.com with SMTP id m124so134478931wme.1 for ; Tue, 07 Jun 2016 16:42:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=iSHy6ioY0lkHO2p7+Qvwatsm+XaJ5jK6+1VRJD8wrYE=; b=cgrL33rV+aflMu7owqW813BjqOsSHWHBRgr1jyWh60LyBLvf/sJIry1jip2zKcuFsY QqewMHFrnjOlpOk0D8U7u2RBtIq7iW2p4ccf9m1LHEVYcYtfu/QU0pPK0A7rdLPYgU62 R6x+RV82j1K0p3NB6v29LMlH6NKmbbp3JhFHVKBEAox0t8cET56HBDpc+JYH/RZ8MTZN o+ddOPpGWCovpFU0wHCJeVvQGslkN3LKiZ84VTZlkhw7MuOxIesQnV9N8n3w5sMI6gLu R8tv4JGTfc+J4fCWyraa7sIHKw9sUkGFD83MnwAADS0NJfJirvktz+BmBsI1QBcfFeIg PQFg== X-Gm-Message-State: ALyK8tIB1dkyb0Z9uHKfpP1lgoPHhU4+RC6+05oxBF2rAgIIaPMTY6O8eD3A2w2VoKthIw== X-Received: by 10.194.110.234 with SMTP id id10mr1549209wjb.30.1465342952729; Tue, 07 Jun 2016 16:42:32 -0700 (PDT) Received: from veritas ([179.43.151.66]) by smtp.gmail.com with ESMTPSA id h8sm2480278wjg.9.2016.06.07.16.42.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 16:42:31 -0700 (PDT) User-agent: mu4e 0.9.16; emacs 24.5.1 From: Jelle Licht To: bug-guix@gnu.org Subject: patch-shebang phase breaks symlinks Date: Wed, 08 Jun 2016 01:42:31 +0200 Message-ID: <87fusowopk.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 07 Jun 2016 20:00:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) Hi Guix, It seems that the patch-shebang functionality does not deal gracefully with symlinks: it just overwrites them! After struggling somewhat with getting the recently packaged node 6.0.0 to behave, I found out that `patch-shebang' in (guix build gnu-build-system) does not work properly on symlinks. To illustrate, in this specific case, there was an executable script included with the node tarball, namely `lib/node-modules/npm/bin/npm-cli.js' with an env-based shebang: `/usr/bin/env node'. As the `node' executable will only be available after the `install' phase of the build system, it is not patched before hand. During the `install' phase, a symlink is created from `bin/npm' to `lib/node-modules/npm/bin/npm-cli.js' (in the store output directory this time, of course). Then the `patch-shebangs' phase finds this symlink and proceeds to patch it. Instead of transparently following the symlink and patching the `npm-cli.js' script, the `npm' symlink is overwritten with a shebang-patched copy of `npm-cli.js'. For node, this is a problem because of how node loads run-time dependencies; load paths are resolved relative to the actual file, not the symlink. - Jelle ------------=_1473709142-15191-1--