unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23723: patch-shebang phase breaks symlinks
@ 2016-06-07 23:42 Jelle Licht
  2016-06-10 12:42 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Jelle Licht @ 2016-06-07 23:42 UTC (permalink / raw)
  To: 23723

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-12 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 23:42 bug#23723: patch-shebang phase breaks symlinks Jelle Licht
2016-06-10 12:42 ` Ludovic Courtès
2016-06-11 13:32   ` Jelle Licht
2016-06-12 10:29     ` Ludovic Courtès
2016-06-13 19:50       ` Jelle Licht
2016-06-14  7:56         ` Ludovic Courtès
2016-06-14  8:22           ` Jelle Licht
2016-06-16  5:15       ` Danny Milosavljevic
2016-06-16  8:16         ` Ludovic Courtès
2016-09-12 19:37       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).