2017-03-12 11:48:40 -04:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2020-01-06 09:14:09 -05:00
|
|
|
|
;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
2018-05-25 10:24:49 -04:00
|
|
|
|
;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
|
2018-02-09 14:33:12 -05:00
|
|
|
|
;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
|
2018-03-10 19:13:01 -05:00
|
|
|
|
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
2018-11-06 04:50:48 -05:00
|
|
|
|
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
2020-06-10 16:03:27 -04:00
|
|
|
|
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
|
2017-03-12 11:48:40 -04:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (guix scripts pack)
|
|
|
|
|
#:use-module (guix scripts)
|
|
|
|
|
#:use-module (guix ui)
|
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
|
#:use-module (guix utils)
|
|
|
|
|
#:use-module (guix store)
|
2019-02-11 17:05:36 -05:00
|
|
|
|
#:use-module ((guix status) #:select (with-status-verbosity))
|
2019-07-02 03:19:48 -04:00
|
|
|
|
#:use-module ((guix self) #:select (make-config.scm))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (guix grafts)
|
2020-01-06 09:14:09 -05:00
|
|
|
|
#:autoload (guix inferior) (inferior-package?
|
|
|
|
|
inferior-package-name
|
|
|
|
|
inferior-package-version)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (guix monads)
|
2017-03-16 13:02:59 -04:00
|
|
|
|
#:use-module (guix modules)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix profiles)
|
2019-03-06 17:53:08 -05:00
|
|
|
|
#:use-module (guix describe)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (guix derivations)
|
2018-05-02 11:08:37 -04:00
|
|
|
|
#:use-module (guix search-paths)
|
|
|
|
|
#:use-module (guix build-system gnu)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (guix scripts build)
|
2018-06-06 17:58:18 -04:00
|
|
|
|
#:use-module ((guix self) #:select (make-config.scm))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (gnu packages)
|
2018-03-10 19:13:01 -05:00
|
|
|
|
#:use-module (gnu packages bootstrap)
|
2018-10-27 06:52:47 -04:00
|
|
|
|
#:use-module ((gnu packages compression) #:hide (zip))
|
2018-03-10 19:13:01 -05:00
|
|
|
|
#:use-module (gnu packages guile)
|
2018-05-07 04:36:13 -04:00
|
|
|
|
#:use-module (gnu packages base)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:autoload (gnu packages package-management) (guix)
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
#:autoload (gnu packages gnupg) (guile-gcrypt)
|
2017-05-20 08:28:24 -04:00
|
|
|
|
#:autoload (gnu packages guile) (guile2.0-json guile-json)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
|
#:use-module (srfi srfi-9)
|
2018-05-07 04:44:18 -04:00
|
|
|
|
#:use-module (srfi srfi-26)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:use-module (srfi srfi-37)
|
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:export (compressor?
|
|
|
|
|
lookup-compressor
|
|
|
|
|
self-contained-tarball
|
2018-11-03 16:53:07 -04:00
|
|
|
|
docker-image
|
2018-11-04 11:16:22 -05:00
|
|
|
|
squashfs-image
|
2018-11-03 16:53:07 -04:00
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
guix-pack))
|
|
|
|
|
|
|
|
|
|
;; Type of a compression tool.
|
|
|
|
|
(define-record-type <compressor>
|
2017-03-17 12:37:00 -04:00
|
|
|
|
(compressor name extension command)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
compressor?
|
2017-03-17 12:37:00 -04:00
|
|
|
|
(name compressor-name) ;string (e.g., "gzip")
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(extension compressor-extension) ;string (e.g., ".lz")
|
2017-03-17 12:37:00 -04:00
|
|
|
|
(command compressor-command)) ;gexp (e.g., #~("/gnu/store/…/gzip" "-9n"))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
|
|
|
|
(define %compressors
|
|
|
|
|
;; Available compression tools.
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(list (compressor "gzip" ".gz"
|
2017-03-17 12:37:00 -04:00
|
|
|
|
#~(#+(file-append gzip "/bin/gzip") "-9n"))
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(compressor "lzip" ".lz"
|
2017-03-17 12:37:00 -04:00
|
|
|
|
#~(#+(file-append lzip "/bin/lzip") "-9"))
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(compressor "xz" ".xz"
|
2018-07-22 12:01:35 -04:00
|
|
|
|
#~(#+(file-append xz "/bin/xz") "-e"))
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(compressor "bzip2" ".bz2"
|
|
|
|
|
#~(#+(file-append bzip2 "/bin/bzip2") "-9"))
|
2020-06-10 16:03:27 -04:00
|
|
|
|
(compressor "zstd" ".zst"
|
|
|
|
|
;; The default level 3 compresses better than gzip in a
|
|
|
|
|
;; fraction of the time, while the highest level 19
|
|
|
|
|
;; (de)compresses more slowly and worse than xz.
|
|
|
|
|
#~(#+(file-append zstd "/bin/zstd") "-3"))
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(compressor "none" "" #f)))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
2018-03-10 19:13:01 -05:00
|
|
|
|
;; This one is only for use in this module, so don't put it in %compressors.
|
|
|
|
|
(define bootstrap-xz
|
|
|
|
|
(compressor "bootstrap-xz" ".xz"
|
2018-07-22 12:01:35 -04:00
|
|
|
|
#~(#+(file-append %bootstrap-coreutils&co "/bin/xz") "-e")))
|
2018-03-10 19:13:01 -05:00
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(define (lookup-compressor name)
|
|
|
|
|
"Return the compressor object called NAME. Error out if it could not be
|
|
|
|
|
found."
|
|
|
|
|
(or (find (match-lambda
|
|
|
|
|
(($ <compressor> name*)
|
|
|
|
|
(string=? name* name)))
|
|
|
|
|
%compressors)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(leave (G_ "~a: compressor not found~%") name)))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
2018-06-25 15:49:12 -04:00
|
|
|
|
(define not-config?
|
|
|
|
|
;; Select (guix …) and (gnu …) modules, except (guix config).
|
|
|
|
|
(match-lambda
|
|
|
|
|
(('guix 'config) #f)
|
|
|
|
|
(('guix _ ...) #t)
|
|
|
|
|
(('gnu _ ...) #t)
|
|
|
|
|
(_ #f)))
|
|
|
|
|
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
(define gcrypt-sqlite3&co
|
|
|
|
|
;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
|
|
|
|
|
(append-map (lambda (package)
|
|
|
|
|
(cons package
|
2019-02-11 16:52:28 -05:00
|
|
|
|
(match (package-transitive-propagated-inputs package)
|
|
|
|
|
(((labels packages) ...)
|
|
|
|
|
packages))))
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
(list guile-gcrypt guile-sqlite3)))
|
2018-06-25 15:49:12 -04:00
|
|
|
|
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(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
|
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build store-copy)
|
2019-04-04 11:28:00 -04:00
|
|
|
|
(guix store database)))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
#~(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))
|
|
|
|
|
|
2020-06-18 05:51:44 -04:00
|
|
|
|
(define db-file
|
|
|
|
|
(store-database-file #:state-directory #$output))
|
|
|
|
|
|
|
|
|
|
(sql-schema #$schema)
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(let ((items (append-map read-closure '#$labels)))
|
2020-06-18 05:51:44 -04:00
|
|
|
|
(with-database db-file db
|
|
|
|
|
(register-items db items
|
|
|
|
|
#:deduplicate? #f
|
|
|
|
|
#:reset-timestamps? #f
|
|
|
|
|
#:registration-time %epoch)))))))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
|
|
|
|
|
(computed-file "store-database" build
|
|
|
|
|
#:options `(#:references-graphs ,(zip labels items))))
|
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(define* (self-contained-tarball name profile
|
2017-03-17 17:45:32 -04:00
|
|
|
|
#:key target
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(profile-name "guix-profile")
|
2017-03-17 17:45:32 -04:00
|
|
|
|
deduplicate?
|
2019-06-04 12:43:23 -04:00
|
|
|
|
entry-point
|
2017-03-14 10:11:03 -04:00
|
|
|
|
(compressor (first %compressors))
|
2017-03-14 11:37:17 -04:00
|
|
|
|
localstatedir?
|
2017-03-14 17:43:10 -04:00
|
|
|
|
(symlinks '())
|
2018-05-25 10:22:30 -04:00
|
|
|
|
(archiver tar))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
"Return a self-contained tarball containing a store initialized with the
|
2017-03-14 10:11:03 -04:00
|
|
|
|
closure of PROFILE, a derivation. The tarball contains /gnu/store; if
|
|
|
|
|
LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db
|
2017-03-14 11:37:17 -04:00
|
|
|
|
with a properly initialized store database.
|
|
|
|
|
|
|
|
|
|
SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
|
|
|
|
|
added to the pack."
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(define database
|
2018-06-06 17:58:18 -04:00
|
|
|
|
(and localstatedir?
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2020-07-20 10:11:24 -04:00
|
|
|
|
(define set-utf8-locale
|
|
|
|
|
;; Arrange to not depend on 'glibc-utf8-locales' when using '--bootstrap'.
|
|
|
|
|
(and (or (not (profile? profile))
|
|
|
|
|
(profile-locales? profile))
|
|
|
|
|
#~(begin
|
|
|
|
|
(setenv "GUIX_LOCPATH"
|
|
|
|
|
#+(file-append glibc-utf8-locales "/lib/locale"))
|
|
|
|
|
(setlocale LC_ALL "en_US.utf8"))))
|
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(define build
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(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))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(define %root "root")
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(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)))))))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(define directives
|
|
|
|
|
;; Fully-qualified symlinks.
|
|
|
|
|
(append-map symlink->directives '#$symlinks))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; 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")))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2020-07-20 10:11:24 -04:00
|
|
|
|
;; Make sure non-ASCII file names are properly handled.
|
|
|
|
|
#+set-utf8-locale
|
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; Add 'tar' to the search path.
|
|
|
|
|
(setenv "PATH" #+(file-append archiver "/bin"))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; 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
|
2018-10-20 13:28:05 -04:00
|
|
|
|
#:profile-name #$profile-name
|
2018-10-27 18:17:08 -04:00
|
|
|
|
#:closure "profile"
|
|
|
|
|
#:database #+database)
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; Create SYMLINKS.
|
|
|
|
|
(for-each (cut evaluate-populate-directive <> %root)
|
|
|
|
|
directives)
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; 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"
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
;; 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"
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
"--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")
|
|
|
|
|
'())
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(string-append "." (%store-directory))
|
2018-06-06 17:58:18 -04:00
|
|
|
|
|
2018-10-27 18:17:08 -04:00
|
|
|
|
(delete-duplicates
|
|
|
|
|
(filter-map (match-lambda
|
|
|
|
|
(('directory directory)
|
|
|
|
|
(string-append "." directory))
|
|
|
|
|
((source '-> _)
|
|
|
|
|
(string-append "." source))
|
|
|
|
|
(_ #f))
|
|
|
|
|
directives)))))))))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
2019-06-04 12:43:23 -04:00
|
|
|
|
(when entry-point
|
|
|
|
|
(warning (G_ "entry point not supported in the '~a' format~%")
|
|
|
|
|
'tarball))
|
|
|
|
|
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(gexp->derivation (string-append name ".tar"
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(compressor-extension compressor))
|
|
|
|
|
build
|
2020-05-14 06:50:18 -04:00
|
|
|
|
#:target target
|
2017-03-12 11:48:40 -04:00
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
|
|
|
|
|
2019-07-02 04:30:23 -04:00
|
|
|
|
(define (singularity-environment-file profile)
|
|
|
|
|
"Return a shell script that defines the environment variables corresponding
|
|
|
|
|
to the search paths of PROFILE."
|
|
|
|
|
(define build
|
|
|
|
|
(with-extensions (list guile-gcrypt)
|
|
|
|
|
(with-imported-modules `(((guix config) => ,(make-config.scm))
|
|
|
|
|
,@(source-module-closure
|
|
|
|
|
`((guix profiles)
|
|
|
|
|
(guix search-paths))
|
|
|
|
|
#:select? not-config?))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix profiles) (guix search-paths)
|
|
|
|
|
(ice-9 match))
|
|
|
|
|
|
|
|
|
|
(call-with-output-file #$output
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(for-each (match-lambda
|
|
|
|
|
((spec . value)
|
|
|
|
|
(format port "~a=~a~%export ~a~%"
|
|
|
|
|
(search-path-specification-variable spec)
|
|
|
|
|
value
|
|
|
|
|
(search-path-specification-variable spec))))
|
|
|
|
|
(profile-search-paths #$profile))))))))
|
|
|
|
|
|
|
|
|
|
(computed-file "singularity-environment.sh" build))
|
|
|
|
|
|
2018-05-25 10:24:49 -04:00
|
|
|
|
(define* (squashfs-image name profile
|
|
|
|
|
#:key target
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(profile-name "guix-profile")
|
2018-05-25 10:24:49 -04:00
|
|
|
|
(compressor (first %compressors))
|
2019-06-04 12:43:23 -04:00
|
|
|
|
entry-point
|
2018-05-25 10:24:49 -04:00
|
|
|
|
localstatedir?
|
|
|
|
|
(symlinks '())
|
2019-12-26 06:29:44 -05:00
|
|
|
|
(archiver squashfs-tools))
|
2018-05-25 10:24:49 -04:00
|
|
|
|
"Return a squashfs image containing a store initialized with the closure of
|
|
|
|
|
PROFILE, a derivation. The image contains a subset of /gnu/store, empty mount
|
|
|
|
|
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."
|
2018-11-04 11:16:22 -05:00
|
|
|
|
(define database
|
|
|
|
|
(and localstatedir?
|
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
2018-06-25 15:49:12 -04:00
|
|
|
|
|
2019-07-02 04:30:23 -04:00
|
|
|
|
(define environment
|
|
|
|
|
(singularity-environment-file profile))
|
|
|
|
|
|
2019-12-10 09:54:37 -05:00
|
|
|
|
(define symlinks*
|
|
|
|
|
;; Singularity requires /bin (specifically /bin/sh), so ensure that
|
|
|
|
|
;; symlink is created.
|
|
|
|
|
(if (find (match-lambda
|
|
|
|
|
(("/bin" . _) #t)
|
|
|
|
|
(_ #f))
|
|
|
|
|
symlinks)
|
|
|
|
|
symlinks
|
|
|
|
|
`(("/bin" -> "bin") ,@symlinks)))
|
|
|
|
|
|
2018-05-25 10:24:49 -04:00
|
|
|
|
(define build
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
2018-11-04 11:16:22 -05:00
|
|
|
|
(guix build store-copy)
|
2019-03-19 06:03:35 -04:00
|
|
|
|
(guix build union)
|
2018-11-04 11:16:22 -05:00
|
|
|
|
(gnu build install))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
#:select? not-config?)
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(guix build store-copy)
|
2019-03-19 06:03:35 -04:00
|
|
|
|
((guix build union) #:select (relative-file-name))
|
2018-11-04 11:16:22 -05:00
|
|
|
|
(gnu build install)
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(ice-9 match))
|
2018-06-25 15:49:12 -04:00
|
|
|
|
|
2018-11-04 11:16:22 -05:00
|
|
|
|
(define database #+database)
|
2019-06-04 12:43:23 -04:00
|
|
|
|
(define entry-point #$entry-point)
|
2018-11-04 11:16:22 -05:00
|
|
|
|
|
2020-03-13 07:55:05 -04:00
|
|
|
|
(define (mksquashfs args)
|
2020-03-13 08:02:01 -04:00
|
|
|
|
(apply invoke "mksquashfs"
|
|
|
|
|
`(,@args
|
|
|
|
|
|
2020-03-13 08:06:59 -04:00
|
|
|
|
;; Do not create a "recovery file" when appending to the
|
|
|
|
|
;; file system since it's useless in this case.
|
|
|
|
|
"-no-recovery"
|
|
|
|
|
|
2020-03-24 11:56:19 -04:00
|
|
|
|
;; Do not attempt to store extended attributes.
|
|
|
|
|
;; See <https://bugs.gnu.org/40043>.
|
|
|
|
|
"-no-xattrs"
|
|
|
|
|
|
2020-03-13 08:02:01 -04:00
|
|
|
|
;; Set file times and the file system creation time to
|
|
|
|
|
;; one second after the Epoch.
|
|
|
|
|
"-all-time" "1" "-mkfs-time" "1"
|
|
|
|
|
|
|
|
|
|
;; Reset all UIDs and GIDs.
|
|
|
|
|
"-force-uid" "0" "-force-gid" "0")))
|
2020-03-13 07:55:05 -04:00
|
|
|
|
|
2020-05-14 06:50:18 -04:00
|
|
|
|
(setenv "PATH" #+(file-append archiver "/bin"))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
|
|
|
|
|
;; 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.
|
2020-03-13 07:55:05 -04:00
|
|
|
|
(mksquashfs `(,@(map store-info-item
|
|
|
|
|
(call-with-input-file "profile"
|
|
|
|
|
read-reference-graph))
|
|
|
|
|
#$environment
|
|
|
|
|
,#$output
|
|
|
|
|
|
|
|
|
|
;; Do not perform duplicate checking because we
|
|
|
|
|
;; don't have any dupes.
|
|
|
|
|
"-no-duplicates"
|
|
|
|
|
"-comp"
|
|
|
|
|
,#+(compressor-name compressor)))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
|
|
|
|
|
;; Here we reparent the store items. For each sub-directory of
|
|
|
|
|
;; the store prefix we need one invocation of "mksquashfs".
|
|
|
|
|
(for-each (lambda (dir)
|
2020-03-13 07:55:05 -04:00
|
|
|
|
(mksquashfs `(".empty"
|
|
|
|
|
,#$output
|
|
|
|
|
"-root-becomes" ,dir)))
|
2018-10-27 17:47:59 -04:00
|
|
|
|
(reverse (string-tokenize (%store-directory)
|
|
|
|
|
(char-set-complement (char-set #\/)))))
|
|
|
|
|
|
|
|
|
|
;; Add symlinks and mount points.
|
2020-03-13 07:55:05 -04:00
|
|
|
|
(mksquashfs
|
|
|
|
|
`(".empty"
|
|
|
|
|
,#$output
|
|
|
|
|
;; Create SYMLINKS via pseudo file definitions.
|
|
|
|
|
,@(append-map
|
|
|
|
|
(match-lambda
|
|
|
|
|
((source '-> target)
|
|
|
|
|
;; Create relative symlinks to work around a bug in
|
|
|
|
|
;; Singularity 2.x:
|
|
|
|
|
;; https://bugs.gnu.org/34913
|
|
|
|
|
;; https://github.com/sylabs/singularity/issues/1487
|
|
|
|
|
(let ((target (string-append #$profile "/" target)))
|
|
|
|
|
(list "-p"
|
|
|
|
|
(string-join
|
|
|
|
|
;; name s mode uid gid symlink
|
|
|
|
|
(list source
|
|
|
|
|
"s" "777" "0" "0"
|
|
|
|
|
(relative-file-name (dirname source)
|
|
|
|
|
target)))))))
|
|
|
|
|
'#$symlinks*)
|
|
|
|
|
|
|
|
|
|
"-p" "/.singularity.d d 555 0 0"
|
|
|
|
|
|
|
|
|
|
;; Create the environment file.
|
|
|
|
|
"-p" "/.singularity.d/env d 555 0 0"
|
|
|
|
|
"-p" ,(string-append
|
|
|
|
|
"/.singularity.d/env/90-environment.sh s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d/env"
|
|
|
|
|
#$environment))
|
|
|
|
|
|
|
|
|
|
;; Create /.singularity.d/actions, and optionally the 'run'
|
|
|
|
|
;; script, used by 'singularity run'.
|
|
|
|
|
"-p" "/.singularity.d/actions d 555 0 0"
|
|
|
|
|
|
|
|
|
|
,@(if entry-point
|
|
|
|
|
`(;; This one if for Singularity 2.x.
|
|
|
|
|
"-p"
|
|
|
|
|
,(string-append
|
|
|
|
|
"/.singularity.d/actions/run s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d/actions"
|
|
|
|
|
(string-append #$profile "/"
|
|
|
|
|
entry-point)))
|
|
|
|
|
|
|
|
|
|
;; This one is for Singularity 3.x.
|
|
|
|
|
"-p"
|
|
|
|
|
,(string-append
|
|
|
|
|
"/.singularity.d/runscript s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d"
|
|
|
|
|
(string-append #$profile "/"
|
|
|
|
|
entry-point))))
|
|
|
|
|
'())
|
|
|
|
|
|
|
|
|
|
;; Create empty mount points.
|
|
|
|
|
"-p" "/proc d 555 0 0"
|
|
|
|
|
"-p" "/sys d 555 0 0"
|
|
|
|
|
"-p" "/dev d 555 0 0"
|
|
|
|
|
"-p" "/home d 555 0 0"))
|
2018-11-04 11:16:22 -05:00
|
|
|
|
|
|
|
|
|
(when database
|
|
|
|
|
;; Initialize /var/guix.
|
|
|
|
|
(install-database-and-gc-roots "var-etc" database #$profile)
|
2020-03-13 07:55:05 -04:00
|
|
|
|
(mksquashfs `("var-etc" ,#$output))))))
|
2018-05-25 10:24:49 -04:00
|
|
|
|
|
|
|
|
|
(gexp->derivation (string-append name
|
|
|
|
|
(compressor-extension compressor)
|
|
|
|
|
".squashfs")
|
|
|
|
|
build
|
2020-05-14 06:50:18 -04:00
|
|
|
|
#:target target
|
2018-05-25 10:24:49 -04:00
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
|
|
|
|
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(define* (docker-image name profile
|
2017-03-17 17:45:32 -04:00
|
|
|
|
#:key target
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(profile-name "guix-profile")
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(compressor (first %compressors))
|
2019-06-04 12:43:23 -04:00
|
|
|
|
entry-point
|
2017-03-16 13:02:59 -04:00
|
|
|
|
localstatedir?
|
|
|
|
|
(symlinks '())
|
2018-05-25 10:22:30 -04:00
|
|
|
|
(archiver tar))
|
2017-03-16 13:02:59 -04:00
|
|
|
|
"Return a derivation to construct a Docker image of PROFILE. The
|
|
|
|
|
image is a tarball conforming to the Docker Image Specification, compressed
|
2017-03-17 17:45:32 -04:00
|
|
|
|
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."
|
2018-11-03 16:53:07 -04:00
|
|
|
|
(define database
|
|
|
|
|
(and localstatedir?
|
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(define defmod 'define-module) ;trick Geiser
|
|
|
|
|
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(define build
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
;; Guile-JSON and Guile-Gcrypt are required by (guix docker).
|
2019-07-21 17:05:54 -04:00
|
|
|
|
(with-extensions (list guile-json-3 guile-gcrypt)
|
2019-07-02 03:19:48 -04:00
|
|
|
|
(with-imported-modules `(((guix config) => ,(make-config.scm))
|
|
|
|
|
,@(source-module-closure
|
|
|
|
|
`((guix docker)
|
|
|
|
|
(guix build store-copy)
|
|
|
|
|
(guix profiles)
|
|
|
|
|
(guix search-paths))
|
|
|
|
|
#:select? not-config?))
|
2018-05-28 12:22:24 -04:00
|
|
|
|
#~(begin
|
2019-07-02 03:19:48 -04:00
|
|
|
|
(use-modules (guix docker) (guix build store-copy)
|
|
|
|
|
(guix profiles) (guix search-paths)
|
2019-08-27 05:02:14 -04:00
|
|
|
|
(srfi srfi-1) (srfi srfi-19)
|
|
|
|
|
(ice-9 match))
|
2019-07-02 03:19:48 -04:00
|
|
|
|
|
|
|
|
|
(define environment
|
|
|
|
|
(map (match-lambda
|
|
|
|
|
((spec . value)
|
|
|
|
|
(cons (search-path-specification-variable spec)
|
|
|
|
|
value)))
|
|
|
|
|
(profile-search-paths #$profile)))
|
2018-05-28 12:22:24 -04:00
|
|
|
|
|
2019-08-27 05:02:14 -04:00
|
|
|
|
(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)))
|
|
|
|
|
`((directory ,parent)
|
|
|
|
|
(,source -> ,target))))))
|
|
|
|
|
|
|
|
|
|
(define directives
|
2019-08-27 05:27:02 -04:00
|
|
|
|
;; Create a /tmp directory, as some programs expect it, and
|
|
|
|
|
;; create SYMLINKS.
|
|
|
|
|
`((directory "/tmp" ,(getuid) ,(getgid) #o1777)
|
|
|
|
|
,@(append-map symlink->directives '#$symlinks)))
|
2019-08-27 05:02:14 -04:00
|
|
|
|
|
2019-09-13 11:32:16 -04:00
|
|
|
|
(define tag
|
|
|
|
|
;; Compute a meaningful "repository" name, which will show up in
|
|
|
|
|
;; the output of "docker images".
|
|
|
|
|
(let ((manifest (profile-manifest #$profile)))
|
|
|
|
|
(let loop ((names (map manifest-entry-name
|
|
|
|
|
(manifest-entries manifest))))
|
|
|
|
|
(define str (string-join names "-"))
|
|
|
|
|
(if (< (string-length str) 40)
|
|
|
|
|
str
|
|
|
|
|
(match names
|
|
|
|
|
((_) str)
|
|
|
|
|
((names ... _) (loop names))))))) ;drop one entry
|
2019-08-27 05:02:14 -04:00
|
|
|
|
|
2020-05-14 06:50:18 -04:00
|
|
|
|
(setenv "PATH" #+(file-append archiver "/bin"))
|
2018-05-28 12:22:24 -04:00
|
|
|
|
|
|
|
|
|
(build-docker-image #$output
|
2018-06-04 16:06:34 -04:00
|
|
|
|
(map store-info-item
|
|
|
|
|
(call-with-input-file "profile"
|
|
|
|
|
read-reference-graph))
|
2018-05-28 12:22:24 -04:00
|
|
|
|
#$profile
|
2019-09-13 11:32:16 -04:00
|
|
|
|
#:repository tag
|
2018-11-03 16:53:07 -04:00
|
|
|
|
#:database #+database
|
2018-05-28 12:22:24 -04:00
|
|
|
|
#:system (or #$target (utsname:machine (uname)))
|
2019-07-02 03:19:48 -04:00
|
|
|
|
#:environment environment
|
2019-07-21 18:45:42 -04:00
|
|
|
|
#:entry-point
|
|
|
|
|
#$(and entry-point
|
|
|
|
|
#~(list (string-append #$profile "/"
|
|
|
|
|
#$entry-point)))
|
2019-08-27 05:02:14 -04:00
|
|
|
|
#:extra-files directives
|
2020-05-14 06:50:18 -04:00
|
|
|
|
#:compressor '#+(compressor-command compressor)
|
2018-05-28 12:22:24 -04:00
|
|
|
|
#:creation-time (make-time time-utc 0 1))))))
|
2017-03-16 13:02:59 -04:00
|
|
|
|
|
2017-08-19 11:56:28 -04:00
|
|
|
|
(gexp->derivation (string-append name ".tar"
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(compressor-extension compressor))
|
|
|
|
|
build
|
2020-05-14 06:50:18 -04:00
|
|
|
|
#:target target
|
2017-03-16 13:02:59 -04:00
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Compiling C programs.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
;; A C compiler. That lowers to a single program that can be passed typical C
|
|
|
|
|
;; compiler flags, and it makes sure the whole toolchain is available.
|
|
|
|
|
(define-record-type <c-compiler>
|
|
|
|
|
(%c-compiler toolchain guile)
|
|
|
|
|
c-compiler?
|
|
|
|
|
(toolchain c-compiler-toolchain)
|
|
|
|
|
(guile c-compiler-guile))
|
|
|
|
|
|
|
|
|
|
(define* (c-compiler #:optional inputs
|
|
|
|
|
#:key (guile (default-guile)))
|
|
|
|
|
(%c-compiler inputs guile))
|
|
|
|
|
|
|
|
|
|
(define (bootstrap-c-compiler)
|
|
|
|
|
"Return the C compiler that uses the bootstrap toolchain. This is used only
|
|
|
|
|
by '--bootstrap', for testing purposes."
|
|
|
|
|
(define bootstrap-toolchain
|
2018-09-09 05:54:27 -04:00
|
|
|
|
(list (first (assoc-ref (%bootstrap-inputs) "gcc"))
|
|
|
|
|
(first (assoc-ref (%bootstrap-inputs) "binutils"))
|
|
|
|
|
(first (assoc-ref (%bootstrap-inputs) "libc"))))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
|
|
|
|
|
(c-compiler bootstrap-toolchain
|
|
|
|
|
#:guile %bootstrap-guile))
|
|
|
|
|
|
|
|
|
|
(define-gexp-compiler (c-compiler-compiler (compiler <c-compiler>) system target)
|
|
|
|
|
"Lower COMPILER to a single script that does the right thing."
|
|
|
|
|
(define toolchain
|
|
|
|
|
(or (c-compiler-toolchain compiler)
|
|
|
|
|
(list (first (assoc-ref (standard-packages) "gcc"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "ld-wrapper"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "binutils"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "libc"))
|
|
|
|
|
(gexp-input (first (assoc-ref (standard-packages) "libc"))
|
|
|
|
|
"static"))))
|
|
|
|
|
|
|
|
|
|
(define inputs
|
|
|
|
|
(match (append-map package-propagated-inputs
|
|
|
|
|
(filter package? toolchain))
|
|
|
|
|
(((labels things . _) ...)
|
|
|
|
|
(append toolchain things))))
|
|
|
|
|
|
|
|
|
|
(define search-paths
|
|
|
|
|
(cons $PATH
|
|
|
|
|
(append-map package-native-search-paths
|
|
|
|
|
(filter package? inputs))))
|
|
|
|
|
|
|
|
|
|
(define run
|
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
|
|
|
|
(guix search-paths)))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils) (guix search-paths)
|
|
|
|
|
(ice-9 match))
|
|
|
|
|
|
|
|
|
|
(define (output-file args)
|
|
|
|
|
(let loop ((args args))
|
|
|
|
|
(match args
|
|
|
|
|
(() "a.out")
|
|
|
|
|
(("-o" file _ ...) file)
|
|
|
|
|
((head rest ...) (loop rest)))))
|
|
|
|
|
|
|
|
|
|
(set-search-paths (map sexp->search-path-specification
|
|
|
|
|
'#$(map search-path-specification->sexp
|
|
|
|
|
search-paths))
|
|
|
|
|
'#$inputs)
|
|
|
|
|
|
|
|
|
|
(let ((output (output-file (command-line))))
|
|
|
|
|
(apply invoke "gcc" (cdr (command-line)))
|
|
|
|
|
(invoke "strip" output)))))
|
|
|
|
|
|
|
|
|
|
(when target
|
|
|
|
|
;; TODO: Yep, we'll have to do it someday!
|
|
|
|
|
(leave (G_ "cross-compilation not implemented here;
|
|
|
|
|
please email '~a'~%")
|
|
|
|
|
(@ (guix config) %guix-bug-report-address)))
|
|
|
|
|
|
|
|
|
|
(gexp->script "c-compiler" run
|
|
|
|
|
#:guile (c-compiler-guile compiler)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Wrapped package.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define* (wrapped-package package
|
2019-08-23 11:45:17 -04:00
|
|
|
|
#:optional
|
|
|
|
|
(output* "out")
|
|
|
|
|
(compiler (c-compiler))
|
2019-03-14 12:02:53 -04:00
|
|
|
|
#:key proot?)
|
2019-08-23 11:45:17 -04:00
|
|
|
|
"Return the OUTPUT of PACKAGE with its binaries wrapped such that they are
|
|
|
|
|
relocatable. When PROOT? is true, include PRoot in the result and use it as a
|
|
|
|
|
last resort for relocation."
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(define runner
|
|
|
|
|
(local-file (search-auxiliary-file "run-in-namespace.c")))
|
|
|
|
|
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(define audit-source
|
|
|
|
|
(local-file (search-auxiliary-file "pack-audit.c")))
|
|
|
|
|
|
2019-03-14 12:02:53 -04:00
|
|
|
|
(define (proot)
|
|
|
|
|
(specification->package "proot-static"))
|
|
|
|
|
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(define (fakechroot-library)
|
|
|
|
|
(computed-file "libfakechroot.so"
|
|
|
|
|
#~(copy-file #$(file-append
|
|
|
|
|
(specification->package "fakechroot")
|
|
|
|
|
"/lib/fakechroot/libfakechroot.so")
|
|
|
|
|
#$output)))
|
|
|
|
|
|
|
|
|
|
(define (audit-module)
|
|
|
|
|
;; Return an ld.so audit module for use by the 'fakechroot' execution
|
|
|
|
|
;; engine that translates file names of all the files ld.so loads.
|
|
|
|
|
(computed-file "pack-audit.so"
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(copy-file #$audit-source "audit.c")
|
|
|
|
|
(substitute* "audit.c"
|
|
|
|
|
(("@STORE_DIRECTORY@")
|
|
|
|
|
(%store-directory)))
|
|
|
|
|
|
|
|
|
|
(invoke #$compiler "-std=gnu99"
|
|
|
|
|
"-shared" "-fPIC" "-Os" "-g0"
|
|
|
|
|
"-Wall" "audit.c" "-o" #$output)))))
|
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(define build
|
2018-05-14 16:59:14 -04:00
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(guix build union)
|
|
|
|
|
(guix elf)))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
2018-05-14 16:59:14 -04:00
|
|
|
|
((guix build union) #:select (relative-file-name))
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(guix elf)
|
|
|
|
|
(ice-9 binary-ports)
|
2018-05-14 16:59:14 -04:00
|
|
|
|
(ice-9 ftw)
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(ice-9 match)
|
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(rnrs bytevectors))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
|
2019-08-23 11:45:17 -04:00
|
|
|
|
(define input
|
|
|
|
|
;; The OUTPUT* output of PACKAGE.
|
|
|
|
|
(ungexp package output*))
|
|
|
|
|
|
|
|
|
|
(define target
|
|
|
|
|
;; The output we are producing.
|
|
|
|
|
(ungexp output output*))
|
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(define (strip-store-prefix file)
|
|
|
|
|
;; Given a file name like "/gnu/store/…-foo-1.2/bin/foo", return
|
|
|
|
|
;; "/bin/foo".
|
|
|
|
|
(let* ((len (string-length (%store-directory)))
|
|
|
|
|
(base (string-drop file (+ 1 len))))
|
|
|
|
|
(match (string-index base #\/)
|
|
|
|
|
(#f base)
|
|
|
|
|
(index (string-drop base index)))))
|
|
|
|
|
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(define (elf-interpreter elf)
|
|
|
|
|
;; Return the interpreter of ELF as a string, or #f if ELF has no
|
|
|
|
|
;; interpreter segment.
|
|
|
|
|
(match (find (lambda (segment)
|
|
|
|
|
(= (elf-segment-type segment) PT_INTERP))
|
|
|
|
|
(elf-segments elf))
|
|
|
|
|
(#f #f) ;maybe a .so
|
|
|
|
|
(segment
|
|
|
|
|
(let ((bv (make-bytevector (- (elf-segment-memsz segment) 1))))
|
|
|
|
|
(bytevector-copy! (elf-bytes elf)
|
|
|
|
|
(elf-segment-offset segment)
|
|
|
|
|
bv 0 (bytevector-length bv))
|
|
|
|
|
(utf8->string bv)))))
|
|
|
|
|
|
|
|
|
|
(define (elf-loader-compile-flags program)
|
|
|
|
|
;; Return the cpp flags defining macros for the ld.so/fakechroot
|
|
|
|
|
;; wrapper of PROGRAM.
|
|
|
|
|
|
|
|
|
|
;; TODO: Handle scripts by wrapping their interpreter.
|
|
|
|
|
(if (elf-file? program)
|
|
|
|
|
(let* ((bv (call-with-input-file program
|
|
|
|
|
get-bytevector-all))
|
|
|
|
|
(elf (parse-elf bv))
|
|
|
|
|
(interp (elf-interpreter elf))
|
|
|
|
|
(gconv (and interp
|
|
|
|
|
(string-append (dirname interp)
|
|
|
|
|
"/gconv"))))
|
|
|
|
|
(if interp
|
|
|
|
|
(list (string-append "-DPROGRAM_INTERPRETER=\""
|
|
|
|
|
interp "\"")
|
|
|
|
|
(string-append "-DFAKECHROOT_LIBRARY=\""
|
|
|
|
|
#$(fakechroot-library) "\"")
|
|
|
|
|
|
|
|
|
|
(string-append "-DLOADER_AUDIT_MODULE=\""
|
|
|
|
|
#$(audit-module) "\"")
|
|
|
|
|
(if gconv
|
|
|
|
|
(string-append "-DGCONV_DIRECTORY=\""
|
|
|
|
|
gconv "\"")
|
|
|
|
|
"-UGCONV_DIRECTORY"))
|
|
|
|
|
'()))
|
|
|
|
|
'()))
|
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(define (build-wrapper program)
|
|
|
|
|
;; Build a user-namespace wrapper for PROGRAM.
|
|
|
|
|
(format #t "building wrapper for '~a'...~%" program)
|
|
|
|
|
(copy-file #$runner "run.c")
|
|
|
|
|
|
|
|
|
|
(substitute* "run.c"
|
|
|
|
|
(("@WRAPPED_PROGRAM@") program)
|
|
|
|
|
(("@STORE_DIRECTORY@") (%store-directory)))
|
|
|
|
|
|
|
|
|
|
(let* ((base (strip-store-prefix program))
|
2019-08-23 11:45:17 -04:00
|
|
|
|
(result (string-append target "/" base))
|
2019-03-14 12:02:53 -04:00
|
|
|
|
(proot #$(and proot?
|
|
|
|
|
#~(string-drop
|
|
|
|
|
#$(file-append (proot) "/bin/proot")
|
|
|
|
|
(+ (string-length (%store-directory))
|
|
|
|
|
1)))))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(mkdir-p (dirname result))
|
2019-03-14 12:02:53 -04:00
|
|
|
|
(apply invoke #$compiler "-std=gnu99" "-static" "-Os" "-g0" "-Wall"
|
|
|
|
|
"run.c" "-o" result
|
2020-05-07 16:49:20 -04:00
|
|
|
|
(append (if proot
|
|
|
|
|
(list (string-append "-DPROOT_PROGRAM=\""
|
|
|
|
|
proot "\""))
|
|
|
|
|
'())
|
|
|
|
|
(elf-loader-compile-flags program)))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(delete-file "run.c")))
|
|
|
|
|
|
2019-01-06 16:02:40 -05:00
|
|
|
|
(setvbuf (current-output-port) 'line)
|
2018-05-14 16:59:14 -04:00
|
|
|
|
|
|
|
|
|
;; Link the top-level files of PACKAGE so that search paths are
|
|
|
|
|
;; properly defined in PROFILE/etc/profile.
|
2019-08-23 11:45:17 -04:00
|
|
|
|
(mkdir target)
|
2018-05-14 16:59:14 -04:00
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(unless (member file '("." ".." "bin" "sbin" "libexec"))
|
2019-08-23 11:45:17 -04:00
|
|
|
|
(let ((file* (string-append input "/" file)))
|
|
|
|
|
(symlink (relative-file-name target file*)
|
|
|
|
|
(string-append target "/" file)))))
|
|
|
|
|
(scandir input))
|
2018-05-14 16:59:14 -04:00
|
|
|
|
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(for-each build-wrapper
|
2020-06-29 16:57:12 -04:00
|
|
|
|
;; Note: Trailing slash in case these are symlinks.
|
|
|
|
|
(append (find-files (string-append input "/bin/"))
|
|
|
|
|
(find-files (string-append input "/sbin/"))
|
|
|
|
|
(find-files (string-append input "/libexec/")))))))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
|
2019-02-22 22:38:47 -05:00
|
|
|
|
(computed-file (string-append
|
|
|
|
|
(cond ((package? package)
|
|
|
|
|
(package-full-name package "-"))
|
|
|
|
|
((inferior-package? package)
|
|
|
|
|
(string-append (inferior-package-name package)
|
|
|
|
|
"-"
|
|
|
|
|
(inferior-package-version package)))
|
|
|
|
|
(else "wrapper"))
|
|
|
|
|
"R")
|
2018-05-02 11:08:37 -04:00
|
|
|
|
build))
|
|
|
|
|
|
2019-08-23 11:45:17 -04:00
|
|
|
|
(define (wrapped-manifest-entry entry . args)
|
|
|
|
|
(manifest-entry
|
|
|
|
|
(inherit entry)
|
|
|
|
|
(item (apply wrapped-package
|
|
|
|
|
(manifest-entry-item entry)
|
|
|
|
|
(manifest-entry-output entry)
|
|
|
|
|
args))))
|
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Command-line options.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %default-options
|
|
|
|
|
;; Alist of default option values.
|
2017-03-16 13:02:59 -04:00
|
|
|
|
`((format . tarball)
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(profile-name . "guix-profile")
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(system . ,(%current-system))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(substitutes? . #t)
|
2019-11-21 09:28:13 -05:00
|
|
|
|
(offload? . #t)
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(graft? . #t)
|
2017-01-18 17:21:29 -05:00
|
|
|
|
(print-build-trace? . #t)
|
|
|
|
|
(print-extended-build-trace? . #t)
|
2018-10-15 17:06:55 -04:00
|
|
|
|
(multiplexed-build-output? . #t)
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(debug . 0)
|
2019-04-04 11:32:37 -04:00
|
|
|
|
(verbosity . 1)
|
2017-03-14 11:37:17 -04:00
|
|
|
|
(symlinks . ())
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(compressor . ,(first %compressors))))
|
|
|
|
|
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(define %formats
|
|
|
|
|
;; Supported pack formats.
|
|
|
|
|
`((tarball . ,self-contained-tarball)
|
2018-05-25 10:24:49 -04:00
|
|
|
|
(squashfs . ,squashfs-image)
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(docker . ,docker-image)))
|
|
|
|
|
|
2018-11-06 04:50:48 -05:00
|
|
|
|
(define (show-formats)
|
|
|
|
|
;; Print the supported pack formats.
|
|
|
|
|
(display (G_ "The supported formats for 'guix pack' are:"))
|
|
|
|
|
(newline)
|
|
|
|
|
(display (G_ "
|
|
|
|
|
tarball Self-contained tarball, ready to run on another machine"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
squashfs Squashfs image suitable for Singularity"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
docker Tarball ready for 'docker load'"))
|
|
|
|
|
(newline))
|
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(define %options
|
|
|
|
|
;; Specifications of the command-line options.
|
|
|
|
|
(cons* (option '(#\h "help") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-help)
|
|
|
|
|
(exit 0)))
|
|
|
|
|
(option '(#\V "version") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-version-and-exit "guix pack")))
|
|
|
|
|
|
|
|
|
|
(option '(#\n "dry-run") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
2020-03-25 10:05:15 -04:00
|
|
|
|
(alist-cons 'dry-run? #t result)))
|
2019-11-20 03:57:08 -05:00
|
|
|
|
(option '(#\d "derivation") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'derivation-only? #t result)))
|
|
|
|
|
|
2017-03-16 13:02:59 -04:00
|
|
|
|
(option '(#\f "format") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'format (string->symbol arg) result)))
|
2018-11-06 04:50:48 -05:00
|
|
|
|
(option '("list-formats") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-formats)
|
|
|
|
|
(exit 0)))
|
2018-05-02 11:08:37 -04:00
|
|
|
|
(option '(#\R "relocatable") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
2019-03-14 12:02:53 -04:00
|
|
|
|
(match (assq-ref result 'relocatable?)
|
|
|
|
|
(#f
|
|
|
|
|
(alist-cons 'relocatable? #t result))
|
|
|
|
|
(_
|
|
|
|
|
(alist-cons 'relocatable? 'proot
|
|
|
|
|
(alist-delete 'relocatable? result))))))
|
2017-04-07 16:20:28 -04:00
|
|
|
|
(option '(#\e "expression") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'expression arg result)))
|
2018-02-09 14:33:12 -05:00
|
|
|
|
(option '(#\m "manifest") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'manifest arg result)))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(option '(#\s "system") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'system arg
|
|
|
|
|
(alist-delete 'system result eq?))))
|
2019-06-04 12:43:23 -04:00
|
|
|
|
(option '("entry-point") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'entry-point arg result)))
|
2017-03-17 17:45:32 -04:00
|
|
|
|
(option '("target") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'target arg
|
|
|
|
|
(alist-delete 'target result eq?))))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(option '(#\C "compression") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'compressor (lookup-compressor arg)
|
|
|
|
|
result)))
|
2017-03-14 11:37:17 -04:00
|
|
|
|
(option '(#\S "symlink") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
2017-03-16 17:46:43 -04:00
|
|
|
|
;; Note: Using 'string-split' allows us to handle empty
|
|
|
|
|
;; TARGET (as in "/opt/guile=", meaning that /opt/guile is
|
|
|
|
|
;; a symlink to the profile) correctly.
|
|
|
|
|
(match (string-split arg (char-set #\=))
|
2017-03-14 11:37:17 -04:00
|
|
|
|
((source target)
|
|
|
|
|
(let ((symlinks (assoc-ref result 'symlinks)))
|
|
|
|
|
(alist-cons 'symlinks
|
|
|
|
|
`((,source -> ,target) ,@symlinks)
|
|
|
|
|
(alist-delete 'symlinks result eq?))))
|
|
|
|
|
(x
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(leave (G_ "~a: invalid symlink specification~%")
|
2017-03-14 11:37:17 -04:00
|
|
|
|
arg)))))
|
2019-03-06 17:53:08 -05:00
|
|
|
|
(option '("save-provenance") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'save-provenance? #t result)))
|
2017-03-14 10:11:03 -04:00
|
|
|
|
(option '("localstatedir") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'localstatedir? #t result)))
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(option '("profile-name") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(match arg
|
|
|
|
|
((or "guix-profile" "current-guix")
|
|
|
|
|
(alist-cons 'profile-name arg result))
|
|
|
|
|
(_
|
|
|
|
|
(leave (G_ "~a: unsupported profile name~%") arg)))))
|
2019-05-21 08:33:51 -04:00
|
|
|
|
(option '(#\r "root") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'gc-root arg result)))
|
|
|
|
|
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(option '(#\v "verbosity") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(let ((level (string->number* arg)))
|
|
|
|
|
(alist-cons 'verbosity level
|
|
|
|
|
(alist-delete 'verbosity result)))))
|
2018-03-10 19:13:01 -05:00
|
|
|
|
(option '("bootstrap") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'bootstrap? #t result)))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
|
|
|
|
|
(append %transformation-options
|
|
|
|
|
%standard-build-options)))
|
|
|
|
|
|
|
|
|
|
(define (show-help)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "Usage: guix pack [OPTION]... PACKAGE...
|
2017-03-12 11:48:40 -04:00
|
|
|
|
Create a bundle of PACKAGE.\n"))
|
|
|
|
|
(show-build-options-help)
|
|
|
|
|
(newline)
|
|
|
|
|
(show-transformation-options-help)
|
|
|
|
|
(newline)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-16 13:02:59 -04:00
|
|
|
|
-f, --format=FORMAT build a pack in the given FORMAT"))
|
2018-11-06 04:50:48 -05:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--list-formats list the formats available"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2018-05-02 11:08:37 -04:00
|
|
|
|
-R, --relocatable produce relocatable executables"))
|
|
|
|
|
(display (G_ "
|
2017-04-07 16:20:28 -04:00
|
|
|
|
-e, --expression=EXPR consider the package EXPR evaluates to"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-12 11:48:40 -04:00
|
|
|
|
-s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-17 17:45:32 -04:00
|
|
|
|
--target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-12 11:48:40 -04:00
|
|
|
|
-C, --compression=TOOL compress using TOOL--e.g., \"lzip\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-14 11:37:17 -04:00
|
|
|
|
-S, --symlink=SPEC create symlinks to the profile according to SPEC"))
|
2018-02-09 14:33:12 -05:00
|
|
|
|
(display (G_ "
|
2018-02-15 16:23:20 -05:00
|
|
|
|
-m, --manifest=FILE create a pack with the manifest from FILE"))
|
2019-06-04 12:43:23 -04:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--entry-point=PROGRAM
|
|
|
|
|
use PROGRAM as the entry point of the pack"))
|
2019-03-06 17:53:08 -05:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--save-provenance save provenance information"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-14 10:11:03 -04:00
|
|
|
|
--localstatedir include /var/guix in the resulting pack"))
|
2018-10-20 13:28:05 -04:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--profile-name=NAME
|
|
|
|
|
populate /var/guix/profiles/.../NAME"))
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(display (G_ "
|
2019-05-21 08:33:51 -04:00
|
|
|
|
-r, --root=FILE make FILE a symlink to the result, and register it
|
|
|
|
|
as a garbage collector root"))
|
|
|
|
|
(display (G_ "
|
2019-11-20 03:57:08 -05:00
|
|
|
|
-d, --derivation return the derivation of the pack"))
|
|
|
|
|
(display (G_ "
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
|
2018-03-10 19:13:01 -05:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--bootstrap use the bootstrap binaries to build the pack"))
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(newline)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-12 11:48:40 -04:00
|
|
|
|
-h, --help display this help and exit"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-03-12 11:48:40 -04:00
|
|
|
|
-V, --version display version information and exit"))
|
|
|
|
|
(newline)
|
|
|
|
|
(show-bug-report-information))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Entry point.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define (guix-pack . args)
|
|
|
|
|
(define opts
|
|
|
|
|
(parse-command-line args %options (list %default-options)))
|
|
|
|
|
|
2017-04-07 16:20:28 -04:00
|
|
|
|
(define maybe-package-argument
|
|
|
|
|
;; Given an option pair, return a package, a package/output tuple, or #f.
|
|
|
|
|
(match-lambda
|
|
|
|
|
(('argument . spec)
|
|
|
|
|
(call-with-values
|
|
|
|
|
(lambda ()
|
|
|
|
|
(specification->package+output spec))
|
|
|
|
|
list))
|
|
|
|
|
(('expression . exp)
|
|
|
|
|
(read/eval-package-expression exp))
|
|
|
|
|
(x #f)))
|
|
|
|
|
|
2018-05-07 04:44:18 -04:00
|
|
|
|
(define (manifest-from-args store opts)
|
|
|
|
|
(let* ((transform (options->transformation opts))
|
|
|
|
|
(packages (map (match-lambda
|
|
|
|
|
(((? package? package) output)
|
2018-05-07 08:04:19 -04:00
|
|
|
|
(list (transform store package) output))
|
|
|
|
|
((? package? package)
|
|
|
|
|
(list (transform store package) "out")))
|
2019-09-13 11:35:08 -04:00
|
|
|
|
(reverse
|
|
|
|
|
(filter-map maybe-package-argument opts))))
|
2019-11-20 06:13:32 -05:00
|
|
|
|
(manifests (filter-map (match-lambda
|
|
|
|
|
(('manifest . file) file)
|
|
|
|
|
(_ #f))
|
|
|
|
|
opts)))
|
2019-12-29 10:51:15 -05:00
|
|
|
|
(define with-provenance
|
2019-03-06 17:53:08 -05:00
|
|
|
|
(if (assoc-ref opts 'save-provenance?)
|
2019-12-29 10:51:15 -05:00
|
|
|
|
(lambda (manifest)
|
|
|
|
|
(map-manifest-entries
|
|
|
|
|
(lambda (entry)
|
|
|
|
|
(let ((entry (manifest-entry-with-provenance entry)))
|
|
|
|
|
(unless (assq 'provenance (manifest-entry-properties entry))
|
|
|
|
|
(warning (G_ "could not determine provenance of package ~a~%")
|
|
|
|
|
(manifest-entry-name entry)))
|
|
|
|
|
entry))
|
|
|
|
|
manifest))
|
|
|
|
|
identity))
|
|
|
|
|
|
|
|
|
|
(with-provenance
|
|
|
|
|
(cond
|
|
|
|
|
((and (not (null? manifests)) (not (null? packages)))
|
|
|
|
|
(leave (G_ "both a manifest and a package list were given~%")))
|
|
|
|
|
((not (null? manifests))
|
|
|
|
|
(concatenate-manifests
|
|
|
|
|
(map (lambda (file)
|
|
|
|
|
(let ((user-module (make-user-module
|
|
|
|
|
'((guix profiles) (gnu)))))
|
|
|
|
|
(load* file user-module)))
|
|
|
|
|
manifests)))
|
|
|
|
|
(else
|
|
|
|
|
(packages->manifest packages))))))
|
2018-02-09 14:33:12 -05:00
|
|
|
|
|
2017-03-12 11:48:40 -04:00
|
|
|
|
(with-error-handling
|
2018-05-07 04:44:18 -04:00
|
|
|
|
(with-store store
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(with-status-verbosity (assoc-ref opts 'verbosity)
|
2017-01-18 17:21:29 -05:00
|
|
|
|
;; Set the build options before we do anything else.
|
|
|
|
|
(set-build-options-from-command-line store opts)
|
|
|
|
|
|
2020-03-18 18:00:13 -04:00
|
|
|
|
(with-build-handler (build-notifier #:dry-run?
|
|
|
|
|
(assoc-ref opts 'dry-run?)
|
|
|
|
|
#:use-substitutes?
|
|
|
|
|
(assoc-ref opts 'substitutes?))
|
|
|
|
|
(parameterize ((%graft? (assoc-ref opts 'graft?))
|
|
|
|
|
(%guile-for-build (package-derivation
|
|
|
|
|
store
|
|
|
|
|
(if (assoc-ref opts 'bootstrap?)
|
|
|
|
|
%bootstrap-guile
|
2020-03-26 19:12:15 -04:00
|
|
|
|
(default-guile))
|
2020-03-18 18:00:13 -04:00
|
|
|
|
(assoc-ref opts 'system)
|
|
|
|
|
#:graft? (assoc-ref opts 'graft?))))
|
|
|
|
|
(let* ((derivation? (assoc-ref opts 'derivation-only?))
|
|
|
|
|
(relocatable? (assoc-ref opts 'relocatable?))
|
|
|
|
|
(proot? (eq? relocatable? 'proot))
|
|
|
|
|
(manifest (let ((manifest (manifest-from-args store opts)))
|
|
|
|
|
;; Note: We cannot honor '--bootstrap' here because
|
|
|
|
|
;; 'glibc-bootstrap' lacks 'libc.a'.
|
|
|
|
|
(if relocatable?
|
|
|
|
|
(map-manifest-entries
|
|
|
|
|
(cut wrapped-manifest-entry <> #:proot? proot?)
|
|
|
|
|
manifest)
|
|
|
|
|
manifest)))
|
|
|
|
|
(pack-format (assoc-ref opts 'format))
|
|
|
|
|
(name (string-append (symbol->string pack-format)
|
|
|
|
|
"-pack"))
|
|
|
|
|
(target (assoc-ref opts 'target))
|
|
|
|
|
(bootstrap? (assoc-ref opts 'bootstrap?))
|
|
|
|
|
(compressor (if bootstrap?
|
|
|
|
|
bootstrap-xz
|
|
|
|
|
(assoc-ref opts 'compressor)))
|
|
|
|
|
(archiver (if (equal? pack-format 'squashfs)
|
|
|
|
|
squashfs-tools
|
|
|
|
|
(if bootstrap?
|
|
|
|
|
%bootstrap-coreutils&co
|
|
|
|
|
tar)))
|
|
|
|
|
(symlinks (assoc-ref opts 'symlinks))
|
|
|
|
|
(build-image (match (assq-ref %formats pack-format)
|
|
|
|
|
((? procedure? proc) proc)
|
|
|
|
|
(#f
|
|
|
|
|
(leave (G_ "~a: unknown pack format~%")
|
|
|
|
|
pack-format))))
|
|
|
|
|
(localstatedir? (assoc-ref opts 'localstatedir?))
|
|
|
|
|
(entry-point (assoc-ref opts 'entry-point))
|
|
|
|
|
(profile-name (assoc-ref opts 'profile-name))
|
2020-04-22 10:11:25 -04:00
|
|
|
|
(gc-root (assoc-ref opts 'gc-root))
|
|
|
|
|
(profile (profile
|
|
|
|
|
(content manifest)
|
|
|
|
|
|
|
|
|
|
;; Always produce relative symlinks for
|
|
|
|
|
;; Singularity (see
|
|
|
|
|
;; <https://bugs.gnu.org/34913>).
|
|
|
|
|
(relative-symlinks?
|
|
|
|
|
(or relocatable?
|
|
|
|
|
(eq? 'squashfs pack-format)))
|
|
|
|
|
|
|
|
|
|
(hooks (if bootstrap?
|
|
|
|
|
'()
|
|
|
|
|
%default-profile-hooks))
|
|
|
|
|
(locales? (not bootstrap?)))))
|
2020-03-18 18:00:13 -04:00
|
|
|
|
(define (lookup-package package)
|
|
|
|
|
(manifest-lookup manifest (manifest-pattern (name package))))
|
|
|
|
|
|
|
|
|
|
(when (null? (manifest-entries manifest))
|
|
|
|
|
(warning (G_ "no packages specified; building an empty pack~%")))
|
|
|
|
|
|
|
|
|
|
(when (and (eq? pack-format 'squashfs)
|
|
|
|
|
(not (any lookup-package '("bash" "bash-minimal"))))
|
|
|
|
|
(warning (G_ "Singularity requires you to provide a shell~%"))
|
|
|
|
|
(display-hint (G_ "Add @code{bash} or @code{bash-minimal} \
|
2019-12-10 09:54:37 -05:00
|
|
|
|
to your package list.")))
|
|
|
|
|
|
2020-03-18 18:00:13 -04:00
|
|
|
|
(run-with-store store
|
2020-04-22 10:11:25 -04:00
|
|
|
|
(mlet* %store-monad ((drv (build-image name profile
|
2020-03-18 18:00:13 -04:00
|
|
|
|
#:target
|
|
|
|
|
target
|
|
|
|
|
#:compressor
|
|
|
|
|
compressor
|
|
|
|
|
#:symlinks
|
|
|
|
|
symlinks
|
|
|
|
|
#:localstatedir?
|
|
|
|
|
localstatedir?
|
|
|
|
|
#:entry-point
|
|
|
|
|
entry-point
|
|
|
|
|
#:profile-name
|
|
|
|
|
profile-name
|
|
|
|
|
#:archiver
|
|
|
|
|
archiver)))
|
|
|
|
|
(mbegin %store-monad
|
|
|
|
|
(mwhen derivation?
|
|
|
|
|
(return (format #t "~a~%"
|
|
|
|
|
(derivation-file-name drv))))
|
|
|
|
|
(munless derivation?
|
|
|
|
|
(built-derivations (list drv))
|
|
|
|
|
(mwhen gc-root
|
|
|
|
|
(register-root* (match (derivation->output-paths drv)
|
|
|
|
|
(((names . items) ...)
|
|
|
|
|
items))
|
|
|
|
|
gc-root))
|
|
|
|
|
(return (format #t "~a~%"
|
|
|
|
|
(derivation->output-path drv))))))
|
2020-04-03 15:51:12 -04:00
|
|
|
|
#:target target
|
2020-03-18 18:00:13 -04:00
|
|
|
|
#:system (assoc-ref opts 'system)))))))))
|