From c254ac32004a4407d73ab254bc1c44eed0220355 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 24 Nov 2016 09:11:39 +0100 Subject: build-system/gnu: Make libraries writable before stripping. * guix/build/gnu-build-system.scm (strip)[strip-dir]: Change mode of files before running strip-command. --- guix/build/gnu-build-system.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guix') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 1dfd85450c..59394c2cac 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -393,6 +393,8 @@ makefiles." (or (elf-file? file) (ar-file? file)) (or (not debug-output) (make-debug-file file)) + ;; Ensure libraries are writable. + (chmod file #o755) (zero? (apply system* strip-command (append strip-flags (list file)))) (or (not debug-output) -- cgit v1.2.3 From be12f4e27505edd87c4aa457fec43dd0fee23b79 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 23 Nov 2016 18:40:53 +0100 Subject: build-system/perl: Don't create non-deterministic 'perllocal.pod' files. * guix/build/perl-build-system.scm (configure): Add "NO_PERLLOCAL=1" to Makefile.PL arguments. --- guix/build/perl-build-system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/perl-build-system.scm b/guix/build/perl-build-system.scm index 8f480eae16..b2024e4406 100644 --- a/guix/build/perl-build-system.scm +++ b/guix/build/perl-build-system.scm @@ -42,7 +42,11 @@ "--installdirs=site" ,@module-build-flags)) ((file-exists? "Makefile.PL") `("Makefile.PL" ,(string-append "PREFIX=" out) - "INSTALLDIRS=site" ,@make-maker-flags)) + ;; Prevent installation of 'perllocal.pod' files for + ;; determinism. These are typically used to build a + ;; catalogue of installed packages, but does not provide + ;; any useful information when installed with a module. + "INSTALLDIRS=site" "NO_PERLLOCAL=1" ,@make-maker-flags)) (else (error "no Build.PL or Makefile.PL found"))))) (format #t "running `perl' with arguments ~s~%" args) (zero? (apply system* "perl" args)))) -- cgit v1.2.3 From c5746f239964a72642ac56640b8ff490d5bfa673 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 22 Jan 2017 22:25:26 +0100 Subject: guix package: Honor the order of profiles when -p appears multiple times. * guix/scripts/package.scm (process-query): Reverse the order of PROFILES. * tests/guix-package-net.sh: Test it with '--search-paths'. --- guix/scripts/package.scm | 4 ++-- tests/guix-package-net.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 90e7fa2298..79622ac149 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2013, 2015 Mark H Weaver ;;; Copyright © 2014, 2016 Alex Kost @@ -666,7 +666,7 @@ processed, #f otherwise." (_ #f)) opts) (() (list %current-profile)) - (lst lst))) + (lst (reverse lst)))) (profile (match profiles ((head tail ...) head)))) (match (assoc-ref opts 'query) diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index 35ef6ff1a0..1eff6abba3 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès # Copyright © 2013 Nikita Karetnikov # # This file is part of GNU Guix. @@ -165,7 +165,7 @@ guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap if guix package -p "$profile" --search-paths | grep LIBRARY_PATH then false; fi guix package -p "$profile" -p "$profile_alt" --search-paths \ - | grep "LIBRARY_PATH.*$profile/lib" + | grep "LIBRARY_PATH.*$profile/lib.$profile_alt/lib" # # Try with the default profile. -- cgit v1.2.3 From fcd75bdbfa99d14363b905afbf914eec20e69df8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 22 Jan 2017 22:42:57 +0100 Subject: search-paths: Allow specs with #f as their separator. This adds support for single-entry search paths. Fixes . Reported by Leo Famulari . * guix/search-paths.scm ()[separator]: Document as string or #f. (evaluate-search-paths): Add case for SEPARATOR as #f. (environment-variable-definition): Handle SEPARATOR being #f. * guix/build/utils.scm (list->search-path-as-string): Add case for SEPARATOR as #f. (search-path-as-string->list): Likewise. * guix/build/profiles.scm (abstract-profile): Likewise. * tests/search-paths.scm: New file. * Makefile.am (SCM_TESTS): Add it. * tests/packages.scm ("--search-paths with single-item search path"): New test. * gnu/packages/version-control.scm (git)[native-search-paths](separator): New field. --- Makefile.am | 3 ++- gnu/packages/version-control.scm | 4 ++-- guix/build/profiles.scm | 24 ++++++++++++-------- guix/build/utils.scm | 13 ++++++++--- guix/search-paths.scm | 28 ++++++++++++++++------- tests/packages.scm | 49 +++++++++++++++++++++++++++++++++++++++- tests/search-paths.scm | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 tests/search-paths.scm (limited to 'guix') diff --git a/Makefile.am b/Makefile.am index 3e147df2e0..dd9069ea76 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès # Copyright © 2013 Andreas Enge # Copyright © 2015 Alex Kost # Copyright © 2016 Mathieu Lirzin @@ -272,6 +272,7 @@ SCM_TESTS = \ tests/nar.scm \ tests/union.scm \ tests/profiles.scm \ + tests/search-paths.scm \ tests/syscalls.scm \ tests/gremlin.scm \ tests/bournish.scm \ diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 7918b90ca6..bf1842010f 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2013 Cyril Roelandt -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2014, 2015, 2016 Mark H Weaver @@ -297,10 +297,10 @@ as well as the classic centralized workflow.") (native-search-paths ;; For HTTPS access, Git needs a single-file certificate bundle, specified ;; with $GIT_SSL_CAINFO. - ;; FIXME: This variable designates a single file; it is not a search path. (list (search-path-specification (variable "GIT_SSL_CAINFO") (file-type 'regular) + (separator #f) ;single entry (files '("etc/ssl/certs/ca-certificates.crt"))))) (synopsis "Distributed version control system") diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm index 6e316d5d2c..42eabfaf19 100644 --- a/guix/build/profiles.scm +++ b/guix/build/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,17 +39,21 @@ 'GUIX_PROFILE' environment variable. This allows users to specify what the user-friendly name of the profile is, for instance ~/.guix-profile rather than /gnu/store/...-profile." - (let ((replacement (string-append "${GUIX_PROFILE:-" profile "}"))) + (let ((replacement (string-append "${GUIX_PROFILE:-" profile "}")) + (crop (cute string-drop <> (string-length profile)))) (match-lambda ((search-path . value) - (let* ((separator (search-path-specification-separator search-path)) - (items (string-tokenize* value separator)) - (crop (cute string-drop <> (string-length profile)))) - (cons search-path - (string-join (map (lambda (str) - (string-append replacement (crop str))) - items) - separator))))))) + (match (search-path-specification-separator search-path) + (#f + (cons search-path + (string-append replacement (crop value)))) + ((? string? separator) + (let ((items (string-tokenize* value separator))) + (cons search-path + (string-join (map (lambda (str) + (string-append replacement (crop str))) + items) + separator))))))))) (define (write-environment-variable-definition port) "Write the given environment variable definition to PORT." diff --git a/guix/build/utils.scm b/guix/build/utils.scm index bc6f114152..cf09326393 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2015 Mark H Weaver @@ -400,10 +400,17 @@ for under the directories designated by FILES. For example: (delete-duplicates input-dirs))) (define (list->search-path-as-string lst separator) - (string-join lst separator)) + (if separator + (string-join lst separator) + (match lst + ((head rest ...) head) + (() "")))) (define* (search-path-as-string->list path #:optional (separator #\:)) - (string-tokenize path (char-set-complement (char-set separator)))) + (if separator + (string-tokenize path + (char-set-complement (char-set separator))) + (list path))) (define* (set-path-environment-variable env-var files input-dirs #:key diff --git a/guix/search-paths.scm b/guix/search-paths.scm index 7a6fe67959..4bf0e44389 100644 --- a/guix/search-paths.scm +++ b/guix/search-paths.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,7 +55,7 @@ search-path-specification? (variable search-path-specification-variable) ;string (files search-path-specification-files) ;list of strings - (separator search-path-specification-separator ;string + (separator search-path-specification-separator ;string | #f (default ":")) (file-type search-path-specification-file-type ;symbol (default 'directory)) @@ -131,11 +131,23 @@ like `string-tokenize', but SEPARATOR is a string." DIRECTORIES, a list of directory names, and return a list of specification/value pairs. Use GETENV to determine the current settings and report only settings not already effective." - (define search-path-definition - (match-lambda - ((and spec - ($ variable files separator - type pattern)) + (define (search-path-definition spec) + (match spec + (($ variable files #f type pattern) + ;; Separator is #f so return the first match. + (match (with-null-error-port + (search-path-as-list files directories + #:type type + #:pattern pattern)) + (() + #f) + ((head . _) + (let ((value (getenv variable))) + (if (and value (string=? value head)) + #f ;VARIABLE already set appropriately + (cons spec head)))))) + (($ variable files separator + type pattern) (let* ((values (or (and=> (getenv variable) (cut string-tokenize* <> separator)) '())) @@ -164,7 +176,7 @@ current value), or 'suffix (return the definition where VALUE is added as a suffix to VARIABLE's current value.) In the case of 'prefix and 'suffix, SEPARATOR is used as the separator between VARIABLE's current value and its prefix/suffix." - (match kind + (match (if (not separator) 'exact kind) ('exact (format #f "export ~a=\"~a\"" variable value)) ('prefix diff --git a/tests/packages.scm b/tests/packages.scm index 247f75cc43..962f120ea2 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +42,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module (gnu packages bootstrap) + #:use-module (gnu packages version-control) #:use-module (gnu packages xml) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -979,6 +980,52 @@ (guix-package "-p" (derivation->output-path prof) "--search-paths")))))) +(test-assert "--search-paths with single-item search path" + ;; Make sure 'guix package --search-paths' correctly reports environment + ;; variables for things like 'GIT_SSL_CAINFO' that have #f as their + ;; separator, meaning that the first match wins. + (let* ((p1 (dummy-package "foo" + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let ((out (assoc-ref %outputs "out"))) + (mkdir-p (string-append out "/etc/ssl/certs")) + (call-with-output-file + (string-append + out "/etc/ssl/certs/ca-certificates.crt") + (const #t)))))))) + (p2 (package (inherit p1) (name "bar"))) + (p3 (dummy-package "git" + ;; Provide a fake Git to avoid building the real one. + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:builder (mkdir (assoc-ref %outputs "out")))) + (native-search-paths (package-native-search-paths git)))) + (prof1 (run-with-store %store + (profile-derivation + (packages->manifest (list p1 p3)) + #:hooks '() + #:locales? #f) + #:guile-for-build (%guile-for-build))) + (prof2 (run-with-store %store + (profile-derivation + (packages->manifest (list p2 p3)) + #:hooks '() + #:locales? #f) + #:guile-for-build (%guile-for-build)))) + (build-derivations %store (list prof1 prof2)) + (string-match (format #f "^export GIT_SSL_CAINFO=\"~a/etc/ssl/certs/ca-certificates.crt" + (regexp-quote (derivation->output-path prof1))) + (with-output-to-string + (lambda () + (guix-package "-p" (derivation->output-path prof1) + "-p" (derivation->output-path prof2) + "--search-paths")))))) + (test-equal "specification->package when not found" 'quit (catch 'quit diff --git a/tests/search-paths.scm b/tests/search-paths.scm new file mode 100644 index 0000000000..2a4c18dd76 --- /dev/null +++ b/tests/search-paths.scm @@ -0,0 +1,48 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (test-search-paths) + #:use-module (guix search-paths) + #:use-module (ice-9 match) + #:use-module (srfi srfi-64)) + +(define %top-srcdir + (dirname (search-path %load-path "guix.scm"))) + + +(test-begin "search-paths") + +(test-equal "evaluate-search-paths, separator is #f" + (string-append %top-srcdir + "/gnu/packages/bootstrap/armhf-linux") + + ;; The following search path spec should evaluate to a single item: the + ;; first directory that matches the "-linux$" pattern in + ;; gnu/packages/bootstrap. + (let ((spec (search-path-specification + (variable "CHBOUIB") + (files '("gnu/packages/bootstrap")) + (file-type 'directory) + (separator #f) + (file-pattern "-linux$")))) + (match (evaluate-search-paths (list spec) + (list %top-srcdir)) + (((spec* . value)) + (and (eq? spec* spec) value))))) + +(test-end "search-paths") -- cgit v1.2.3 From 0363474a0b57067000ddd4b131cb31d7c70223fb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Jan 2017 11:27:11 +0100 Subject: build-system/gnu: 'strip' phase now skips symlinks. This avoids a situation where the "debug" output would contain separate (and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even though "libfoo.so" is actually a symlink to "libfoo.so.0.0". * guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in 'for-each' lambda. Pass a predicate to 'find-files' to restrict the result to regular files. --- guix/build/gnu-build-system.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 59394c2cac..a19d2a3e96 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -389,8 +389,7 @@ makefiles." debug-output objcopy-command)) (for-each (lambda (file) - (and (file-exists? file) ;discard dangling symlinks - (or (elf-file? file) (ar-file? file)) + (and (or (elf-file? file) (ar-file? file)) (or (not debug-output) (make-debug-file file)) ;; Ensure libraries are writable. @@ -399,7 +398,12 @@ makefiles." (append strip-flags (list file)))) (or (not debug-output) (add-debug-link file)))) - (find-files dir))) + (find-files dir + (lambda (file stat) + ;; Ignore symlinks such as: + ;; libfoo.so -> libfoo.so.0.0. + (eq? 'regular (stat:type stat))) + #:stat lstat))) (or (not strip-binaries?) (every strip-dir -- cgit v1.2.3 From 95e7be97282f136190d7007f34d355a9691a16fa Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Jan 2017 21:58:37 +0100 Subject: utils: Add 'gzip-file?' and 'reset-gzip-timestamp'. * guix/build/utils.scm (%gzip-magic-bytes): New variable. (gzip-file?, reset-gzip-timestamp): New procedures. --- guix/build/utils.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'guix') diff --git a/guix/build/utils.scm b/guix/build/utils.scm index cf09326393..9e9ac90050 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -45,6 +45,8 @@ call-with-ascii-input-file elf-file? ar-file? + gzip-file? + reset-gzip-timestamp with-directory-excursion mkdir-p install-file @@ -195,6 +197,29 @@ with the bytes in HEADER, a bytevector." (define ar-file? (file-header-match %ar-magic-bytes)) +(define %gzip-magic-bytes + ;; Magic bytes of gzip file. Beware, it's a small header so there could be + ;; false positives. + #vu8(#x1f #x8b)) + +(define gzip-file? + (file-header-match %gzip-magic-bytes)) + +(define* (reset-gzip-timestamp file #:key (keep-mtime? #t)) + "If FILE is a gzip file, reset its embedded timestamp (as with 'gzip +--no-name') and return true. Otherwise return #f. When KEEP-MTIME? is true, +preserve FILE's modification time." + (let ((stat (stat file)) + (port (open file O_RDWR))) + (dynamic-wind + (const #t) + (lambda () + (and (= 4 (seek port 4 SEEK_SET)) + (put-bytevector port #vu8(0 0 0 0)))) + (lambda () + (close-port port) + (set-file-time file stat))))) + (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." (let ((init (getcwd))) -- cgit v1.2.3 From 1d636d63193b66f67fbd0f10315cd61818f132c1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Jan 2017 22:05:49 +0100 Subject: build-system/gnu: Add 'reset-gzip-timestamps' phase. * guix/build/gnu-build-system.scm (reset-gzip-timestamps): New procedure. (%standard-phases): Add it. --- guix/build/gnu-build-system.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'guix') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index a19d2a3e96..39ed1e4d4a 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -482,6 +482,23 @@ and 'man/'. This phase moves directories to the right place if needed." (for-each validate-output directories))) #t) +(define* (reset-gzip-timestamps #:key outputs #:allow-other-keys) + "Reset embedded timestamps in gzip files found in OUTPUTS." + (define (process-directory directory) + (let ((files (find-files directory + (lambda (file stat) + (and (eq? 'regular (stat:type stat)) + (or (string-suffix? ".gz" file) + (string-suffix? ".tgz" file)) + (gzip-file? file))) + #:stat lstat))) + (for-each reset-gzip-timestamp files))) + + (match outputs + (((names . directories) ...) + (for-each process-directory directories))) + #t) + (define* (compress-documentation #:key outputs (compress-documentation? #t) (documentation-compressor "gzip") @@ -604,6 +621,7 @@ which cannot be found~%" validate-documentation-location delete-info-dir-file patch-dot-desktop-files + reset-gzip-timestamps compress-documentation))) -- cgit v1.2.3 From 5a64a791317d98171435eff541a835ab0d3f498c Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 25 Jan 2017 16:28:03 +0100 Subject: utils: Add helper method to make files writable. * gnu/build/activation.scm (make-file-writable): Move this to ... * guix/build/utils.scm (make-file-writable): ... here. Export it. * guix/build/gnu-build-system.scm (strip): Use it. --- gnu/build/activation.scm | 5 ----- guix/build/gnu-build-system.scm | 6 ++++-- guix/build/utils.scm | 6 ++++++ 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'guix') diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 1b31dc1538..756a6872bb 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -78,11 +78,6 @@ (define (dot-or-dot-dot? file) (member file '("." ".."))) -(define (make-file-writable file) - "Make FILE writable for its owner.." - (let ((stat (lstat file))) ;XXX: symlinks - (chmod file (logior #o600 (stat:perms stat))))) - (define* (copy-account-skeletons home #:optional (directory %skeleton-directory)) "Copy the account skeletons from DIRECTORY to HOME." diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 39ed1e4d4a..1786e2e3c9 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -392,8 +392,10 @@ makefiles." (and (or (elf-file? file) (ar-file? file)) (or (not debug-output) (make-debug-file file)) - ;; Ensure libraries are writable. - (chmod file #o755) + + ;; Ensure the file is writable. + (begin (make-file-writable file) #t) + (zero? (apply system* strip-command (append strip-flags (list file)))) (or (not debug-output) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 9e9ac90050..e8efb0653a 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -50,6 +50,7 @@ with-directory-excursion mkdir-p install-file + make-file-writable copy-recursively delete-file-recursively file-name-predicate @@ -262,6 +263,11 @@ name." (mkdir-p directory) (copy-file file (string-append directory "/" (basename file)))) +(define (make-file-writable file) + "Make FILE writable for its owner." + (let ((stat (lstat file))) ;XXX: symlinks + (chmod file (logior #o600 (stat:perms stat))))) + (define* (copy-recursively source destination #:key (log (current-output-port)) -- cgit v1.2.3 From 751702676e0dcf39657082138f45340b65ae4d3e Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis Date: Sat, 25 Feb 2017 18:57:14 +0200 Subject: guix: build: make-bootstrap: Copy "falloc.h" to the new system. In glibc-2.25 a dependency on "linux/falloc.h" was added. This also reverts commit 8f8f250bdca917b3ce38aa0902f01b19081859a4 which is no longer needed. This commit was not compatible with the glibc version Hurd is using. See * guix/build/make-bootstrap.scm (make-stripped-libc): Copy "falloc.h" to the new system. * gnu/packages/patches/glibc-bootstrap-system.patch: Remove part that touches fcntl-linux.h. Problem reported by Andreas Enge . --- gnu/packages/patches/glibc-bootstrap-system.patch | 24 +---------------------- guix/build/make-bootstrap.scm | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) (limited to 'guix') diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch index 6d09efed2c..2f8e7da7e1 100644 --- a/gnu/packages/patches/glibc-bootstrap-system.patch +++ b/gnu/packages/patches/glibc-bootstrap-system.patch @@ -3,10 +3,6 @@ and popen(3) need to be tweaked to use the right shell. For the bootstrap glibc, we just use whatever `sh' can be found in $PATH. The final glibc instead uses the hard-coded absolute file name of `bash'. -The second part that touches fcntl-linux.h reverts a change from glibc-2.25 -which would require the statically compiled glibc used in bootstrapping to -depend on the linux kernel headers. - --- a/sysdeps/posix/system.c +++ b/sysdeps/posix/system.c @@ -134,7 +134,7 @@ do_system (const char *line) @@ -31,22 +27,4 @@ depend on the linux kernel headers. } _IO_close (child_end); ---- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h -+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h -@@ -318,7 +318,15 @@ struct f_owner_ex - - - /* Flags for fallocate. */ -+# define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file -+ even if offset + len is -+ greater than file size. */ -+# define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */ -+# define FALLOC_FL_COLLAPSE_RANGE 8 /* Remove a range of a file -+ without leaving a -+ hole. */ -+# define FALLOC_FL_ZERO_RANGE 16 /* Convert a range of a -+ file to zeros. */ --# include - - - /* File handle structure. */ + diff --git a/guix/build/make-bootstrap.scm b/guix/build/make-bootstrap.scm index 21c78cc8f5..43b136248f 100644 --- a/guix/build/make-bootstrap.scm +++ b/guix/build/make-bootstrap.scm @@ -55,7 +55,7 @@ when producing a bootstrap libc." (string-append incdir "/linux"))) '("limits.h" "errno.h" "socket.h" "kernel.h" "sysctl.h" "param.h" "ioctl.h" "types.h" - "posix_types.h" "stddef.h")) + "posix_types.h" "stddef.h" "falloc.h")) (copy-recursively (string-append kernel-headers "/include/asm") (string-append incdir "/asm")) -- cgit v1.2.3 From cdb3f734cfb93a5689d9fec3558811fe652749f4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 29 Mar 2017 22:50:42 +0200 Subject: packages: Remove "mips64el-linux" from '%hydra-supported-systems'. * guix/packages.scm (%hydra-supported-systems): Remove "mips64el-linux". --- guix/packages.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/packages.scm b/guix/packages.scm index 4bc4b017f4..61171b8342 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -230,8 +230,11 @@ name of its URI." '("i585-gnu" "i686-gnu")) (define %hydra-supported-systems - ;; This is the list of system types for which build slaves are available. - %supported-systems) + ;; This is the list of system types for which build machines are available. + ;; + ;; XXX: MIPS is temporarily unavailable on Hydra: + ;; . + (delete "mips64el-linux" %supported-systems)) ;; A package. -- cgit v1.2.3