diff options
author | Marius Bakke <marius@gnu.org> | 2020-05-29 23:36:38 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2020-05-29 23:36:38 +0200 |
commit | fe6d003908fd8278de65761bc550240c520ef9f4 (patch) | |
tree | abe88c7905a8907ddafc554fbeef5b0af08f835d /guix | |
parent | 8a7a5dc7805f4628e60f90af6b2416f951d0c034 (diff) | |
parent | 031315e4f0fbc4e04ffc8adee04128c23173a1f7 (diff) | |
download | guix-patches-fe6d003908fd8278de65761bc550240c520ef9f4.tar guix-patches-fe6d003908fd8278de65761bc550240c520ef9f4.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build/compile.scm | 3 | ||||
-rw-r--r-- | guix/build/syscalls.scm | 8 | ||||
-rw-r--r-- | guix/gexp.scm | 6 | ||||
-rw-r--r-- | guix/quirks.scm | 16 | ||||
-rw-r--r-- | guix/scripts/size.scm | 4 | ||||
-rw-r--r-- | guix/scripts/system.scm | 16 | ||||
-rw-r--r-- | guix/self.scm | 10 | ||||
-rw-r--r-- | guix/utils.scm | 9 |
8 files changed, 54 insertions, 18 deletions
diff --git a/guix/build/compile.scm b/guix/build/compile.scm index 63f24fa7d4..ea7e1d2d03 100644 --- a/guix/build/compile.scm +++ b/guix/build/compile.scm @@ -98,7 +98,8 @@ (define (override-option option value lst) `(,option ,value ,@(strip-option option lst))) - (cond ((string-contains file "gnu/packages/") + (cond ((or (string-contains file "gnu/packages/") + (string-contains file "gnu/tests/")) ;; Level 0 is good enough but partial evaluation helps preserve the ;; "macro writer's bill of rights". (override-option #:partial-eval? #t diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 8070c5546f..d69b178a0a 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -1404,7 +1404,7 @@ bytevector BV at INDEX." (error "unsupported socket address" sockaddr))))) (define write-socket-address! - (if (string-suffix? "linux-gnu" %host-type) + (if (string-contains %host-type "linux-gnu") write-socket-address!/linux write-socket-address!/hurd)) @@ -1436,7 +1436,7 @@ bytevector BV at INDEX." (vector family))))) (define read-socket-address - (if (string-suffix? "linux-gnu" %host-type) + (if (string-contains %host-type "linux-gnu") read-socket-address/linux read-socket-address/hurd)) @@ -2052,8 +2052,8 @@ correspond to a terminal, return the value returned by FALL-BACK." ;; would return EINVAL instead in some cases: ;; <https://bugs.ruby-lang.org/issues/10494>. ;; Furthermore, some FUSE file systems like unionfs return ENOSYS for - ;; that ioctl. - (if (memv errno (list ENOTTY EINVAL ENOSYS)) + ;; that ioctl, and bcachefs returns EPERM. + (if (memv errno (list ENOTTY EINVAL ENOSYS EPERM)) (fall-back) (apply throw args)))))) diff --git a/guix/gexp.scm b/guix/gexp.scm index 78b8af6fbc..67b6121313 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -51,6 +51,7 @@ local-file-absolute-file-name local-file-name local-file-recursive? + local-file-select? plain-file plain-file? @@ -270,7 +271,9 @@ expand to file names, but it's possible to expand to a plain data type." (if (not expand) (loop lowered (lookup-expander lowered)) (return (expand obj lowered output))) - (return lowered))))))) ;self-quoting + (if (not expand) ;self-quoting + (return lowered) + (return (expand obj lowered output))))))))) (define-syntax define-gexp-compiler (syntax-rules (=> compiler expander) @@ -1440,6 +1443,7 @@ to the source files instead of copying them." #:system system #:guile-for-build guile #:local-build? #t + #:substitutable? #f ;; Avoid deprecation warnings about the use of the _IO* ;; constants in (guix build utils). diff --git a/guix/quirks.scm b/guix/quirks.scm index d180bd2c09..d292f4e932 100644 --- a/guix/quirks.scm +++ b/guix/quirks.scm @@ -57,6 +57,18 @@ #f (apply throw args))))) +(define (requires-guile-2.2? source) + "Return true if SOURCE uses Guile 2.2 for the shebang of +'compute-guix-derivation'." + (define content + (call-with-input-file (string-append source "/" %self-build-file) + read-string)) + + ;; The 'find-best-packages-by-name' call is inserted by %BUG-41214-PATCH. + (string-contains content + (object->string + '(find-best-packages-by-name "guile" "2.2")))) + (define (guile-2.2.4) (module-ref (resolve-interface '(gnu packages guile)) 'guile-2.2.4)) @@ -66,7 +78,8 @@ ;; about specific Guile versions that old Guix revisions might need to use ;; just to be able to build and run the trampoline in %SELF-BUILD-FILE. See ;; <https://bugs.gnu.org/37506> - `((,syscalls-reexports-local-variables? . ,guile-2.2.4))) + `((,syscalls-reexports-local-variables? . ,guile-2.2.4) + (,requires-guile-2.2? . ,guile-2.2.4))) ;;; @@ -143,6 +156,7 @@ corresponds to the given Guix COMMIT, a SHA1 hexadecimal string." (define (build-with-guile-2.2 source) (substitute* (string-append source "/" %self-build-file) (("\\(default-guile\\)") + ;; Note: This goes hand in hand with the 'requires-guile-2.2?' quirk. (object->string '(car (find-best-packages-by-name "guile" "2.2")))) (("\\(find-best-packages-by-name \"guile-gcrypt\" #f\\)") (object->string '(find-best-packages-by-name "guile2.2-gcrypt" #f)))) diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 2446b84587..c42f4f7782 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -230,8 +230,8 @@ the name of a PNG file." ;;; (define (show-help) - (display (G_ "Usage: guix size [OPTION]... PACKAGE -Report the size of PACKAGE and its dependencies.\n")) + (display (G_ "Usage: guix size [OPTION]... PACKAGE|STORE-ITEM +Report the size of the PACKAGE or STORE-ITEM, with its dependencies.\n")) (display (G_ " --substitute-urls=URLS fetch substitute from URLS if they are authorized")) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 3efd113ac8..3d7aa77cb7 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -670,7 +670,7 @@ checking this by themselves in their 'check' procedure." ;;; Action. ;;; -(define* (system-derivation-for-action os action +(define* (system-derivation-for-action os base-image action #:key image-size file-system-type full-boot? container-shared-network? mappings) @@ -694,11 +694,12 @@ checking this by themselves in their 'check' procedure." (* 70 (expt 2 20))) #:mappings mappings)) ((disk-image) - (system-image - (image - (inherit (find-image file-system-type)) - (size image-size) - (operating-system os)))) + (lower-object + (system-image + (image + (inherit base-image) + (size image-size) + (operating-system os))))) ((docker-image) (system-docker-image os #:shared-network? container-shared-network?)))) @@ -800,7 +801,8 @@ static checks." (check-initrd-modules os))) (mlet* %store-monad - ((sys (system-derivation-for-action os action + ((image (find-image file-system-type)) + (sys (system-derivation-for-action os image action #:file-system-type file-system-type #:image-size image-size #:full-boot? full-boot? diff --git a/guix/self.scm b/guix/self.scm index a9568049b2..60fe6e6b01 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -213,7 +213,15 @@ record with the new file name." ;; itself. (local-file (string-append item "/" file) #:recursive? recursive?)) - ;; TODO: Add 'local-file?' case. + ((? local-file? base) + ;; Likewise, but with a <local-file>. + (if (local-file-recursive? base) + (local-file (string-append (local-file-absolute-file-name base) + "/" file) + (basename file) + #:recursive? recursive? + #:select? (local-file-select? base)) + (file-append base file))) (_ ;; In this case, anything that refers to the result also depends on ITEM, ;; which isn't great. diff --git a/guix/utils.scm b/guix/utils.scm index d7b197fa44..69e3f0a934 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> ;;; Copyright © 2015 David Thompson <davet@gnu.org> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> -;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2018, 2020 Marius Bakke <marius@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -78,6 +78,8 @@ target-aarch64? target-arm? target-64bit? + cc-for-target + version-compare version>? version>=? @@ -506,6 +508,11 @@ a character other than '@'." (%current-system)))) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))) +(define* (cc-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-gcc") + "gcc")) + (define version-compare (let ((strverscmp (let ((sym (or (dynamic-func "strverscmp" (dynamic-link)) |