summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/r.scm2
-rw-r--r--guix/build/bzr.scm8
-rw-r--r--guix/bzr-download.scm6
-rw-r--r--guix/diagnostics.scm2
-rw-r--r--guix/import/cran.scm4
-rw-r--r--guix/import/minetest.scm4
-rw-r--r--guix/lint.scm24
-rw-r--r--guix/packages.scm2
-rw-r--r--guix/scripts/import.scm39
-rwxr-xr-xguix/scripts/substitute.scm12
-rw-r--r--guix/store.scm21
-rw-r--r--guix/utils.scm37
12 files changed, 78 insertions, 83 deletions
diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm
index 2c82390ba6..620822b870 100644
--- a/guix/build-system/r.scm
+++ b/guix/build-system/r.scm
@@ -61,7 +61,7 @@ release corresponding to NAME and VERSION."
"/src/contrib/"
name "_" version ".tar.gz")
;; TODO: use %bioconductor-version from (guix import cran)
- (string-append "https://bioconductor.org/packages/3.14"
+ (string-append "https://bioconductor.org/packages/3.15"
type-url-part
"/src/contrib/"
name "_" version ".tar.gz"))))
diff --git a/guix/build/bzr.scm b/guix/build/bzr.scm
index 86ee11391d..a0f5e15880 100644
--- a/guix/build/bzr.scm
+++ b/guix/build/bzr.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2018, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -28,7 +28,7 @@
;;; Code:
(define* (bzr-fetch url revision directory
- #:key (bzr-command "bzr"))
+ #:key (bzr-command "brz"))
"Fetch REVISION from URL into DIRECTORY. REVISION must be a valid Bazaar
revision identifier. Return #t on success, else throw an exception."
;; Do not attempt to write .bzr.log to $HOME, which doesn't exist.
@@ -37,8 +37,6 @@ revision identifier. Return #t on success, else throw an exception."
(invoke bzr-command "-Ossl.cert_reqs=none" "checkout"
"--lightweight" "-r" revision url directory)
(with-directory-excursion directory
- (begin
- (delete-file-recursively ".bzr")
- #t)))
+ (delete-file-recursively ".bzr")))
;;; bzr.scm ends here
diff --git a/guix/bzr-download.scm b/guix/bzr-download.scm
index 010e0decff..d97f84838e 100644
--- a/guix/bzr-download.scm
+++ b/guix/bzr-download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2017, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -48,7 +48,7 @@
(define (bzr-package)
"Return the default Bazaar package."
(let ((distro (resolve-interface '(gnu packages version-control))))
- (module-ref distro 'bazaar)))
+ (module-ref distro 'breezy)))
(define* (bzr-fetch ref hash-algo hash
#:optional name
@@ -64,7 +64,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(use-modules (guix build bzr))
(bzr-fetch
(getenv "bzr url") (getenv "bzr reference") #$output
- #:bzr-command (string-append #+bzr "/bin/bzr")))))
+ #:bzr-command (string-append #+bzr "/bin/brz")))))
(mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "bzr-branch") build
diff --git a/guix/diagnostics.scm b/guix/diagnostics.scm
index bf1ced8140..9f0d558f2f 100644
--- a/guix/diagnostics.scm
+++ b/guix/diagnostics.scm
@@ -232,7 +232,7 @@ macro-expansion time."
by Guile's `source-properties', `frame-source', `current-source-location',
etc."
;; In accordance with the GCS, start line and column numbers at 1. Note
- ;; that unlike LINE and `port-column', COL is actually 1-indexed here...
+ ;; that unlike LINE and `port-column', COL is actually 0-indexed here...
(match loc
((('line . line) ('column . col) ('filename . file)) ;common case
(and file line col
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index e848ebc789..4e1ce7c010 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -156,9 +156,9 @@ package definition."
(define %cran-canonical-url "https://cran.r-project.org/package=")
(define %bioconductor-url "https://bioconductor.org/packages/")
-;; The latest Bioconductor release is 3.14. Bioconductor packages should be
+;; The latest Bioconductor release is 3.15. Bioconductor packages should be
;; updated together.
-(define %bioconductor-version "3.14")
+(define %bioconductor-version "3.15")
(define* (bioconductor-packages-list-url #:optional type)
(string-append "https://bioconductor.org/packages/"
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index 3b2cdcdcac..43cfb533e2 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -427,10 +427,10 @@ DEPENDENCIES as a list of AUTHOR/NAME strings."
(match sort
("score"
(warning
- (G_ "The implementation with the highest score will be choosen!~%")))
+ (G_ "The implementation with the highest score will be chosen!~%")))
("downloads"
(warning
- (G_ "The implementation that has been downloaded the most will be choosen!~%"))))
+ (G_ "The implementation that has been downloaded the most will be chosen!~%"))))
(package-full-name too))
(()
(warning
diff --git a/guix/lint.scm b/guix/lint.scm
index 375f189335..73581b518f 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -494,16 +494,16 @@ of a package, and INPUT-NAMES, a list of package specifications such as
"m4"
"qttools"
"yasm" "nasm" "fasm"
- "python-coverage" "python2-coverage"
- "python-cython" "python2-cython"
- "python-docutils" "python2-docutils"
- "python-mock" "python2-mock"
- "python-nose" "python2-nose"
- "python-pbr" "python2-pbr"
- "python-pytest" "python2-pytest"
- "python-pytest-cov" "python2-pytest-cov"
- "python-setuptools-scm" "python2-setuptools-scm"
- "python-sphinx" "python2-sphinx"
+ "python-coverage"
+ "python-cython"
+ "python-docutils"
+ "python-mock"
+ "python-nose"
+ "python-pbr"
+ "python-pytest"
+ "python-pytest-cov"
+ "python-setuptools-scm"
+ "python-sphinx"
"scdoc"
"swig"
"qmake"
@@ -523,9 +523,7 @@ of a package, and INPUT-NAMES, a list of package specifications such as
;; Emit a warning if some inputs of PACKAGE are likely to should not be
;; an input at all.
(let ((input-names '("python-setuptools"
- "python2-setuptools"
- "python-pip"
- "python2-pip")))
+ "python-pip")))
(map (lambda (input)
(make-warning
package
diff --git a/guix/packages.scm b/guix/packages.scm
index 7ee65e9b6b..7425389618 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -662,7 +662,7 @@ interfaces."
(assoc-ref (package-properties p) 'hidden?))
(define (package-superseded p)
- "Return the package the supersedes P, or #f if P is still current."
+ "Return the package that supersedes P, or #f if P is still current."
(assoc-ref (package-properties p) 'superseded))
(define (deprecated-package old-name p)
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index fa79f3211e..62aa7bdbc5 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 David Thompson <davet@gnu.org>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
-;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -25,6 +25,7 @@
(define-module (guix scripts import)
#:use-module (guix ui)
#:use-module (guix scripts)
+ #:use-module (guix scripts style)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
@@ -32,43 +33,11 @@
#:use-module (srfi srfi-37)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
- #:use-module (ice-9 pretty-print)
#:export (%standard-import-options
guix-import))
;;;
-;;; Helper.
-;;;
-
-(define (newline-rewriting-port output)
- "Return an output port that rewrites strings containing the \\n escape
-to an actual newline. This works around the behavior of `pretty-print'
-and `write', which output these as \\n instead of actual newlines,
-whereas we want the `description' field to contain actual newlines
-rather than \\n."
- (define (write-string str)
- (let loop ((chars (string->list str)))
- (match chars
- (()
- #t)
- ((#\\ #\n rest ...)
- (newline output)
- (loop rest))
- ((chr rest ...)
- (write-char chr output)
- (loop rest)))))
-
- (make-soft-port (vector (cut write-char <>)
- write-string
- (lambda _ #t) ; flush
- #f
- (lambda _ #t) ; close
- #f)
- "w"))
-
-
-;;;
;;; Command line options.
;;;
@@ -119,9 +88,7 @@ Run IMPORTER with ARGS.\n"))
((importer args ...)
(if (member importer importers)
(let ((print (lambda (expr)
- (pretty-print expr (newline-rewriting-port
- (current-output-port))
- #:max-expr-width 80))))
+ (pretty-print-with-comments (current-output-port) expr))))
(match (apply (resolve-importer importer) args)
((and expr (or ('package _ ...)
('let _ ...)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 908a8334a8..c5f5d23b47 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -704,6 +704,14 @@ default value."
(category internal)
(synopsis "implement the build daemon's substituter protocol")
+ (match args
+ ((or ("-V") ("--version"))
+ (show-version-and-exit "guix substitute"))
+ ((or ("-h") ("--help") ())
+ (show-help)
+ (exit 0))
+ (_ #t))
+
(define print-build-trace?
(match (or (find-daemon-option "untrusted-print-extended-build-trace")
(find-daemon-option "print-extended-build-trace"))
@@ -775,10 +783,6 @@ default value."
#:print-build-trace?
print-build-trace?)
(loop))))))
- ((or ("-V") ("--version"))
- (show-version-and-exit "guix substitute"))
- ((or ("-h") ("--help"))
- (show-help))
(opts
(leave (G_ "~a: unrecognized options~%") opts))))))
diff --git a/guix/store.scm b/guix/store.scm
index 82fca14cd9..6bdd071b48 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1337,7 +1337,17 @@ object, only for build requests on EXPECTED-STORE."
(if (and (eq? (store-connection-socket store)
(store-connection-socket expected-store))
(= mode (build-mode normal)))
- (unresolved things continue)
+ (begin
+ ;; Preserve caches accumulated up to this handler invocation.
+ (set-store-connection-caches! expected-store
+ (store-connection-caches store))
+
+ (unresolved things
+ (lambda (new-store value)
+ ;; Borrow caches from NEW-STORE.
+ (set-store-connection-caches!
+ store (store-connection-caches new-store))
+ (continue value))))
(continue #t))))
(define default-cutoff
@@ -1397,7 +1407,8 @@ CUTOFF is the threshold above which we stop accumulating unresolved nodes."
(if (unresolved? obj)
;; Pass #f because 'build-things' is now
;; unnecessary.
- ((unresolved-continuation obj) #f)
+ ((unresolved-continuation obj)
+ store #f)
obj))
result #:cutoff cutoff)
(map/accumulate-builds store proc rest #:cutoff cutoff)))))
@@ -1840,8 +1851,10 @@ This is a mutating version that should be avoided. Prefer the functional
(define (references/cached store item)
"Like 'references', but cache results."
- (let ((cache (store-connection-cache store %reference-cache-id)))
- (match (vhash-assoc item cache)
+ (let* ((cache (store-connection-cache store %reference-cache-id))
+ (value (vhash-assoc item cache)))
+ (record-cache-lookup! %reference-cache-id value cache)
+ (match value
((_ . references)
references)
(#f
diff --git a/guix/utils.scm b/guix/utils.scm
index 44c46cb4a9..37b2e29800 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -8,12 +8,11 @@
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018, 2020 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
-;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -38,7 +37,6 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-39)
#:use-module (srfi srfi-71)
- #:use-module (ice-9 ftw)
#:use-module (rnrs io ports) ;need 'port-position' etc.
#:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!))
#:use-module (guix memoization)
@@ -49,10 +47,11 @@
#:use-module ((guix combinators) #:select (fold2))
#:use-module (guix diagnostics) ;<location>, &error-location, etc.
#:use-module (ice-9 format)
- #:use-module (ice-9 regex)
- #:use-module (ice-9 match)
- #:use-module (ice-9 format)
+ #:use-module (ice-9 ftw)
#:use-module ((ice-9 iconv) #:prefix iconv:)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
+ #:use-module (ice-9 rdelim)
#:use-module (ice-9 vlist)
#:autoload (zlib) (make-zlib-input-port make-zlib-output-port)
#:use-module (system foreign)
@@ -79,6 +78,7 @@
substitute-keyword-arguments
ensure-keyword-arguments
+ %guix-source-root-directory
current-source-directory
nix-system->gnu-triplet
@@ -133,6 +133,7 @@
readlink*
go-to-location
edit-expression
+ delete-expression
filtered-port
decompressed-port
@@ -433,11 +434,13 @@ TARGET must be stat buffers as returned by 'stat'."
(hash-set! %source-location-map target-key
`(,@target-stamp ,source-map)))))))
-(define* (edit-expression source-properties proc #:key (encoding "UTF-8"))
+(define* (edit-expression source-properties proc #:key (encoding "UTF-8")
+ include-trailing-newline?)
"Edit the expression specified by SOURCE-PROPERTIES using PROC, which should
be a procedure that takes the original expression in string and returns a new
-one. ENCODING will be used to interpret all port I/O, it default to UTF-8.
-This procedure returns #t on success."
+one. ENCODING will be used to interpret all port I/O, it defaults to UTF-8.
+This procedure returns #t on success. When INCLUDE-TRAILING-NEWLINE? is true,
+the trailing line is included in the edited expression."
(define file (assq-ref source-properties 'filename))
(define line (assq-ref source-properties 'line))
(define column (assq-ref source-properties 'column))
@@ -446,10 +449,14 @@ This procedure returns #t on success."
(call-with-input-file file
(lambda (in)
(let* ( ;; The start byte position of the expression.
- (start (begin (go-to-location in (+ 1 line) (+ 1 column))
+ (start (begin (go-to-location
+ in (+ 1 line) (+ 1 column))
(ftell in)))
;; The end byte position of the expression.
- (end (begin (read in) (ftell in))))
+ (end (begin (read in)
+ (when include-trailing-newline?
+ (read-line in))
+ (ftell in))))
(seek in 0 SEEK_SET) ; read from the beginning of the file.
(let* ((pre-bv (get-bytevector-n in start))
;; The expression in string form.
@@ -478,6 +485,10 @@ This procedure returns #t on success."
(move-source-location-map! (stat in) (stat file)
(+ 1 line))))))))))
+(define (delete-expression source-properties)
+ "Delete the expression specified by SOURCE-PROPERTIES."
+ (edit-expression source-properties (const "") #:include-trailing-newline? #t))
+
;;;
;;; Keyword arguments.
@@ -1021,6 +1032,10 @@ environment variable name like \"XDG_CONFIG_HOME\"; SUFFIX is a suffix like
;;; Source location.
;;;
+(define (%guix-source-root-directory)
+ "Return the source root directory of the Guix found in %load-path."
+ (dirname (absolute-dirname "guix/packages.scm")))
+
(define absolute-dirname
;; Memoize to avoid repeated 'stat' storms from 'search-path'.
(mlambda (file)