summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-11-07 21:09:57 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-11-07 21:09:57 +0100
commit55174e668f2985d1c4efda4fbf58f4061dde0db2 (patch)
treef55f7e50fff1a1c3d1e6d2e932a7ef19347e5011 /guix
parent1badc85068ee0be2a028c1b94a3dd285901bc391 (diff)
parentb31e1561611ebe4916890183b24e6e13cb83bf59 (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/r.scm2
-rw-r--r--guix/build/store-copy.scm28
-rw-r--r--guix/docker.scm16
-rw-r--r--guix/import/cran.scm4
-rw-r--r--guix/scripts/pack.scm415
-rw-r--r--guix/scripts/pull.scm17
-rw-r--r--guix/self.scm47
-rw-r--r--guix/ssh.scm2
8 files changed, 328 insertions, 203 deletions
diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm
index d5f897932f..664515d0ee 100644
--- a/guix/build-system/r.scm
+++ b/guix/build-system/r.scm
@@ -53,7 +53,7 @@ release corresponding to NAME and VERSION."
(list (string-append "https://bioconductor.org/packages/release/bioc/src/contrib/"
name "_" version ".tar.gz")
;; TODO: use %bioconductor-version from (guix import cran)
- (string-append "https://bioconductor.org/packages/3.7/bioc/src/contrib/Archive/"
+ (string-append "https://bioconductor.org/packages/3.8/bioc/src/contrib/Archive/"
name "_" version ".tar.gz")))
(define %r-build-system-modules
diff --git a/guix/build/store-copy.scm b/guix/build/store-copy.scm
index 64ade7885c..549aa4f28b 100644
--- a/guix/build/store-copy.scm
+++ b/guix/build/store-copy.scm
@@ -168,6 +168,28 @@ REFERENCE-GRAPHS, a list of reference-graph files."
(reduce + 0 (map file-size items)))
+(define (reset-permissions file)
+ "Reset the permissions on FILE and its sub-directories so that they are all
+read-only."
+ ;; XXX: This procedure exists just to work around the inability of
+ ;; 'copy-recursively' to preserve permissions.
+ (file-system-fold (const #t) ;enter?
+ (lambda (file stat _) ;leaf
+ (unless (eq? 'symlink (stat:type stat))
+ (chmod file
+ (if (zero? (logand (stat:mode stat)
+ #o100))
+ #o444
+ #o555))))
+ (const #t) ;down
+ (lambda (directory stat _) ;up
+ (chmod directory #o555))
+ (const #f) ;skip
+ (const #f) ;error
+ #t
+ file
+ lstat))
+
(define* (populate-store reference-graphs target
#:key (log-port (current-error-port)))
"Populate the store under directory TARGET with the items specified in
@@ -197,7 +219,13 @@ REFERENCE-GRAPHS, a list of reference-graph files."
(for-each (lambda (thing)
(copy-recursively thing
(string-append target thing)
+ #:keep-mtime? #t
#:log (%make-void-port "w"))
+
+ ;; XXX: Since 'copy-recursively' doesn't allow us to
+ ;; preserve permissions, we have to traverse TARGET to
+ ;; make sure everything is read-only.
+ (reset-permissions (string-append target thing))
(report))
things)))))
diff --git a/guix/docker.scm b/guix/docker.scm
index 0757d3356f..c19a24d45c 100644
--- a/guix/docker.scm
+++ b/guix/docker.scm
@@ -26,6 +26,7 @@
delete-file-recursively
with-directory-excursion
invoke))
+ #:use-module (gnu build install)
#:use-module (json) ;guile-json
#:use-module (srfi srfi-19)
#:use-module (srfi srfi-26)
@@ -108,11 +109,15 @@ return \"a\"."
(symlinks '())
(transformations '())
(system (utsname:machine (uname)))
+ database
compressor
(creation-time (current-time time-utc)))
"Write to IMAGE a Docker image archive containing the given PATHS. PREFIX
must be a store path that is a prefix of any store paths in PATHS.
+When DATABASE is true, copy it to /var/guix/db in the image and create
+/var/guix/gcroots and friends.
+
SYMLINKS must be a list of (SOURCE -> TARGET) tuples describing symlinks to be
created in the image, where each TARGET is relative to PREFIX.
TRANSFORMATIONS must be a list of (OLD -> NEW) tuples describing how to
@@ -188,10 +193,15 @@ SRFI-19 time-utc object, as the creation time in metadata."
source))))
symlinks)
+ (when database
+ ;; Initialize /var/guix, assuming PREFIX points to a profile.
+ (install-database-and-gc-roots "." database prefix))
+
(apply invoke "tar" "-cf" "layer.tar"
`(,@transformation-options
,@%tar-determinism-options
,@paths
+ ,@(if database '("var") '())
,@(map symlink-source symlinks)))
;; It is possible for "/" to show up in the archive, especially when
;; applying transformations. For example, the transformation
@@ -203,7 +213,11 @@ SRFI-19 time-utc object, as the creation time in metadata."
(system* "tar" "--delete" "/" "-f" "layer.tar")
(for-each delete-file-recursively
(map (compose topmost-component symlink-source)
- symlinks)))
+ symlinks))
+
+ ;; Delete /var/guix.
+ (when database
+ (delete-file-recursively "var")))
(with-output-to-file "config.json"
(lambda ()
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 89c84f7037..8f2c10258a 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -127,9 +127,9 @@ package definition."
(define %cran-url "http://cran.r-project.org/web/packages/")
(define %bioconductor-url "https://bioconductor.org/packages/")
-;; The latest Bioconductor release is 3.7. Bioconductor packages should be
+;; The latest Bioconductor release is 3.8. Bioconductor packages should be
;; updated together.
-(define %bioconductor-version "3.7")
+(define %bioconductor-version "3.8")
(define %bioconductor-packages-list-url
(string-append "https://bioconductor.org/packages/"
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 83bfa4ce00..a86b95dd38 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -52,6 +52,9 @@
#:export (compressor?
lookup-compressor
self-contained-tarball
+ docker-image
+ squashfs-image
+
guix-pack))
;; Type of a compression tool.
@@ -103,6 +106,47 @@ found."
(package-transitive-propagated-inputs package)))
(list guile-gcrypt guile-sqlite3)))
+(define (store-database items)
+ "Return a directory containing a store database where all of ITEMS and their
+dependencies are registered."
+ (define schema
+ (local-file (search-path %load-path
+ "guix/store/schema.sql")))
+
+
+ (define labels
+ (map (lambda (n)
+ (string-append "closure" (number->string n)))
+ (iota (length items))))
+
+ (define build
+ (with-extensions gcrypt-sqlite3&co
+ ;; XXX: Adding (gnu build install) just to work around
+ ;; <https://bugs.gnu.org/15602>: that way, (guix build store-copy) is
+ ;; copied last and the 'store-info-XXX' macros are correctly expanded.
+ (with-imported-modules (source-module-closure
+ '((guix build store-copy)
+ (guix store database)
+ (gnu build install)))
+ #~(begin
+ (use-modules (guix store database)
+ (guix build store-copy)
+ (srfi srfi-1))
+
+ (define (read-closure closure)
+ (call-with-input-file closure read-reference-graph))
+
+ (let ((items (append-map read-closure '#$labels)))
+ (register-items items
+ #:state-directory #$output
+ #:deduplicate? #f
+ #:reset-timestamps? #f
+ #:registration-time %epoch
+ #:schema #$schema))))))
+
+ (computed-file "store-database" build
+ #:options `(#:references-graphs ,(zip labels items))))
+
(define* (self-contained-tarball name profile
#:key target
deduplicate?
@@ -117,121 +161,116 @@ with a properly initialized store database.
SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
added to the pack."
- (define schema
+ (define database
(and localstatedir?
- (local-file (search-path %load-path
- "guix/store/schema.sql"))))
+ (file-append (store-database (list profile))
+ "/db/db.sqlite")))
(define build
- (with-imported-modules `(((guix config) => ,(make-config.scm))
- ,@(source-module-closure
- `((guix build utils)
- (guix build union)
- (guix build store-copy)
- (gnu build install))
- #:select? not-config?))
- (with-extensions gcrypt-sqlite3&co
- #~(begin
- (use-modules (guix build utils)
- ((guix build union) #:select (relative-file-name))
- (gnu build install)
- (srfi srfi-1)
- (srfi srfi-26)
- (ice-9 match))
-
- (define %root "root")
-
- (define symlink->directives
- ;; Return "populate directives" to make the given symlink and its
- ;; parent directories.
- (match-lambda
- ((source '-> target)
- (let ((target (string-append #$profile "/" target))
- (parent (dirname source)))
- ;; Never add a 'directory' directive for "/" so as to
- ;; preserve its ownnership when extracting the archive (see
- ;; below), and also because this would lead to adding the
- ;; same entries twice in the tarball.
- `(,@(if (string=? parent "/")
- '()
- `((directory ,parent)))
- (,source
- -> ,(relative-file-name parent target)))))))
-
- (define directives
- ;; Fully-qualified symlinks.
- (append-map symlink->directives '#$symlinks))
-
- ;; The --sort option was added to GNU tar in version 1.28, released
- ;; 2014-07-28. For testing, we use the bootstrap tar, which is
- ;; older and doesn't support it.
- (define tar-supports-sort?
- (zero? (system* (string-append #+archiver "/bin/tar")
- "cf" "/dev/null" "--files-from=/dev/null"
- "--sort=name")))
-
- ;; Add 'tar' to the search path.
- (setenv "PATH" #+(file-append archiver "/bin"))
-
- ;; Note: there is not much to gain here with deduplication and there
- ;; is the overhead of the '.links' directory, so turn it off.
- ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs
- ;; with hard links:
- ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>.
- (populate-single-profile-directory %root
- #:profile #$profile
- #:closure "profile"
- #:deduplicate? #f
- #:register? #$localstatedir?
- #:schema #$schema)
-
- ;; Create SYMLINKS.
- (for-each (cut evaluate-populate-directive <> %root)
- directives)
-
- ;; Create the tarball. Use GNU format so there's no file name
- ;; length limitation.
- (with-directory-excursion %root
- (exit
- (zero? (apply system* "tar"
- #+@(if (compressor-command compressor)
- #~("-I"
- (string-join
- '#+(compressor-command compressor)))
- #~())
- "--format=gnu"
-
- ;; Avoid non-determinism in the archive. Use
- ;; mtime = 1, not zero, because that is what the
- ;; daemon does for files in the store (see the
- ;; 'mtimeStore' constant in local-store.cc.)
- (if tar-supports-sort? "--sort=name" "--mtime=@1")
- "--mtime=@1" ;for files in /var/guix
- "--owner=root:0"
- "--group=root:0"
-
- "--check-links"
- "-cvf" #$output
- ;; Avoid adding / and /var to the tarball, so
- ;; that the ownership and permissions of those
- ;; directories will not be overwritten when
- ;; extracting the archive. Do not include /root
- ;; because the root account might have a
- ;; different home directory.
- #$@(if localstatedir?
- '("./var/guix")
- '())
-
- (string-append "." (%store-directory))
-
- (delete-duplicates
- (filter-map (match-lambda
- (('directory directory)
- (string-append "." directory))
- ((source '-> _)
- (string-append "." source))
- (_ #f))
- directives))))))))))
+ (with-imported-modules (source-module-closure
+ `((guix build utils)
+ (guix build union)
+ (gnu build install))
+ #:select? not-config?)
+ #~(begin
+ (use-modules (guix build utils)
+ ((guix build union) #:select (relative-file-name))
+ (gnu build install)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ (ice-9 match))
+
+ (define %root "root")
+
+ (define symlink->directives
+ ;; Return "populate directives" to make the given symlink and its
+ ;; parent directories.
+ (match-lambda
+ ((source '-> target)
+ (let ((target (string-append #$profile "/" target))
+ (parent (dirname source)))
+ ;; Never add a 'directory' directive for "/" so as to
+ ;; preserve its ownnership when extracting the archive (see
+ ;; below), and also because this would lead to adding the
+ ;; same entries twice in the tarball.
+ `(,@(if (string=? parent "/")
+ '()
+ `((directory ,parent)))
+ (,source
+ -> ,(relative-file-name parent target)))))))
+
+ (define directives
+ ;; Fully-qualified symlinks.
+ (append-map symlink->directives '#$symlinks))
+
+ ;; The --sort option was added to GNU tar in version 1.28, released
+ ;; 2014-07-28. For testing, we use the bootstrap tar, which is
+ ;; older and doesn't support it.
+ (define tar-supports-sort?
+ (zero? (system* (string-append #+archiver "/bin/tar")
+ "cf" "/dev/null" "--files-from=/dev/null"
+ "--sort=name")))
+
+ ;; Add 'tar' to the search path.
+ (setenv "PATH" #+(file-append archiver "/bin"))
+
+ ;; Note: there is not much to gain here with deduplication and there
+ ;; is the overhead of the '.links' directory, so turn it off.
+ ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs
+ ;; with hard links:
+ ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>.
+ (populate-single-profile-directory %root
+ #:profile #$profile
+ #:closure "profile"
+ #:database #+database)
+
+ ;; Create SYMLINKS.
+ (for-each (cut evaluate-populate-directive <> %root)
+ directives)
+
+ ;; Create the tarball. Use GNU format so there's no file name
+ ;; length limitation.
+ (with-directory-excursion %root
+ (exit
+ (zero? (apply system* "tar"
+ #+@(if (compressor-command compressor)
+ #~("-I"
+ (string-join
+ '#+(compressor-command compressor)))
+ #~())
+ "--format=gnu"
+
+ ;; Avoid non-determinism in the archive. Use
+ ;; mtime = 1, not zero, because that is what the
+ ;; daemon does for files in the store (see the
+ ;; 'mtimeStore' constant in local-store.cc.)
+ (if tar-supports-sort? "--sort=name" "--mtime=@1")
+ "--mtime=@1" ;for files in /var/guix
+ "--owner=root:0"
+ "--group=root:0"
+
+ "--check-links"
+ "-cvf" #$output
+ ;; Avoid adding / and /var to the tarball, so
+ ;; that the ownership and permissions of those
+ ;; directories will not be overwritten when
+ ;; extracting the archive. Do not include /root
+ ;; because the root account might have a
+ ;; different home directory.
+ #$@(if localstatedir?
+ '("./var/guix")
+ '())
+
+ (string-append "." (%store-directory))
+
+ (delete-duplicates
+ (filter-map (match-lambda
+ (('directory directory)
+ (string-append "." directory))
+ ((source '-> _)
+ (string-append "." source))
+ (_ #f))
+ directives)))))))))
(gexp->derivation (string-append name ".tar"
(compressor-extension compressor))
@@ -240,7 +279,6 @@ added to the pack."
(define* (squashfs-image name profile
#:key target
- deduplicate?
(compressor (first %compressors))
localstatedir?
(symlinks '())
@@ -251,75 +289,85 @@ points for virtual file systems (like procfs), and optional symlinks.
SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
added to the pack."
- (define build
- (with-imported-modules `(((guix config) => ,(make-config.scm))
- ,@(source-module-closure
- '((guix build utils)
- (guix build store-copy)
- (gnu build install))
- #:select? not-config?))
- (with-extensions gcrypt-sqlite3&co
- #~(begin
- (use-modules (guix build utils)
- (gnu build install)
- (guix build store-copy)
- (srfi srfi-1)
- (srfi srfi-26)
- (ice-9 match))
+ (define database
+ (and localstatedir?
+ (file-append (store-database (list profile))
+ "/db/db.sqlite")))
- (setenv "PATH" (string-append #$archiver "/bin"))
+ (define build
+ (with-imported-modules (source-module-closure
+ '((guix build utils)
+ (guix build store-copy)
+ (gnu build install))
+ #:select? not-config?)
+ #~(begin
+ (use-modules (guix build utils)
+ (guix build store-copy)
+ (gnu build install)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ (ice-9 match))
- ;; We need an empty file in order to have a valid file argument when
- ;; we reparent the root file system. Read on for why that's
- ;; necessary.
- (with-output-to-file ".empty" (lambda () (display "")))
-
- ;; Create the squashfs image in several steps.
- ;; Add all store items. Unfortunately mksquashfs throws away all
- ;; ancestor directories and only keeps the basename. We fix this
- ;; in the following invocations of mksquashfs.
- (apply invoke "mksquashfs"
- `(,@(map store-info-item
- (call-with-input-file "profile"
- read-reference-graph))
- ,#$output
-
- ;; Do not perform duplicate checking because we
- ;; don't have any dupes.
- "-no-duplicates"
- "-comp"
- ,#+(compressor-name compressor)))
-
- ;; Here we reparent the store items. For each sub-directory of
- ;; the store prefix we need one invocation of "mksquashfs".
- (for-each (lambda (dir)
- (apply invoke "mksquashfs"
- `(".empty"
- ,#$output
- "-root-becomes" ,dir)))
- (reverse (string-tokenize (%store-directory)
- (char-set-complement (char-set #\/)))))
-
- ;; Add symlinks and mount points.
- (apply invoke "mksquashfs"
- `(".empty"
- ,#$output
- ;; Create SYMLINKS via pseudo file definitions.
- ,@(append-map
- (match-lambda
- ((source '-> target)
- (list "-p"
- (string-join
- ;; name s mode uid gid symlink
- (list source
- "s" "777" "0" "0"
- (string-append #$profile "/" target))))))
- '#$symlinks)
-
- ;; Create empty mount points.
- "-p" "/proc d 555 0 0"
- "-p" "/sys d 555 0 0"
- "-p" "/dev d 555 0 0"))))))
+ (define database #+database)
+
+ (setenv "PATH" (string-append #$archiver "/bin"))
+
+ ;; We need an empty file in order to have a valid file argument when
+ ;; we reparent the root file system. Read on for why that's
+ ;; necessary.
+ (with-output-to-file ".empty" (lambda () (display "")))
+
+ ;; Create the squashfs image in several steps.
+ ;; Add all store items. Unfortunately mksquashfs throws away all
+ ;; ancestor directories and only keeps the basename. We fix this
+ ;; in the following invocations of mksquashfs.
+ (apply invoke "mksquashfs"
+ `(,@(map store-info-item
+ (call-with-input-file "profile"
+ read-reference-graph))
+ ,#$output
+
+ ;; Do not perform duplicate checking because we
+ ;; don't have any dupes.
+ "-no-duplicates"
+ "-comp"
+ ,#+(compressor-name compressor)))
+
+ ;; Here we reparent the store items. For each sub-directory of
+ ;; the store prefix we need one invocation of "mksquashfs".
+ (for-each (lambda (dir)
+ (apply invoke "mksquashfs"
+ `(".empty"
+ ,#$output
+ "-root-becomes" ,dir)))
+ (reverse (string-tokenize (%store-directory)
+ (char-set-complement (char-set #\/)))))
+
+ ;; Add symlinks and mount points.
+ (apply invoke "mksquashfs"
+ `(".empty"
+ ,#$output
+ ;; Create SYMLINKS via pseudo file definitions.
+ ,@(append-map
+ (match-lambda
+ ((source '-> target)
+ (list "-p"
+ (string-join
+ ;; name s mode uid gid symlink
+ (list source
+ "s" "777" "0" "0"
+ (string-append #$profile "/" target))))))
+ '#$symlinks)
+
+ ;; Create empty mount points.
+ "-p" "/proc d 555 0 0"
+ "-p" "/sys d 555 0 0"
+ "-p" "/dev d 555 0 0"))
+
+ (when database
+ ;; Initialize /var/guix.
+ (install-database-and-gc-roots "var-etc" database #$profile)
+ (invoke "mksquashfs" "var-etc" #$output)))))
(gexp->derivation (string-append name
(compressor-extension compressor)
@@ -329,7 +377,6 @@ added to the pack."
(define* (docker-image name profile
#:key target
- deduplicate?
(compressor (first %compressors))
localstatedir?
(symlinks '())
@@ -339,6 +386,11 @@ image is a tarball conforming to the Docker Image Specification, compressed
with COMPRESSOR. It can be passed to 'docker load'. If TARGET is true, it
must a be a GNU triplet and it is used to derive the architecture metadata in
the image."
+ (define database
+ (and localstatedir?
+ (file-append (store-database (list profile))
+ "/db/db.sqlite")))
+
(define defmod 'define-module) ;trick Geiser
(define build
@@ -357,6 +409,7 @@ the image."
(call-with-input-file "profile"
read-reference-graph))
#$profile
+ #:database #+database
#:system (or #$target (utsname:machine (uname)))
#:symlinks '#$symlinks
#:compressor '#$(compressor-command compressor)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 188237aa90..aff4f378be 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -87,6 +87,8 @@ Download and deploy the latest version of Guix.\n"))
(display (G_ "
-p, --profile=PROFILE use PROFILE instead of ~/.config/guix/current"))
(display (G_ "
+ -n, --dry-run show what would be pulled and built"))
+ (display (G_ "
--bootstrap use the bootstrap Guile to build the new Guix"))
(newline)
(show-build-options-help)
@@ -164,15 +166,18 @@ Download and deploy the latest version of Guix.\n"))
(_ #t)))
(define* (build-and-install instances profile
- #:key verbose?)
- "Build the tool from SOURCE, and install it in PROFILE."
+ #:key verbose? dry-run?)
+ "Build the tool from SOURCE, and install it in PROFILE. When DRY-RUN? is
+true, display what would be built without actually building it."
(define update-profile
(store-lift build-and-use-profile))
(mlet %store-monad ((manifest (channel-instances->manifest instances)))
(mbegin %store-monad
- (update-profile profile manifest)
- (return (display-profile-news profile)))))
+ (update-profile profile manifest
+ #:dry-run? dry-run?)
+ (munless dry-run?
+ (display-profile-news profile)))))
(define (honor-lets-encrypt-certificates! store)
"Tell Guile-Git to use the Let's Encrypt certificates."
@@ -497,8 +502,6 @@ Use '~/.config/guix/channels.scm' instead."))
(ensure-default-profile)
(cond ((assoc-ref opts 'query)
(process-query opts profile))
- ((assoc-ref opts 'dry-run?)
- #t) ;XXX: not very useful
(else
(with-store store
(with-status-report print-build-event
@@ -531,6 +534,8 @@ Use '~/.config/guix/channels.scm' instead."))
(canonical-package guile-2.2)))))
(run-with-store store
(build-and-install instances profile
+ #:dry-run?
+ (assoc-ref opts 'dry-run?)
#:verbose?
(assoc-ref opts 'verbose?))))))))))))))
diff --git a/guix/self.scm b/guix/self.scm
index 3e29c9a42a..ddbe0b3669 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -206,21 +206,22 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'."
(local-file file #:recursive? #t)))
(find-files (string-append directory "/" sub-directory) pred)))
-(define* (sub-directory item sub-directory)
- "Return SUB-DIRECTORY within ITEM, which may be a file name or a file-like
-object."
+(define* (file-append* item file #:key (recursive? #t))
+ "Return FILE within ITEM, which may be a file name or a file-like object.
+When ITEM is a plain file name (a string), simply return a 'local-file'
+record with the new file name."
(match item
((? string?)
;; This is the optimal case: we return a new "source". Thus, a
;; derivation that depends on this sub-directory does not depend on ITEM
;; itself.
- (local-file (string-append item "/" sub-directory)
- #:recursive? #t))
+ (local-file (string-append item "/" file)
+ #:recursive? recursive?))
;; TODO: Add 'local-file?' case.
(_
;; In this case, anything that refers to the result also depends on ITEM,
;; which isn't great.
- (file-append item "/" sub-directory))))
+ (file-append item "/" file))))
(define* (locale-data source domain
#:optional (directory domain))
@@ -238,7 +239,7 @@ DOMAIN, a gettext domain."
(ice-9 match) (ice-9 ftw))
(define po-directory
- #+(sub-directory source (string-append "po/" directory)))
+ #+(file-append* source (string-append "po/" directory)))
(define (compile language)
(let ((gmo (string-append #$output "/" language "/LC_MESSAGES/"
@@ -273,10 +274,10 @@ DOMAIN, a gettext domain."
'graphviz))
(define documentation
- (sub-directory source "doc"))
+ (file-append* source "doc"))
(define examples
- (sub-directory source "gnu/system/examples"))
+ (file-append* source "gnu/system/examples"))
(define build
(with-imported-modules '((guix build utils))
@@ -290,7 +291,7 @@ DOMAIN, a gettext domain."
;; doesn't change at each commit?
(call-with-output-file "version.texi"
(lambda (port)
- (let ((version "0.0-git)"))
+ (let ((version "0.0-git"))
(format port "
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@@ -404,11 +405,29 @@ load path."
(apply guix-main (command-line))))
#:guile guile))
+(define (miscellaneous-files source)
+ "Return data files taken from SOURCE."
+ (file-mapping "guix-misc"
+ `(("etc/bash_completion.d/guix"
+ ,(file-append* source "/etc/completion/bash/guix"))
+ ("etc/bash_completion.d/guix-daemon"
+ ,(file-append* source "/etc/completion/bash/guix-daemon"))
+ ("share/zsh/site-functions/_guix"
+ ,(file-append* source "/etc/completion/zsh/_guix"))
+ ("share/fish/vendor_completions.d/guix.fish"
+ ,(file-append* source "/etc/completion/fish/guix.fish"))
+ ("share/guix/hydra.gnu.org.pub"
+ ,(file-append* source
+ "/etc/substitutes/hydra.gnu.org.pub"))
+ ("share/guix/berlin.guixsd.org.pub"
+ ,(file-append* source "/etc/substitutes/berlin.guixsd.org.pub")))))
+
(define* (whole-package name modules dependencies
#:key
(guile-version (effective-version))
compiled-modules
- info daemon guile
+ info daemon miscellany
+ guile
(command (guix-command modules
#:dependencies dependencies
#:guile guile
@@ -422,6 +441,7 @@ assumed to be part of MODULES."
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
+
(mkdir-p (string-append #$output "/bin"))
(symlink #$command
(string-append #$output "/bin/guix"))
@@ -441,6 +461,10 @@ assumed to be part of MODULES."
(string-append #$output
"/share/info"))))
+ (when #$miscellany
+ (copy-recursively #$miscellany #$output
+ #:log (%make-void-port "w")))
+
;; Object files.
(when #$compiled-modules
(let ((modules (string-append #$output "/lib/guile/"
@@ -666,6 +690,7 @@ assumed to be part of MODULES."
'guix-daemon)
#:info (info-manual source)
+ #:miscellany (miscellaneous-files source)
#:guile-version guile-version)))
((= 0 pull-version)
;; Legacy 'guix pull': return the .scm and .go files as one
diff --git a/guix/ssh.scm b/guix/ssh.scm
index da20d4d8db..25ec8295e8 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -161,7 +161,7 @@ Throw an error on failure."
"/var/guix/daemon-socket/socket"))
"Connect to the remote build daemon listening on SOCKET-NAME over SESSION,
an SSH session. Return a <nix-server> object."
- (open-connection #:port (remote-daemon-channel session)))
+ (open-connection #:port (remote-daemon-channel session socket-name)))
(define (store-import-channel session)