all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.
Date: Tue, 09 Feb 2016 20:19:41 +0100	[thread overview]
Message-ID: <87ziv9elo2.fsf@gnu.org> (raw)
In-Reply-To: <87egcmkvwr.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 09 Feb 2016 11:41:56 +0100")

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]

Ludovic Courtès writes:

> Out of curiosity, what package was this?

I encountered it first in jison, a javascript parser generator.

> Since this is a rebuild-the-world change, I applied to to a new
> ‘core-updates’ branch (and adjusted the commit log.)

Yes, I got bitten by that, trying to test it.  I had an interesting
learning experience getting to know guix and getting this to work and
reverted to using

    (#phases
     (replace 'patch-source-shebangs
              ;;patch-source-shebangs-no-symlinks
              (lambda* (#:key outputs #:allow-other-keys)
                (for-each patch-shebang
                          (remove (lambda (file)
                                    (or (not (file-exists? file)) ;dangling symlink
                                        ;;(file-is-symlink? file)
                                        (and (file-exists? file)
                                             (eq? 'symlink (stat:type (lstat file))))
                                        (file-is-directory? file)))
                                  (find-files ".")))))

in the package itself.  Rebuilding the world is no fun when you want to
get things done.

When I actually got to test it, it appears that something like the above
is still necessary.  It seems that the previous patch merely avoids
visiting any symlinked directories, while this version actually looks
at the script to be patched.

Greetings, Jan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-build-system-do-not-patch-symlinks.-Fixes-locati.patch --]
[-- Type: text/x-diff, Size: 998 bytes --]

From 5a1793944b6ba1368a355edfa5be1b5c542ba48c Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 6 Feb 2016 15:59:51 +0100
Subject: [PATCH] gnu-build-system: do not patch symlinks.  Fixes
 location-aware scripts.

* guix/build/gnu-build-system.scm (patch-shebangs): avoid patching symlinks.
  Fixes scripts
---
 guix/build/gnu-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 2abaa6e..34edff7 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -303,7 +303,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)))))
              '())))
 
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

  reply	other threads:[~2016-02-09 19:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 17:26 [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts Jan Nieuwenhuizen
2016-02-09 10:41 ` Ludovic Courtès
2016-02-09 19:19   ` Jan Nieuwenhuizen [this message]
2016-02-09 20:59     ` Ludovic Courtès
2016-02-09 22:15       ` Jan Nieuwenhuizen
2016-02-10 21:30         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ziv9elo2.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.