From: "Clément Lassieur" <clement@lassieur.org>
To: 32547@debbugs.gnu.org
Subject: [bug#32547] [PATCH] hydra: Add support for manifests.
Date: Tue, 28 Aug 2018 00:23:33 +0200 [thread overview]
Message-ID: <20180827222333.7722-1-clement@lassieur.org> (raw)
* build-aux/hydra/gnu-system.scm (arguments->manifests, manifests->packages):
New procedures.
(hydra-jobs): Add a "manifests" subset.
* doc/guix.texi (Continuous Integration): Update accordingly.
---
build-aux/hydra/gnu-system.scm | 34 +++++++++++++++++++++
doc/guix.texi | 56 +++++++++++++++++++++++-----------
2 files changed, 72 insertions(+), 18 deletions(-)
diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index b1554ced4..e8ce8eada 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -56,6 +56,7 @@
(guix packages)
(guix derivations)
(guix monads)
+ (guix ui)
((guix licenses) #:select (gpl3+))
((guix utils) #:select (%current-system))
((guix scripts system) #:select (read-operating-system))
@@ -311,6 +312,30 @@ valid."
packages)))
#:select? (const #t))) ;include hidden packages
+(define (arguments->manifests arguments)
+ "Return the list of manifests extracted from ARGUMENTS."
+ (map (match-lambda
+ ((input-name . relative-path)
+ (let* ((checkout (assq-ref arguments (string->symbol input-name)))
+ (base (assq-ref checkout 'file-name)))
+ (in-vicinity base relative-path))))
+ (assq-ref arguments 'manifests)))
+
+(define (manifests->packages store manifests)
+ "Return the list of packages found in MANIFESTS."
+ (define (load-manifest manifest)
+ (save-module-excursion
+ (lambda ()
+ (set-current-module (make-user-module '((guix profiles) (gnu))))
+ (primitive-load manifest))))
+
+ (parameterize ((%graft? #f))
+ (delete-duplicates!
+ (map manifest-entry-item
+ (append-map (compose manifest-entries
+ load-manifest)
+ manifests)))))
+
\f
;;;
;;; Hydra entry point.
@@ -323,6 +348,7 @@ valid."
("core" 'core) ; only build core packages
("hello" 'hello) ; only build hello
(((? string?) (? string?) ...) 'list) ; only build selected list of packages
+ ("manifests" 'manifests) ; only build packages in the list of manifests
(_ 'all))) ; build everything
(define systems
@@ -419,6 +445,14 @@ valid."
package system))
packages))
'()))
+ ((manifests)
+ ;; Build packages in the list of manifests.
+ (let* ((manifests (arguments->manifests arguments))
+ (packages (manifests->packages store manifests)))
+ (map (lambda (package)
+ (package-job store (job-name package)
+ package system))
+ packages)))
(else
(error "unknown subset" subset))))
systems)))
diff --git a/doc/guix.texi b/doc/guix.texi
index d2d278df4..2b2fe6c93 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17704,23 +17704,43 @@ The type of the Cuirass service. Its value must be a
@code{cuirass-configuration} object, as described below.
@end defvr
-To add build jobs, you have to set the @code{specifications} field of
-the configuration. Here is an example of a service defining a build job
-based on a specification that can be found in Cuirass source tree. This
-service polls the Guix repository and builds a subset of the Guix
-packages, as prescribed in the @file{gnu-system.scm} example spec:
-
-@example
-(let ((spec #~((#:name . "guix")
- (#:url . "git://git.savannah.gnu.org/guix.git")
- (#:load-path . ".")
- (#:file . "build-aux/cuirass/gnu-system.scm")
- (#:proc . cuirass-jobs)
- (#:arguments (subset . "hello"))
- (#:branch . "master"))))
- (service cuirass-service-type
- (cuirass-configuration
- (specifications #~(list '#$spec)))))
+To add build jobs, you have to set the @code{specifications} field of the
+configuration. Here is an example of a service that polls the Guix repository
+and builds the packages from a manifest. Some of the packages are defined in
+the @code{"custom-packages"} input, which is the equivalent of
+@code{GUIX_PACKAGE_PATH}.
+
+@example
+(define %cuirass-specs
+ #~(list
+ '((#:name . "my-manifest")
+ (#:load-path-inputs . ("guix"))
+ (#:package-path-inputs . ("custom-packages"))
+ (#:proc-input . "guix")
+ (#:proc-file . "build-aux/cuirass/gnu-system.scm")
+ (#:proc . cuirass-jobs)
+ (#:proc-args . ((subset . "manifests")
+ (systems . ("x86_64-linux"))
+ (manifests . (("config" . "guix/manifest.scm")))))
+ (#:inputs . (((#:name . "guix")
+ (#:url . "git://git.savannah.gnu.org/guix.git")
+ (#:load-path . ".")
+ (#:branch . "master")
+ (#:no-compile? . #t))
+ ((#:name . "config")
+ (#:url . "git://git.example.org/config.git")
+ (#:load-path . ".")
+ (#:branch . "master")
+ (#:no-compile? . #t))
+ ((#:name . "custom-packages")
+ (#:url . "git://git.example.org/custom-packages.git")
+ (#:load-path . ".")
+ (#:branch . "master")
+ (#:no-compile? . #t)))))))
+
+(service cuirass-service-type
+ (cuirass-configuration
+ (specifications %cuirass-specs)))
@end example
While information related to build jobs is located directly in the
@@ -17747,7 +17767,7 @@ Owner's group of the @code{cuirass} process.
Number of seconds between the poll of the repositories followed by the
Cuirass jobs.
-@item @code{database} (default: @code{"/var/run/cuirass/cuirass.db"})
+@item @code{database} (default: @code{"/var/lib/cuirass/cuirass.db"})
Location of sqlite database which contains the build results and previously
added specifications.
--
2.18.0
next reply other threads:[~2018-08-27 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 22:23 Clément Lassieur [this message]
2018-09-13 8:19 ` bug#32547: [PATCH] hydra: Add support for manifests Clément Lassieur
2018-09-13 8:34 ` [bug#32547] " Ludovic Courtès
2018-09-13 9:13 ` Clément Lassieur
2018-09-13 16:12 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180827222333.7722-1-clement@lassieur.org \
--to=clement@lassieur.org \
--cc=32547@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.