From 25e071ead9ddf701485750eec41fd869e310eab0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 16 Feb 2018 18:19:42 +0000 Subject: services: nginx: Support extra content in the http block. This helpful when adding content to the nginx configuration file, which isn't supported by the record type used for the configuration. For example, like adding proxy_cache_path configuration. * gnu/packages/web.scm (): Add new extra-content field. (nginx-configuration-extra-content): New field accessor. (default-nginx-config): Add support for the extra-content field. * doc/guix.texi (NGINX): Document the new extra-content field. --- doc/guix.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 13b42f59f3..e734147681 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15938,6 +15938,10 @@ use the size of the processors cache line. @item @code{server-names-hash-bucket-max-size} (default: @code{#f}) Maximum bucket size for the server names hash tables. +@item @code{extra-content} (default: @code{""}) +Extra content for the @code{http} block. Should be string or a string +valued G-expression. + @end table @end deffn -- cgit v1.2.3 From e2f8be0664609223369f01290b69b44196783ab3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Jun 2018 23:39:24 +0200 Subject: pull: Add '--list-generations'. * guix/scripts/pull.scm (show-help, %options): Add '--list-generations'. (display-profile-content, process-query): New procedures. (guix-pull): Honor '--list-generations'. --- doc/guix.texi | 44 +++++++++++---- guix/scripts/pull.scm | 149 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 144 insertions(+), 49 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index e734147681..4871bbcfe4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2756,25 +2756,40 @@ export PATH="$HOME/.config/guix/current/bin:$PATH" export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH" @end example +The @code{--list-generations} or @code{-l} option lists past generations +produced by @command{guix pull}, along with details about their provenance: + +@example +$ guix pull -l +Generation 1 Jun 10 2018 00:18:18 + guix 65956ad + repository URL: https://git.savannah.gnu.org/git/guix.git + branch: origin/master + commit: 65956ad3526ba09e1f7a40722c96c6ef7c0936fe + +Generation 2 Jun 11 2018 11:02:49 + guix e0cc7f6 + repository URL: https://git.savannah.gnu.org/git/guix.git + branch: origin/master + commit: e0cc7f669bec22c37481dd03a7941c7d11a64f1d + +Generation 3 Jun 13 2018 23:31:07 (current) + guix 844cc1c + repository URL: https://git.savannah.gnu.org/git/guix.git + branch: origin/master + commit: 844cc1c8f394f03b404c5bb3aee086922373490c +@end example + This @code{~/.config/guix/current} profile works like any other profile created by @command{guix package} (@pxref{Invoking guix package}). That is, you can list generations, roll back to the previous generation---i.e., the previous Guix---and so on: @example -$ guix package -p ~/.config/guix/current -l -Generation 1 May 25 2018 10:06:41 - guix 221951a out /gnu/store/i4dfk7vw5k112s49jrhl6hwsfnh6wr7l-guix-221951af4 - -Generation 2 May 27 2018 19:07:47 - + guix 2fbae00 out /gnu/store/44cv9hyvxg34xf5kblf5dz57hc52y4bm-guix-2fbae006f - - guix 221951a out /gnu/store/i4dfk7vw5k112s49jrhl6hwsfnh6wr7l-guix-221951af4 - -Generation 3 May 30 2018 16:11:39 (current) - + guix a076f19 out /gnu/store/332czkicwwg6lc3x4aqbw5q2mq12s7fj-guix-a076f1990 - - guix 2fbae00 out /gnu/store/44cv9hyvxg34xf5kblf5dz57hc52y4bm-guix-2fbae006f $ guix package -p ~/.config/guix/current --roll-back switched from generation 3 to 2 +$ guix package -p ~/.config/guix/current --delete-generations=1 +deleting /home/charlie/.config/guix/current-1-link @end example The @command{guix pull} command is usually invoked with no arguments, @@ -2800,6 +2815,13 @@ string. Deploy the tip of @var{branch}, the name of a Git branch available on the repository at @var{url}. +@item --list-generations[=@var{pattern}] +@itemx -l [@var{pattern}] +List all the generations of @file{~/.config/guix/current} or, if @var{pattern} +is provided, the subset of generations that match @var{pattern}. +The syntax of @var{pattern} is the same as with @code{guix package +--list-generations} (@pxref{Invoking guix package}). + @item --bootstrap Use the bootstrap Guile to build the latest Guix. This option is only useful to Guix developers. diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 499de0ec45..7202e3cc16 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -45,6 +45,7 @@ (define-module (guix scripts pull) #:use-module ((gnu packages certs) #:select (le-certs)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) + #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) #:export (guix-pull)) @@ -109,6 +110,9 @@ (define (show-help) --commit=COMMIT download the specified COMMIT")) (display (G_ " --branch=BRANCH download the tip of the specified BRANCH")) + (display (G_ " + -l, --list-generations[=PATTERN] + list generations matching PATTERN")) (display (G_ " --bootstrap use the bootstrap Guile to build the new Guix")) (newline) @@ -125,6 +129,10 @@ (define %options (cons* (option '("verbose") #f #f (lambda (opt name arg result) (alist-cons 'verbose? #t result))) + (option '(#\l "list-generations") #f #t + (lambda (opt name arg result) + (cons `(query list-generations ,(or arg "")) + result))) (option '("url") #t #f (lambda (opt name arg result) (alist-cons 'repository-url arg @@ -273,6 +281,66 @@ (define-syntax-rule (with-git-error-handling body ...) (lambda (key err) (report-git-error err)))) + +;;; +;;; Queries. +;;; + +(define (display-profile-content profile number) + "Display the packages in PROFILE, generation NUMBER, in a human-readable +way and displaying details about the channel's source code." + (for-each (lambda (entry) + (format #t " ~a ~a~%" + (manifest-entry-name entry) + (manifest-entry-version entry)) + (match (assq 'source (manifest-entry-properties entry)) + (('source ('repository ('version 0) + ('url url) + ('branch branch) + ('commit commit) + _ ...)) + (format #t (G_ " repository URL: ~a~%") url) + (when branch + (format #t (G_ " branch: ~a~%") branch)) + (format #t (G_ " commit: ~a~%") commit)) + (_ #f))) + + ;; Show most recently installed packages last. + (reverse + (manifest-entries + (profile-manifest (generation-file-name profile number)))))) + +(define (process-query opts) + "Process any query specified by OPTS." + (define profile + (string-append (config-directory) "/current")) + + (match (assoc-ref opts 'query) + (('list-generations pattern) + (define (list-generation display-function number) + (unless (zero? number) + (display-generation profile number) + (display-function profile number) + (newline))) + + (leave-on-EPIPE + (cond ((not (file-exists? profile)) ; XXX: race condition + (raise (condition (&profile-not-found-error + (profile profile))))) + ((string-null? pattern) + (for-each (lambda (generation) + (list-generation display-profile-content generation)) + (profile-generations profile))) + ((matching-generations pattern profile) + => + (match-lambda + (() + (exit 1)) + ((numbers ...) + (for-each (lambda (generation) + (list-generation display-profile-content generation)) + numbers))))))))) + (define (guix-pull . args) (define (use-le-certs? url) @@ -287,43 +355,48 @@ (define (use-le-certs? url) (cache (string-append (cache-directory) "/pull"))) (ensure-guile-git!) - (unless (assoc-ref opts 'dry-run?) ;XXX: not very useful - (with-store store - (parameterize ((%graft? (assoc-ref opts 'graft?))) - (set-build-options-from-command-line store opts) - - ;; For reproducibility, always refer to the LE certificates when we - ;; know we're talking to Savannah. - (when (use-le-certs? url) - (honor-lets-encrypt-certificates! store)) - - (format (current-error-port) - (G_ "Updating from Git repository at '~a'...~%") - url) - - (let-values (((checkout commit) - (latest-repository-commit store url - #:ref ref - #:cache-directory cache))) - - (format (current-error-port) - (G_ "Building from Git commit ~a...~%") - commit) - (parameterize ((%guile-for-build - (package-derivation - store - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.2))))) - (run-with-store store - (build-and-install checkout (config-directory) - #:url url - #:branch (match ref - (('branch . branch) - branch) - (_ #f)) - #:commit commit - #:verbose? - (assoc-ref opts 'verbose?)))))))))))) + (cond ((assoc-ref opts 'query) + (process-query opts)) + ((assoc-ref opts 'dry-run?) + #t) ;XXX: not very useful + (else + (with-store store + (parameterize ((%graft? (assoc-ref opts 'graft?))) + (set-build-options-from-command-line store opts) + + ;; For reproducibility, always refer to the LE certificates + ;; when we know we're talking to Savannah. + (when (use-le-certs? url) + (honor-lets-encrypt-certificates! store)) + + (format (current-error-port) + (G_ "Updating from Git repository at '~a'...~%") + url) + + (let-values (((checkout commit) + (latest-repository-commit store url + #:ref ref + #:cache-directory + cache))) + + (format (current-error-port) + (G_ "Building from Git commit ~a...~%") + commit) + (parameterize ((%guile-for-build + (package-derivation + store + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.2))))) + (run-with-store store + (build-and-install checkout (config-directory) + #:url url + #:branch (match ref + (('branch . branch) + branch) + (_ #f)) + #:commit commit + #:verbose? + (assoc-ref opts 'verbose?))))))))))))) ;;; pull.scm ends here -- cgit v1.2.3 From c5a2e1ffcb029f50c4c18352cf378b61c41c625e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 4 Jun 2018 22:31:48 +0200 Subject: build: Require Guile-SQLite3. The next commits make (sqlite3) an indirect dependency of (gnu build install), which is itself used by (guix scripts system), hence this new requirement. * configure.ac: Error out when $guix_cv_have_recent_guile_sqlite3 is false. Remove HAVE_GUILE_SQLITE3 Automake conditional. * Makefile.am (MODULES, SCM_TESTS): Remove HAVE_GUILE_SQLITE3 conditions. * doc/guix.texi (Requirements): Add Guile-SQLite3. * README: Ditto. * gnu/packages/package-management.scm (guix)[propagated-inputs]: Add GUILE-SQLITE3. [arguments]: In 'wrap-program' phase, take guile-sqlite3 into account. --- Makefile.am | 16 +++------------- README | 3 ++- configure.ac | 5 +++-- doc/guix.texi | 3 +++ gnu/packages/package-management.scm | 4 +++- 5 files changed, 14 insertions(+), 17 deletions(-) (limited to 'doc') diff --git a/Makefile.am b/Makefile.am index 0267e8fe50..f4cdba94a2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -262,11 +262,7 @@ STORE_MODULES = \ guix/store/database.scm \ guix/store/deduplication.scm -if HAVE_GUILE_SQLITE3 MODULES += $(STORE_MODULES) -else -MODULES_NOT_COMPILED += $(STORE_MODULES) -endif !HAVE_GUILE_SQLITE3 # Internal modules with test suite support. dist_noinst_DATA = guix/tests.scm guix/tests/http.scm @@ -379,7 +375,9 @@ SCM_TESTS = \ tests/scripts-build.scm \ tests/containers.scm \ tests/pack.scm \ - tests/import-utils.scm + tests/import-utils.scm \ + tests/store-database.scm \ + tests/store-deduplication.scm if HAVE_GUILE_JSON @@ -391,14 +389,6 @@ SCM_TESTS += \ endif -if HAVE_GUILE_SQLITE3 - -SCM_TESTS += \ - tests/store-database.scm \ - tests/store-deduplication.scm - -endif - SH_TESTS = \ tests/guix-build.sh \ tests/guix-download.sh \ diff --git a/README b/README index 243a6c058c..e1d62763d0 100644 --- a/README +++ b/README @@ -23,7 +23,8 @@ GNU Guix currently depends on the following packages: - [[https://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.13 or later - [[https://gnupg.org/][GNU libgcrypt]] - [[https://www.gnu.org/software/make/][GNU Make]] - - [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled. + - [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled + - [[https://notabug.org/civodul/guile-sqlite3][Guile-SQLite3]] - [[https://gitlab.com/guile-git/guile-git][Guile-Git]] - [[http://www.zlib.net/][zlib]] - optionally [[https://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command diff --git a/configure.ac b/configure.ac index d338bfda53..b866e91b2c 100644 --- a/configure.ac +++ b/configure.ac @@ -126,8 +126,9 @@ AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"]) dnl Guile-Sqlite3 is used by the (guix store ...) modules. GUIX_CHECK_GUILE_SQLITE3 -AM_CONDITIONAL([HAVE_GUILE_SQLITE3], - [test "x$guix_cv_have_recent_guile_sqlite3" = "xyes"]) +if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then + AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.]) +fi dnl Make sure we have a full-fledged Guile. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads]) diff --git a/doc/guix.texi b/doc/guix.texi index 4871bbcfe4..d86ac5044f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -615,6 +615,9 @@ later, including 2.2.x; Guile,, gnutls-guile, GnuTLS-Guile}); @item @c FIXME: Specify a version number once a release has been made. +@uref{https://notabug.org/civodul/guile-sqlite3, Guile-SQLite3}; +@item +@c FIXME: Specify a version number once a release has been made. @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, from August 2017 or later; @item @url{http://zlib.net, zlib}; diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 19954c3608..786d2a53e9 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -213,12 +213,13 @@ (define (intern tarball) (let* ((out (assoc-ref outputs "out")) (guile (assoc-ref inputs "guile")) (json (assoc-ref inputs "guile-json")) + (sqlite (assoc-ref inputs "guile-sqlite3")) (git (assoc-ref inputs "guile-git")) (bs (assoc-ref inputs "guile-bytestructures")) (ssh (assoc-ref inputs "guile-ssh")) (gnutls (assoc-ref inputs "gnutls")) - (deps (list json gnutls git bs ssh)) + (deps (list json sqlite gnutls git bs ssh)) (effective (read-line (open-pipe* OPEN_READ @@ -275,6 +276,7 @@ (define (intern tarball) (propagated-inputs `(("gnutls" ,gnutls) ("guile-json" ,guile-json) + ("guile-sqlite3" ,guile-sqlite3) ("guile-ssh" ,guile-ssh) ("guile-git" ,guile-git))) -- cgit v1.2.3 From 4ce4fc501035a8ef461e10d5f3df6ea3a63c7572 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 15 Jun 2018 09:52:42 +0200 Subject: system: Add os-with-u-boot. * gnu/system/install.scm (os-with-u-boot): New procedure. * gnu/packages/bootloaders.scm (make-u-boot-package): Export. * doc/guix.texi (Building the Installation Image for ARM Boards): New subsection. --- doc/guix.texi | 16 ++++++++++++++++ gnu/packages/bootloaders.scm | 2 +- gnu/system/install.scm | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index d86ac5044f..a90af34f80 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8881,6 +8881,22 @@ Have a look at @file{gnu/system/install.scm} in the source tree, and see also @ref{Invoking guix system} for more information about the installation image. +@subsection Building the Installation Image for ARM Boards + +Many ARM boards require a specific variant of the +@uref{http://www.denx.de/wiki/U-Boot/, U-Boot} bootloader. + +If you build a disk image and the bootloader is not available otherwise +(on another boot drive etc), it's advisable to build an image that +includes the bootloader, specifically: + +@example +guix system disk-image --system=armhf-linux -e '((@@ (gnu system install) os-with-u-boot) (@@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")' +@end example + +@code{A20-OLinuXino-Lime2} is the name of the board. If you specify an invalid +board, a list of possible boards will be printed. + @node System Configuration @section System Configuration diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index a86c73731e..c58fe07423 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -439,7 +439,7 @@ (define-public u-boot-tools also initializes the boards (RAM etc). This package provides its board-independent tools."))) -(define (make-u-boot-package board triplet) +(define-public (make-u-boot-package board triplet) "Returns a u-boot package for BOARD cross-compiled for TRIPLET." (let ((same-arch? (if (string-prefix? (%current-system) (gnu-triplet->nix-system triplet)) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 35f4ba9c24..6a3ae1947b 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -54,7 +54,8 @@ (define-module (gnu system install) novena-installation-os pine64-plus-installation-os rk3399-puma-installation-os - wandboard-installation-os)) + wandboard-installation-os + os-with-u-boot)) ;;; Commentary: ;;; @@ -386,6 +387,19 @@ (define installation-os nvi ;:wq! %base-packages)))) +(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0") + (triplet "arm-linux-gnueabihf")) + "Given OS, amend it with the u-boot bootloader for BOARD, +installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET. + +If you want a serial console, make sure to specify one in your +operating-system's kernel-arguments (\"console=ttyS0\" or similar)." + (operating-system (inherit os) + (bootloader (bootloader-configuration + (bootloader (bootloader (inherit u-boot-bootloader) + (package (make-u-boot-package board triplet)))) + (target bootloader-target))))) + (define* (embedded-installation-os bootloader bootloader-target tty #:key (extra-modules '())) "Return an installation os for embedded systems. -- cgit v1.2.3 From 38ab778fbd676fe7f7a84220d0cf7f474573dc2b Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 26 May 2018 15:39:13 +0200 Subject: doc: Clarify when branches are "frozen". * doc/contributing.texi (Submitting Patches): Provide a link to Hydra. Add section about freezing branches. --- doc/contributing.texi | 11 +++++++++-- doc/guix.texi | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/contributing.texi b/doc/contributing.texi index 205c972aea..ca44b3b0b0 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -407,12 +407,19 @@ changes). This branch is intended to be merged in @code{master} every 2.5 months or so. @end table -All these branches are tracked by our build farm -and merged into @code{master} once +All these branches are @uref{https://hydra.gnu.org/project/gnu, +tracked by our build farm} and merged into @code{master} once everything has been successfully built. This allows us to fix issues before they hit users, and to reduce the window during which pre-built binaries are not available. +Generally, branches other than @code{master} are considered +@emph{frozen} if there has been a recent evaluation, or there is a +corresponding @code{-next} branch. Please ask on the mailing list or +IRC if unsure where to place a patch. +@c TODO: It would be good with badges on the website that tracks these +@c branches. Or maybe even a status page. + @item @cindex determinism, of build processes @cindex reproducible builds, checking diff --git a/doc/guix.texi b/doc/guix.texi index a90af34f80..1ecb110020 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37,7 +37,7 @@ Copyright @copyright{} 2017 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* -Copyright @copyright{} 2017 Marius Bakke@* +Copyright @copyright{} 2017, 2018 Marius Bakke@* Copyright @copyright{} 2017 Hartmut Goebel@* Copyright @copyright{} 2017 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018 Tobias Geerinckx-Rice@* -- cgit v1.2.3