From cd91504df27aa0f311735c61f3b7b7ee3fee861a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Apr 2015 11:23:14 +0200 Subject: gremlin: Add support for the expansion of $ORIGIN in RUNPATH. * guix/build/gremlin.scm (expand-variable, expand-origin): New procedures. (validate-needed-in-runpath): Map 'expand-origin' to the RUNPATH field of DYNINFO. * tests/gremlin.scm ("expand-origin"): New test. --- guix/build/gremlin.scm | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/build/gremlin.scm b/guix/build/gremlin.scm index 30b06034dd..fed529b193 100644 --- a/guix/build/gremlin.scm +++ b/guix/build/gremlin.scm @@ -39,6 +39,7 @@ elf-dynamic-info-needed elf-dynamic-info-rpath elf-dynamic-info-runpath + expand-origin validate-needed-in-runpath)) @@ -236,6 +237,30 @@ value of DT_NEEDED entries is a string.)" (string-prefix? libc-lib lib)) %libc-libraries)) +(define (expand-variable str variable value) + "Replace occurrences of '$VARIABLE' or '${VARIABLE}' in STR with VALUE." + (define variables + (list (string-append "$" variable) + (string-append "${" variable "}"))) + + (let loop ((thing variables) + (str str)) + (match thing + (() + str) + ((head tail ...) + (let ((index (string-contains str head)) + (len (string-length head))) + (loop (if index variables tail) + (if index + (string-replace str value + index (+ index len)) + str))))))) + +(define (expand-origin str directory) + "Replace occurrences of '$ORIGIN' in STR with DIRECTORY." + (expand-variable str "ORIGIN" directory)) + (define* (validate-needed-in-runpath file #:key (always-found? libc-library?)) "Return #t if all the libraries listed as FILE's 'DT_NEEDED' entries are @@ -254,17 +279,18 @@ exceeds total size~%" (let* ((elf (call-with-input-file file (compose parse-elf get-bytevector-all))) + (expand (cute expand-origin <> (dirname file))) (dyninfo (elf-dynamic-info elf))) (when dyninfo - (let* ((runpath (filter store-file-name? - (elf-dynamic-info-runpath dyninfo))) - (bogus (remove store-file-name? - (elf-dynamic-info-runpath dyninfo))) + ;; XXX: In theory we should also expand $PLATFORM and $LIB, but these + ;; appear to be really unused. + (let* ((expanded (map expand (elf-dynamic-info-runpath dyninfo))) + (runpath (filter store-file-name? expanded)) + (bogus (remove store-file-name? expanded)) (needed (remove always-found? (elf-dynamic-info-needed dyninfo))) (not-found (remove (cut search-path runpath <>) needed))) - ;; XXX: $ORIGIN is not supported. (unless (null? bogus) (format (current-error-port) "~a: warning: RUNPATH contains bogus entries: ~s~%" -- cgit v1.2.3 From cb85eb5e6569378d444b45cf209324e38f6ec0f4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Apr 2015 11:59:35 +0200 Subject: build-system/gnu: Gracefully handle dangling symlinks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by Tomáš Čech . * guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files that don't pass 'file-exists?'. (patch-generated-file-shebangs): Likewise. --- guix/build/gnu-build-system.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index c60f8ba162..00422458ab 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -164,7 +164,10 @@ 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 file-is-directory? (find-files "." ".*")))) + (remove (lambda (file) + (or (not (file-exists? file)) ;dangling symlink + (file-is-directory? file))) + (find-files ".")))) (define (patch-generated-file-shebangs . rest) "Patch shebangs in generated files, including `SHELL' variables in @@ -173,9 +176,10 @@ makefiles." ;; `configure'. (for-each patch-shebang (filter (lambda (file) - (and (executable-file? file) + (and (file-exists? file) + (executable-file? file) (not (file-is-directory? file)))) - (find-files "." ".*"))) + (find-files "."))) ;; Patch `SHELL' in generated makefiles. (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) -- cgit v1.2.3 From 0bd4377566f80e6736492ea6ecfe3fdb14310717 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Apr 2015 18:50:37 +0200 Subject: build-system/gnu: #:validate-runpath? now defaults to #t. * guix/build/gnu-build-system.scm (validate-runpath): Change default value of VALIDATE-RUNPATH? to #t. --- guix/build/gnu-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 00422458ab..5062479360 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -418,7 +418,7 @@ effects, such as displaying warnings or error messages." (loop tail (and (pred head) result)))))) (define* (validate-runpath #:key - validate-runpath? + (validate-runpath? #t) (elf-directories '("lib" "lib64" "libexec" "bin" "sbin")) outputs #:allow-other-keys) -- cgit v1.2.3 From d074e2f99130782e8eb7fa44c79c01db6c86f77d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Apr 2015 18:51:50 +0200 Subject: build-system/{cmake,glib-or-gtk}: Add #:validate-runpath? parameter. * guix/build-system/cmake.scm (cmake-build): Add #:validate-runpath? parameter and pass it to BUILDER. * guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise. --- guix/build-system/cmake.scm | 2 ++ guix/build-system/glib-or-gtk.scm | 2 ++ 2 files changed, 4 insertions(+) (limited to 'guix') diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index 2e6784251e..1bc1879be5 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -84,6 +84,7 @@ (tests? #t) (test-target "test") (parallel-build? #t) (parallel-tests? #f) + (validate-runpath? #t) (patch-shebangs? #t) (strip-binaries? #t) (strip-flags ''("--strip-debug")) @@ -121,6 +122,7 @@ provides a 'CMakeLists.txt' file as its build system." #:test-target ,test-target #:parallel-build? ,parallel-build? #:parallel-tests? ,parallel-tests? + #:validate-runpath? ,validate-runpath? #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:strip-flags ,strip-flags diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index 85d01961a5..954c716893 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm @@ -127,6 +127,7 @@ (test-target "check") (parallel-build? #t) (parallel-tests? #t) + (validate-runpath? #t) (patch-shebangs? #t) (strip-binaries? #t) (strip-flags ''("--strip-debug")) @@ -175,6 +176,7 @@ #:test-target ,test-target #:parallel-build? ,parallel-build? #:parallel-tests? ,parallel-tests? + #:validate-runpath? ,validate-runpath? #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:strip-flags ,strip-flags -- cgit v1.2.3 From abcbda48c20da3d621e8170f8de30a575f080b51 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 May 2015 16:05:40 +0200 Subject: packages: Add '%hydra-supported-systems'. * build-aux/hydra/gnu-system.scm (%hydra-supported-systems): Remove. * guix/packages.scm (%hydra-supported-systems): New variable. --- build-aux/hydra/gnu-system.scm | 4 ---- guix/packages.scm | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index 9a47b4f423..c612ff1f12 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm @@ -210,10 +210,6 @@ valid." #f))))) -(define %hydra-supported-systems - ;; This is the list of system types for which build slaves are available. - '("x86_64-linux" "i686-linux" "mips64el-linux")) - ;;; ;;; Hydra entry point. ;;; diff --git a/guix/packages.scm b/guix/packages.scm index 0e4cce17e1..a979f31a32 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -95,6 +95,7 @@ package-grafts %supported-systems + %hydra-supported-systems supported-package? &package-error @@ -210,6 +211,11 @@ corresponds to the arguments expected by `set-path-environment-variable'." ;; expect all packages to build successfully here. '("x86_64-linux" "i686-linux" "armhf-linux" "mips64el-linux")) +(define %hydra-supported-systems + ;; This is the list of system types for which build slaves are available. + (delete "armhf-linux" %supported-systems)) + + ;; A package. (define-record-type* package make-package -- cgit v1.2.3