01/01: talks: Add Fund The Code talk.

2019-03-20 Thread Clment Lassieur
snape pushed a commit to branch master
in repository maintenance.

commit 2c68353f07562fb885681a64328113744d1aff42
Author: Clément Lassieur 
Date:   Wed Mar 20 11:03:37 2019 +0100

talks: Add Fund The Code talk.

* talks/fundthecode-2019: New directory.
---
 talks/fundthecode-2019/images/Guix_logo.svg.png | Bin 0 -> 56485 bytes
 talks/fundthecode-2019/talk.html| 372 
 talks/fundthecode-2019/talk.org | 183 
 3 files changed, 555 insertions(+)

diff --git a/talks/fundthecode-2019/images/Guix_logo.svg.png 
b/talks/fundthecode-2019/images/Guix_logo.svg.png
new file mode 100644
index 000..1e44567
Binary files /dev/null and b/talks/fundthecode-2019/images/Guix_logo.svg.png 
differ
diff --git a/talks/fundthecode-2019/talk.html b/talks/fundthecode-2019/talk.html
new file mode 100644
index 000..d489c07
--- /dev/null
+++ b/talks/fundthecode-2019/talk.html
@@ -0,0 +1,372 @@
+
+
+
+
+GNU Guix
+
+
+.underline { text-decoration: underline; }
+
+http://cdn.jsdelivr.net/reveal.js/3.0.0/css/reveal.css"/>
+
+http://cdn.jsdelivr.net/reveal.js/3.0.0/css/theme/night.css; id="theme"/>
+
+http://cdn.jsdelivr.net/reveal.js/3.0.0/lib/css/zenburn.css"/>
+
+
+if( window.location.search.match( /print-pdf/gi ) ) {
+var link = document.createElement( 'link' );
+link.rel = 'stylesheet';
+link.type = 'text/css';
+link.href = 
'http://cdn.jsdelivr.net/reveal.js/3.0.0/css/print/pdf.css';
+document.getElementsByTagName( 'head' )[0].appendChild( link );
+}
+
+
+
+
+
+
+GNU GuixClément Lassieur  
Mathieu OthaceheCreated: 2019-03-19 mar. 17:32
+
+
+
+
+1 Gestion de paquets 
sous GNU/Linux
+
+
+
+
+1.1 Un écosystème 
complexe
+
+Les distributions historiques sont en perte de 
vitesse
+Chaque language implémente son propre "package 
manager" : pip,
+Cargo, Cabal, npm
+D'autres types d'outils apparaissent
+
+
+
+Pour les développeurs : VirtualEnv, Spack, 
EasyBuild
+Pour les administrateurs : Ansible, Puppet, 
Propellor
+Pour tous : Flatpak, snap, Docker, Vagrant
+
+
+
+
+
+1.2 Qui ne répond 
pas à tous les problèmes
+
+
+Tout conteneuriser ?
+
+
+
+“Debian and other distributions
+are going to be that thing you
+run docker on, little more.”
+  Jos Poortvliet, développeur ownCloud
+
+
+Qualité des paquets
+Opacité, manque de flexibilité
+Manque d'outils de développement
+
+
+
+
+1.3 Sommes-nous 
fichus ?
+
+
+1.4 Non !
+
+
+
+
+
+2 Guix
+
+Peut être vu comme un package manager
+Ensemble d'outils pour faire du déploiement de 
logiciels et de systèmes
+
+
+
+
+
+2.1 Paquets
+
+
+Pas besoin d'être root
+
+
+
+guix package -i gcc-toolchain openmpi hwloc
+
+
+
+Transactionnel
+
+
+
+guix package --roll-back
+
+
+
+Permet d'expérimenter
+
+
+
+guix package --profile=./experiment -i 
gcc-toolchain@5.5 hwloc@1
+
+
+
+Gestion des paquets (version control)
+
+
+
+guix package --manifest=my-packages.scm
+
+
+
+
+(specifications->manifest
+ '("gcc-toolchain"
+   "emacs"
+   "guile"
+   "emacs-geiser"))
+
+
+
+
+
+
+
+2.2 
Environnement
+
+
+
+
+2.2.1 
Reproduction
+
+
+Je me fais mon environnement de travail
+
+
+
+bob@laptop$ guix package --manifest=my-packages.scm
+
+
+
+Quelle version de Guix j'utilise ?
+
+
+
+bob@laptop$ guix describe
+  guix cabba9e
+  repository URL: https://git.sv.gnu.org/git/guix.git
+  commit: cabba9e15900d20927c1f69c6c87d7d2a62040fe
+
+
+
+Alice peut le reproduire exactement
+
+
+
+alice@laptop$ guix pull --commit=cabba9e
+alice@laptop$ guix package --manifest=my-packages.scm
+
+
+
+
+
+
+
+2.2.2 Facile de 
hacker GNU hello
+
+
+On le télécharge
+
+
+
+guix build -S hello
+/gnu/store/...-hello-2.10.tar.gz
+
+
+
+'guix environment' donne tous les outils nécessaires pour le compiler (gcc, 
make)
+
+
+
+~/hello-2.10$ guix environment hello
+
+
+
+On compile
+
+
+
+~/hello-2.10$ ./configure && make
+
+
+
+
+
+
+
+2.2.3 Tester un 
paquet Python sans rien installer
+
+
+On se met dans le bon environnement
+
+
+
+~$ guix environment --ad-hoc python python-numpy
+
+
+
+Et on fait notre test
+
+
+
+~$ python3
+>>> import numpy
+
+
+
+
+
+
+
+2.3 Système
+
+
+On déclare tout ce qu'on veut avoir dans notre système
+
+
+
+(operating-system
+  (host-name "schememachine")
+  (timezone "Europe/Paris")
+  (locale "fr_FR.utf8")
+  (bootloader (\alert{bootloader-configuration}
+  (bootloader grub-efi-bootloader)
+  (target "/boot/efi")))
+  (file-systems (cons (\alert{file-system}
+  (device (file-system-label "my-root"))
+  (mount-point "/")
+  (type "ext4"))
+ %base-file-systems))
+  (users (cons (\alert{user-account}
+   (name "charlie")
+   (group "users")
+   (home-directory "/home/charlie"))
+  %base-user-accounts))
+  (services (cons* (\alert{service} 

branch master updated (5630fcf -> 2c68353)

2019-03-20 Thread Clment Lassieur
snape pushed a change to branch master
in repository maintenance.

  from  5630fcf   talks: IN2P3: Add PDF.
   new  2c68353   talks: Add Fund The Code talk.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 talks/fundthecode-2019/images/Guix_logo.svg.png | Bin 0 -> 56485 bytes
 talks/fundthecode-2019/talk.html| 372 
 talks/fundthecode-2019/talk.org | 183 
 3 files changed, 555 insertions(+)
 create mode 100644 talks/fundthecode-2019/images/Guix_logo.svg.png
 create mode 100644 talks/fundthecode-2019/talk.html
 create mode 100644 talks/fundthecode-2019/talk.org



branch master updated (2aee2a9 -> d827fd3)

2018-11-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  2aee2a9   guile: newt: Update revision to 2.
   new  0289dc1   progress: Fix crash because of division by zero.
   new  d827fd3   progress: Do not display the last 0B transfer when size 
is unknown.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 guix/progress.scm | 28 
 1 file changed, 16 insertions(+), 12 deletions(-)



02/02: progress: Do not display the last 0B transfer when size is unknown.

2018-11-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit d827fd31ca19b2f81252cbe4e8bc982dd453a49a
Author: Clément Lassieur 
Date:   Wed Nov 14 09:16:43 2018 +0100

progress: Do not display the last 0B transfer when size is unknown.

* guix/progress.scm (display-download-progress): Don't display anything when
both SIZE and TRANSFERRED are null.
---
 guix/progress.scm | 25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/guix/progress.scm b/guix/progress.scm
index 7a25f11..65080bc 100644
--- a/guix/progress.scm
+++ b/guix/progress.scm
@@ -212,17 +212,20 @@ throughput."
 (current-terminal-columns))
  log-port)
 (force-output log-port))
-  (let* ((throughput (/ transferred elapsed))
- (left   (format #f " ~a" file))
- (right  (format #f "~a/s ~a | ~a transferred"
- (byte-count->string throughput)
- (seconds->string elapsed)
- (byte-count->string transferred
-(erase-current-line log-port)
-(display (string-pad-middle left right
-(current-terminal-columns))
- log-port)
-(force-output log-port
+  ;; If we don't know the total size, the last transfer will have a 0B
+  ;; size.  Don't display it.
+  (unless (zero? transferred)
+(let* ((throughput (/ transferred elapsed))
+   (left   (format #f " ~a" file))
+   (right  (format #f "~a/s ~a | ~a transferred"
+   (byte-count->string throughput)
+   (seconds->string elapsed)
+   (byte-count->string transferred
+  (erase-current-line log-port)
+  (display (string-pad-middle left right
+  (current-terminal-columns))
+   log-port)
+  (force-output log-port)
 
 (define %progress-interval
   ;; Default interval between subsequent outputs for rate-limited displays.



01/02: progress: Fix crash because of division by zero.

2018-11-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 0289dc14732a64016f66e3a83f765e319960903b
Author: Clément Lassieur 
Date:   Wed Nov 14 09:13:21 2018 +0100

progress: Fix crash because of division by zero.

* guix/progress.scm (display-download-progress): Handle the case where SIZE 
is
null.
---
 guix/progress.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/progress.scm b/guix/progress.scm
index 9da667a..7a25f11 100644
--- a/guix/progress.scm
+++ b/guix/progress.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017 Sou Bunnbu 
 ;;; Copyright © 2015 Steve Sprang 
 ;;; Copyright © 2017, 2018 Ludovic Courtès 
+;;; Copyright © 2018 Clément Lassieur 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -197,7 +198,7 @@ throughput."
   (define elapsed
 (duration->seconds
  (time-difference (current-time time-monotonic) start-time)))
-  (if (number? size)
+  (if (and (number? size) (not (zero? size)))
   (let* ((%  (* 100.0 (/ transferred size)))
  (throughput (/ transferred elapsed))
  (left   (format #f " ~a  ~a" file



03/05: gnu: gajim: Update to 1.1.0.

2018-11-11 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 992a496503a49ef7977f097a1390f8536b06dee4
Author: Clément Lassieur 
Date:   Thu Nov 8 10:13:44 2018 +0100

gnu: gajim: Update to 1.1.0.

* gnu/packages/messaging.scm (gajim): Update to 1.1.0.
[arguments]: Set #:test-target to "test_nogui".  Remove the
'remove-test-resolver' and 'start-xserver' phases.
[inputs]: Remove python-pyasn1.  Add python-cssutils, python-keyring and
python-precis-i18n.
---
 gnu/packages/messaging.scm | 25 +++--
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 9874267..5f1aa7c 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -574,7 +574,7 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
 (define-public gajim
   (package
 (name "gajim")
-(version "1.0.3")
+(version "1.1.0")
 (source (origin
   (method url-fetch)
   (uri (string-append "https://gajim.org/downloads/;
@@ -582,10 +582,11 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
   "/gajim-" version ".tar.bz2"))
   (sha256
(base32
-"0ds4rqwfrpj89a489w6yih8gx5zi7qa4ffgld950fk7s0qxvcfnb"
+"1qis8vs7y7g1zn5i5dshwrszidc22qpflycwb4nixvp9lbmkq0va"
 (build-system python-build-system)
 (arguments
- `(#:phases
+ `(#:test-target "test_nogui"
+   #:phases
(modify-phases %standard-phases
  (add-after 'install 'wrap-program
(lambda* (#:key outputs #:allow-other-keys)
@@ -598,20 +599,6 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
   `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)
 '("gajim" "gajim-remote" "gajim-history-manager")))
  #t))
- (add-before 'check 'remove-test-resolver
-   ;; This test requires network access.
-   (lambda _
- (substitute* "test/runtests.py"
-   (("'integration.test_resolver',") ""))
- #t))
- (add-before 'check 'start-xserver
-   ;; Tests require a running X server.
-   (lambda* (#:key inputs #:allow-other-keys)
- (let ((xorg-server (assoc-ref inputs "xorg-server"))
-   (display ":1"))
-   (setenv "DISPLAY" display)
-   (zero? (system (string-append xorg-server "/bin/Xvfb "
- display " &"))
  (add-after 'install 'install-icons
(lambda* (#:key inputs outputs #:allow-other-keys)
  (let* ((out (assoc-ref outputs "out"))
@@ -648,12 +635,14 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
("hicolor-icon-theme" ,hicolor-icon-theme)
("libsecret" ,libsecret)
("python-axolotl" ,python-axolotl)
+   ("python-cssutils" ,python-cssutils)
("python-dbus" ,python-dbus)
("python-docutils" ,python-docutils)
("python-gnupg" ,python-gnupg)
+   ("python-keyring" ,python-keyring)
("python-nbxmpp" ,python-nbxmpp)
("python-pillow" ,python-pillow)
-   ("python-pyasn1" ,python-pyasn1)
+   ("python-precis-i18n" ,python-precis-i18n)
("python-pycairo" ,python-pycairo)
("python-pygobject" ,python-pygobject)
("python-pyopenssl" ,python-pyopenssl)



branch master updated (902068b -> 37a350e)

2018-11-11 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  902068b   gnu: tiled: Fetch sources from git.
   new  4ad3786   gnu: Add python-precis-i18n.
   new  a311f42   gnu: python-nbxmpp: Update to 0.6.8.
   new  992a496   gnu: gajim: Update to 1.1.0.
   new  60c5b44   gnu: gajim: Get the second 'wrap-program' phase to return 
#t.
   new  37a350e   gnu: gajim: Move python-docutils from inputs to 
native-inputs.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/messaging.scm | 34 --
 gnu/packages/python.scm| 19 +++
 2 files changed, 31 insertions(+), 22 deletions(-)



02/05: gnu: python-nbxmpp: Update to 0.6.8.

2018-11-11 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit a311f42e1bcb71b59e3ce51ee3c8f6148d939168
Author: Clément Lassieur 
Date:   Sun Nov 11 12:26:03 2018 +0100

gnu: python-nbxmpp: Update to 0.6.8.

* gnu/packages/messaging.scm (python-nbxmpp): Update to 0.6.8.
---
 gnu/packages/messaging.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 1a7560b..9874267 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -549,14 +549,14 @@ simultaneously and therefore appear under the same 
nickname on IRC.")
 (define-public python-nbxmpp
   (package
 (name "python-nbxmpp")
-(version "0.6.7")
+(version "0.6.8")
 (source
  (origin
(method url-fetch)
(uri (pypi-uri "nbxmpp" version))
(sha256
 (base32
- "0fas4iawjfdmkz8vr042wpq6b2qispi6fy35g4a62jw50jb1saav"
+ "1iip8ijxp86fx4bl1h67p2lp02p2zm1ga2p3q43nv30smj54nawc"
 (build-system python-build-system)
 (arguments
  `(#:tests? #f)); no tests



01/05: gnu: Add python-precis-i18n.

2018-11-11 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 4ad3786b7b61073005f024f33465e6b7a4a952ad
Author: Clément Lassieur 
Date:   Sun Nov 11 12:26:44 2018 +0100

gnu: Add python-precis-i18n.

* gnu/packages/messaging.scm (python-precis-i18n): New variable.
---
 gnu/packages/python.scm | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 5f81c42..b6b0ad7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14611,3 +14611,22 @@ on regular expressions.")
  (propagated-inputs
   `(("python2-enum34" ,python2-enum34)
 ,@(package-propagated-inputs reparser))
+
+(define-public python-precis-i18n
+  (package
+(name "python-precis-i18n")
+(version "1.0.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (pypi-uri "precis_i18n" version))
+   (sha256
+(base32
+ "0gjhvwd8aifx94rl1ag08vlmndyx2q3fkyqb0c4i46x3p2bc2yi2"
+(build-system python-build-system)
+(home-page "https://github.com/byllyfish/precis_i18n;)
+(synopsis "Implementation of the PRECIS framework")
+(description
+ "This module implements the PRECIS Framework as described in RFC 8264,
+RFC 8265 and RFC 8266.")
+(license license:expat)))



04/05: gnu: gajim: Get the second 'wrap-program' phase to return #t.

2018-11-11 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 60c5b4448961ce1745b7f0bfada1e7620f238ea0
Author: Clément Lassieur 
Date:   Sun Nov 11 15:34:06 2018 +0100

gnu: gajim: Get the second 'wrap-program' phase to return #t.

* gnu/packages/messaging.scm (gajim)[arguments]: Get the second 
'wrap-program'
phase to return #t.
---
 gnu/packages/messaging.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 5f1aa7c..c276bc0 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -623,7 +623,8 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
;; For GtkFileChooserDialog.
`("GSETTINGS_SCHEMA_DIR" =
  (,(string-append (assoc-ref inputs "gtk+")
-  "/share/glib-2.0/schemas")
+  "/share/glib-2.0/schemas"
+ #t)
 (native-inputs
  `(("intltool" ,intltool)
("xorg-server" ,xorg-server)))



05/05: gnu: gajim: Move python-docutils from inputs to native-inputs.

2018-11-11 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 37a350eccee7b36cba779c6a6841448b8deaed72
Author: Clément Lassieur 
Date:   Sun Nov 11 15:24:00 2018 +0100

gnu: gajim: Move python-docutils from inputs to native-inputs.

* gnu/packages/messaging.scm (gajim): Move python-docutils from inputs to
native-inputs.
---
 gnu/packages/messaging.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index c276bc0..9d65248 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -627,6 +627,7 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
  #t)
 (native-inputs
  `(("intltool" ,intltool)
+   ("python-docutils" ,python-docutils)
("xorg-server" ,xorg-server)))
 (inputs
  `(("adwaita-icon-theme" ,adwaita-icon-theme)
@@ -638,7 +639,6 @@ was initially a fork of xmpppy, but uses non-blocking 
sockets.")
("python-axolotl" ,python-axolotl)
("python-cssutils" ,python-cssutils)
("python-dbus" ,python-dbus)
-   ("python-docutils" ,python-docutils)
("python-gnupg" ,python-gnupg)
("python-keyring" ,python-keyring)
("python-nbxmpp" ,python-nbxmpp)



01/03: services: dovecot: Allow to set 'client-limit'.

2018-11-10 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 8d9bb4b4d05a20bef1cf7b1da2b1c5fb05f9b071
Author: Clément Lassieur 
Date:   Sat Nov 10 15:14:28 2018 +0100

services: dovecot: Allow to set 'client-limit'.

* doc/guix.texi (Mail Services): Update accordingly.
* gnu/services/mail.scm (service-configuration)[client-limit]: New field.
(dovecot-configuration)[services]: Set 'client-limit' to its correct default
value.
---
 doc/guix.texi | 10 ++
 gnu/services/mail.scm | 27 ++-
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 441b65b..d4178ce 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14349,6 +14349,16 @@ Defaults to @samp{#t}.
 
 @end deftypevr
 
+@deftypevr {@code{service-configuration} parameter} non-negative-integer 
client-limit
+Maximum number of simultaneous client connections per process.  Once
+this number of connections is received, the next incoming connection
+will prompt Dovecot to spawn another process.  If set to 0,
+@code{default-client-limit} is used instead.
+
+Defaults to @samp{0}.
+
+@end deftypevr
+
 @deftypevr {@code{service-configuration} parameter} non-negative-integer 
service-count
 Number of connections to handle before starting a new process.
 Typically the only useful values are 0 (unlimited) or 1.  1 is more
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 573efa0..abc1c15 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Andy Wingo 
-;;; Copyright © 2017 Clément Lassieur 
+;;; Copyright © 2017, 2018 Clément Lassieur 
 ;;; Copyright © 2017 Carlo Zancanaro 
 ;;; Copyright © 2017 Tobias Geerinckx-Rice 
 ;;;
@@ -290,6 +290,12 @@ the section name.")
"Listeners for the service.  A listener is either an
 @code{unix-listener-configuration}, a @code{fifo-listener-configuration}, or
 an @code{inet-listener-configuration}.")
+  (client-limit
+   (non-negative-integer 0)
+   "Maximum number of simultaneous client connections per process.  Once this
+number of connections is received, the next incoming connection will prompt
+Dovecot to spawn another process.  If set to 0, @code{default-client-limit} is
+used instead.")
   (service-count
(non-negative-integer 1)
"Number of connections to handle before starting a new process.
@@ -475,6 +481,7 @@ complex, customize the address and port fields of the
 (list
  (service-configuration
   (kind "imap-login")
+  (client-limit 0)
   (listeners
(list
 (inet-listener-configuration (protocol "imap") (port 143) (ssl? #f))
@@ -487,10 +494,15 @@ complex, customize the address and port fields of the
 (inet-listener-configuration (protocol "pop3s") (port 995) (ssl? 
#t)
  (service-configuration
   (kind "lmtp")
+  (client-limit 1)
   (listeners
(list (unix-listener-configuration (path "lmtp") (mode "0666")
- (service-configuration (kind "imap"))
- (service-configuration (kind "pop3"))
+ (service-configuration
+  (kind "imap")
+  (client-limit 1))
+ (service-configuration
+  (kind "pop3")
+  (client-limit 1))
  (service-configuration (kind "auth")
   ;; In what could be taken to be a bug, the default value of 1 for
   ;; service-count makes it so that a PAM auth worker can't fork off
@@ -501,10 +513,15 @@ complex, customize the address and port fields of the
   ;; is the default for all other services.  As a hack, bump this value to
   ;; 30.
   (service-count 30)
+  (client-limit 0)
   (listeners
(list (unix-listener-configuration (path "auth-userdb")
- (service-configuration (kind "auth-worker"))
- (service-configuration (kind "dict")
+ (service-configuration
+  (kind "auth-worker")
+  (client-limit 1))
+ (service-configuration
+  (kind "dict")
+  (client-limit 1)
   (listeners (list (unix-listener-configuration (path "dict")))
"List of services to enable.  Available services include @samp{imap},
 @samp{imap-login}, @samp{pop3}, @samp{pop3-login}, @samp{auth}, and



02/03: services: dovecot: Allow to set 'process-limit'.

2018-11-10 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit be8dd4a5fec804f2f004dd3a87c2872af44dc88d
Author: Clément Lassieur 
Date:   Sat Nov 10 18:45:27 2018 +0100

services: dovecot: Allow to set 'process-limit'.

* doc/guix.texi (Mail Services): Update accordingly.
* gnu/services/mail.scm (service-configuration)[process-limit]: New field.
(dovecot-configuration)[services]: Set 'process-limit' to its correct 
default
value.
---
 doc/guix.texi |  9 +
 gnu/services/mail.scm | 17 ++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index d4178ce..c74351d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14364,6 +14364,15 @@ Number of connections to handle before starting a new 
process.
 Typically the only useful values are 0 (unlimited) or 1.  1 is more
 secure, but 0 is faster.  .
 Defaults to @samp{1}.
+
+@end deftypevr
+
+@deftypevr {@code{service-configuration} parameter} non-negative-integer 
process-limit
+Maximum number of processes that can exist for this service.  If set to
+0, @code{default-process-limit} is used instead.
+
+Defaults to @samp{0}.
+
 @end deftypevr
 
 @deftypevr {@code{service-configuration} parameter} non-negative-integer 
process-min-avail
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index abc1c15..dfbdf6d 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -301,6 +301,10 @@ used instead.")
"Number of connections to handle before starting a new process.
 Typically the only useful values are 0 (unlimited) or 1.  1 is more
 secure, but 0 is faster.  .")
+  (process-limit
+   (non-negative-integer 0)
+   "Maximum number of processes that can exist for this service.  If set to 0,
+@code{default-process-limit} is used instead.")
   (process-min-avail
(non-negative-integer 0)
"Number of processes to always keep waiting for more connections.")
@@ -482,6 +486,7 @@ complex, customize the address and port fields of the
  (service-configuration
   (kind "imap-login")
   (client-limit 0)
+  (process-limit 0)
   (listeners
(list
 (inet-listener-configuration (protocol "imap") (port 143) (ssl? #f))
@@ -495,14 +500,17 @@ complex, customize the address and port fields of the
  (service-configuration
   (kind "lmtp")
   (client-limit 1)
+  (process-limit 0)
   (listeners
(list (unix-listener-configuration (path "lmtp") (mode "0666")
  (service-configuration
   (kind "imap")
-  (client-limit 1))
+  (client-limit 1)
+  (process-limit 1024))
  (service-configuration
   (kind "pop3")
-  (client-limit 1))
+  (client-limit 1)
+  (process-limit 1024))
  (service-configuration (kind "auth")
   ;; In what could be taken to be a bug, the default value of 1 for
   ;; service-count makes it so that a PAM auth worker can't fork off
@@ -514,14 +522,17 @@ complex, customize the address and port fields of the
   ;; 30.
   (service-count 30)
   (client-limit 0)
+  (process-limit 1)
   (listeners
(list (unix-listener-configuration (path "auth-userdb")
  (service-configuration
   (kind "auth-worker")
-  (client-limit 1))
+  (client-limit 1)
+  (process-limit 0))
  (service-configuration
   (kind "dict")
   (client-limit 1)
+  (process-limit 0)
   (listeners (list (unix-listener-configuration (path "dict")))
"List of services to enable.  Available services include @samp{imap},
 @samp{imap-login}, @samp{pop3}, @samp{pop3-login}, @samp{auth}, and



03/03: services: dovecot: Set correct default value for the "auth" service.

2018-11-10 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit a7553a7360ac07ff114b807fc3026f08158d34c8
Author: Clément Lassieur 
Date:   Sat Nov 10 18:37:55 2018 +0100

services: dovecot: Set correct default value for the "auth" service.

* gnu/services/mail.scm (dovecot-configuration): Set 'service-count' to 0 
for
the "auth" service.
---
 gnu/services/mail.scm | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index dfbdf6d..fcaedd0 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -511,16 +511,9 @@ complex, customize the address and port fields of the
   (kind "pop3")
   (client-limit 1)
   (process-limit 1024))
- (service-configuration (kind "auth")
-  ;; In what could be taken to be a bug, the default value of 1 for
-  ;; service-count makes it so that a PAM auth worker can't fork off
-  ;; subprocesses for making blocking queries.  The result is that nobody
-  ;; can log in -- very secure, but not very useful!  If we simply omit
-  ;; the service-count, it will default to the value of
-  ;; auth-worker-max-count, which is 30, instead of defaulting to 1, which
-  ;; is the default for all other services.  As a hack, bump this value to
-  ;; 30.
-  (service-count 30)
+ (service-configuration
+  (kind "auth")
+  (service-count 0)
   (client-limit 0)
   (process-limit 1)
   (listeners



branch master updated (005ec8d -> a7553a7)

2018-11-10 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  005ec8d   gnu: f2fs-tools: Update to 1.11.0.
   new  8d9bb4b   services: dovecot: Allow to set 'client-limit'.
   new  be8dd4a   services: dovecot: Allow to set 'process-limit'.
   new  a7553a7   services: dovecot: Set correct default value for the 
"auth" service.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/guix.texi | 19 +++
 gnu/services/mail.scm | 51 ---
 2 files changed, 55 insertions(+), 15 deletions(-)



[no subject]

2018-11-07 Thread Clment Lassieur
branch: master
commit 6b7f456f9c7065cf6c02a3dcc4eb7a4fb2fb8a2d
Author: Clément Lassieur 
Date:   Wed Nov 7 09:03:48 2018 +0100

http: Remove useless lambda expression.

* src/cuirass/http.scm (run-cuirass-server): Remove useless lambda 
expression.
---
 src/cuirass/http.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index bf171ee..92f1ca6 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -377,7 +377,6 @@ Hydra format."
   (spawn-fiber
(lambda ()
  (let-values (((response body state)
-   (handle-request (cut url-handler <> <>)
-   request body '(
+   (handle-request url-handler request body '(
(write-client impl server client response body)
 (loop)



master updated (be489a2 -> 6b7f456)

2018-11-07 Thread Clment Lassieur
snape pushed a change to branch master.

  from  be489a2   base: Distinguish between 'failed' and 
'failed-dependency'.
   new  6b7f456   http: Remove useless lambda expression.


Summary of changes:
 src/cuirass/http.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



02/02: gnu: emacs-exwm: Update to 0.20.

2018-10-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit f1376bfabe81608db85d439351f00505b97e944f
Author: Clément Lassieur 
Date:   Tue Oct 16 10:58:06 2018 +0200

gnu: emacs-exwm: Update to 0.20.

* gnu/packages/emacs.scm (emacs-exwm): Update to 0.20.
[source]: Remove emacs-exwm-fix-fullscreen-issue.patch.
* gnu/local.mk (dist_patch_DATA): Remove patch.
* gnu/packages/patches/emacs-exwm-fix-fullscreen-issue.patch: Remove patch.
---
 gnu/local.mk   |  1 -
 gnu/packages/emacs.scm |  5 ++--
 .../patches/emacs-exwm-fix-fullscreen-issue.patch  | 27 --
 3 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 1fa2eab..b8248e8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -659,7 +659,6 @@ dist_patch_DATA =   
\
   %D%/packages/patches/elogind-glibc-2.27.patch\
   %D%/packages/patches/einstein-build.patch\
   %D%/packages/patches/emacs-exec-path.patch   \
-  %D%/packages/patches/emacs-exwm-fix-fullscreen-issue.patch   \
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch  \
   %D%/packages/patches/emacs-json-reformat-fix-tests.patch \
   %D%/packages/patches/emacs-highlight-stages-add-gexp.patch   \
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index fe90476..d30a4cc 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -6615,7 +6615,7 @@ It should enable you to implement low-level X11 
applications.")
 (define-public emacs-exwm
   (package
 (name "emacs-exwm")
-(version "0.19")
+(version "0.20")
 (synopsis "Emacs X window manager")
 (source (origin
   (method url-fetch)
@@ -6623,8 +6623,7 @@ It should enable you to implement low-level X11 
applications.")
   version ".tar"))
   (sha256
(base32
-"11xd2w4h3zdwkdxypvmcz8s7q72cn76lfr9js77jbizyj6b04lr0"))
-  (patches (search-patches 
"emacs-exwm-fix-fullscreen-issue.patch"
+"0nhhzbkm0mkj7sd1dy2c19cmn56gyaj9nl8kgy86h4fp63hjaz04"
 (build-system emacs-build-system)
 (propagated-inputs
  `(("emacs-xelb" ,emacs-xelb)))
diff --git a/gnu/packages/patches/emacs-exwm-fix-fullscreen-issue.patch 
b/gnu/packages/patches/emacs-exwm-fix-fullscreen-issue.patch
deleted file mode 100644
index 5c9bd36..000
--- a/gnu/packages/patches/emacs-exwm-fix-fullscreen-issue.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 13a14579cc1bb772735f895dd5b4b90c6812f3ee Mon Sep 17 00:00:00 2001
-From: Chris Feng 
-Date: Sun, 29 Jul 2018 00:00:00 +
-Subject: [PATCH] Fix issues with destroying full screen X windows
-
-* exwm-manage.el (exwm-manage--unmanage-window): Set the Emacs window
-of an full screen X window as non-dedicated before killing its buffer
-so as not to cause other side effects.

- exwm-manage.el | 4 
- 1 file changed, 4 insertions(+)
-
-diff --git a/exwm-manage.el b/exwm-manage.el
-index a0a9e05..349157f 100644
 a/exwm-manage.el
-+++ b/exwm-manage.el
-@@ -392,6 +392,10 @@ manager is shutting down."
-:window window :parent exwm--root :x 0 :y 0))
- (xcb:+request exwm--connection
- (make-instance 'xcb:DestroyWindow :window container
-+(when (exwm-layout--fullscreen-p)
-+  (let ((window (get-buffer-window)))
-+(when window
-+  (set-window-dedicated-p window nil
- (exwm-manage--set-client-list)
- (xcb:flush exwm--connection))
-   (let ((kill-buffer-func



branch master updated (532f92c -> f1376bf)

2018-10-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  532f92c   gnu: guix: Update to f9a8fce.
   new  503fe87   gnu: emacs-xelb: Update to 0.16.
   new  f1376bf   gnu: emacs-exwm: Update to 0.20.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/local.mk   |  1 -
 gnu/packages/emacs.scm |  9 
 .../patches/emacs-exwm-fix-fullscreen-issue.patch  | 27 --
 3 files changed, 4 insertions(+), 33 deletions(-)
 delete mode 100644 gnu/packages/patches/emacs-exwm-fix-fullscreen-issue.patch



01/02: gnu: emacs-xelb: Update to 0.16.

2018-10-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 503fe87098a23c0b7d848df5a926ebc22aba7fa6
Author: Clément Lassieur 
Date:   Tue Oct 16 10:57:50 2018 +0200

gnu: emacs-xelb: Update to 0.16.

* gnu/packages/emacs.scm (emacs-xelb): Update to 0.16.
---
 gnu/packages/emacs.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 4b013eb..fe90476 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -6576,14 +6576,14 @@ which code derived from Kelvin H's org-page.")
 (define-public emacs-xelb
   (package
 (name "emacs-xelb")
-(version "0.15")
+(version "0.16")
 (source (origin
   (method url-fetch)
   (uri (string-append "https://elpa.gnu.org/packages/xelb-;
   version ".tar"))
   (sha256
(base32
-"031rvgprsqhf344p9wsczr50vj2qcpwdmhxi80jdbrsm7wyxf3qz"
+"03wsr1jr7f7zfd80h864rd4makwh4widdnj1kjv2xyjwdgap9rl8"
 (build-system emacs-build-system)
 ;; The following functions and variables needed by emacs-xelb are
 ;; not included in emacs-minimal:



01/01: gnu: Add stlink.

2018-10-03 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 615a7eec567f313e1e421ee081c502201932fcd3
Author: Clément Lassieur 
Date:   Tue Oct 2 16:32:03 2018 +0200

gnu: Add stlink.

* gnu/packages/embedded.scm (stlink): New variable.
---
 gnu/packages/embedded.scm | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 0174224..38c76cd 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 David Craven 
 ;;; Copyright © 2017 Efraim Flashner 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
+;;; Copyright © 2018 Clément Lassieur 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@
   #:use-module (guix svn-download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build utils)
@@ -1104,3 +1106,40 @@ and displaying decoded target responses.
 @end enumerate")
 (home-page "https://www.freecalypso.org/;)
 (license license:public-domain)))
+
+(define-public stlink
+  (package
+(name "stlink")
+(version "1.5.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/texane/stlink/archive/v;
+   version ".tar.gz"))
+   (file-name (string-append name "-" version ".tar.gz"))
+   (sha256
+(base32
+ "01z1cz1a5xbbhd163qrqcgp4bi1k145pb80jmwdz50g7sfzmy570"
+(build-system cmake-build-system)
+(arguments
+ `(#:tests? #f  ;no tests
+   #:configure-flags
+   (let* ((out (assoc-ref %outputs "out"))
+  (etc (in-vicinity out "etc"))
+  (modprobe (in-vicinity etc "modprobe.d"))
+  (udev-rules (in-vicinity etc "udev/rules.d")))
+ (list (string-append "-DSTLINK_UDEV_RULES_DIR=" udev-rules)
+   (string-append "-DSTLINK_MODPROBED_DIR=" modprobe)
+(inputs
+ `(("libusb" ,libusb)))
+(synopsis "Programmer for STM32 Discovery boards")
+(description "This package provides a firmware programmer for the STM32
+Discovery boards.  It supports two versions of the chip: ST-LINK/V1 (on
+STM32VL discovery kits) and ST-LINK/V2 (on STM32L discovery and later kits).
+Two different transport layers are used: ST-LINK/V1 uses SCSI passthru
+commands over USB, and ST-LINK/V2 and ST-LINK/V2-1 (seen on Nucleo boards) use
+raw USB commands.")
+(home-page "https://github.com/texane/stlink;)
+;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are
+;; licensed under the GPLv2+.
+(license (list license:bsd-3 license:gpl2+



branch master updated (46f9022 -> 615a7ee)

2018-10-03 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  46f9022   gnu: Add java-commons-exec.
   new  615a7ee   gnu: Add stlink.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/embedded.scm | 39 +++
 1 file changed, 39 insertions(+)



01/01: gnu: cuirass: Update to fe2b73c.

2018-10-02 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 75bb6e46eac90c95e910986ad8ae32927e879052
Author: Clément Lassieur 
Date:   Tue Oct 2 13:19:44 2018 +0200

gnu: cuirass: Update to fe2b73c.

* gnu/packages/ci.scm (cuirass): Update to fe2b73c.
---
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index 067a288..1cac8b9 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -186,8 +186,8 @@ their dependencies.")
   (license l:gpl3+
 
 (define-public cuirass
-  (let ((commit "8d40c49170971ad7bbf8b97336934dbb3d949fc1")
-(revision "19"))
+  (let ((commit "fe2b73c2353d106431ed0659345391f14ed64600")
+(revision "20"))
 (package
   (name "cuirass")
   (version (string-append "0.0.1-" revision "." (string-take commit 7)))
@@ -199,7 +199,7 @@ their dependencies.")
 (file-name (string-append name "-" version))
 (sha256
  (base32
-  "0xxcapf9ag3zx6131v128vhin5m2j3w2gjbjbpdwr0qkaysh0gvf"
+  "00ldbig2p14qpwrl2i2hnhb9idgbbf0kqnlh4n79rmz96blm7463"
   (build-system gnu-build-system)
   (arguments
'(#:modules ((guix build utils)



branch master updated (f8e7106 -> 75bb6e4)

2018-10-02 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  f8e7106   services: Add Gitolite.
   new  75bb6e4   gnu: cuirass: Update to fe2b73c.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit 4e661552c3a0bebd9b584dcf72b9e949fb5582ef
Author: Clément Lassieur 
Date:   Sun Sep 2 09:45:48 2018 +0200

database: Add builds only if one of their outputs is new.

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-4.sql'.
* src/cuirass/database.scm (db-add-output): New procedure.
(db-add-build): Call DB-ADD-OUTPUT, rollback the transaction and return #f 
if
DB-ADD-OUTPUT returned an empty list.
* src/schema.sql (Outputs): Set 'path' as primary key, instead of 
'derivation,
name'.
* src/sql/upgrade-4.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-build): Use the #:OUTPUTS key.  Get default
OUTPUTS to depend on DRV.
("db-add-build-with-fixed-output"): New test.
---
 Makefile.am  |  3 ++-
 src/cuirass/database.scm | 46 ++
 src/schema.sql   |  3 +--
 src/sql/upgrade-4.sql| 18 ++
 tests/database.scm   | 16 ++--
 5 files changed, 69 insertions(+), 17 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2f83659..7cea2ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,7 +67,8 @@ dist_pkgdata_DATA = src/schema.sql
 dist_sql_DATA =\
   src/sql/upgrade-1.sql\
   src/sql/upgrade-2.sql\
-  src/sql/upgrade-3.sql
+  src/sql/upgrade-3.sql\
+  src/sql/upgrade-4.sql
 
 dist_css_DATA =\
   src/static/css/bootstrap.css \
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 6777d28..9664f1b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -425,12 +425,33 @@ string."
   (failed-other  3)
   (canceled  4))
 
+(define (db-add-output derivation output)
+  "Insert OUTPUT associated with DERIVATION.  If an output with the same path
+already exists, return #f."
+  (with-db-critical-section db
+(catch 'sqlite-error
+  (lambda ()
+(match output
+  ((name . path)
+   (sqlite-exec db "\
+INSERT INTO Outputs (derivation, name, path) VALUES ("
+derivation ", " name ", " path ");")))
+(last-insert-rowid db))
+  (lambda (key who code message . rest)
+;; If we get a unique-constraint-failed error, that means we have
+;; already inserted the same output.  That happens with fixed-output
+;; derivations.
+(if (= code SQLITE_CONSTRAINT_PRIMARYKEY)
+#f
+(apply throw key who code rest))
+
 (define (db-add-build build)
-  "Store BUILD in database the database.  BUILD eventual outputs are stored in
-the OUTPUTS table."
+  "Store BUILD in database the database only if one of its outputs is new.
+Return #f otherwise.  BUILD outputs are stored in the OUTPUTS table."
   (with-db-critical-section db
 (catch 'sqlite-error
   (lambda ()
+(sqlite-exec db "BEGIN TRANSACTION;")
 (sqlite-exec db "
 INSERT INTO Builds (derivation, evaluation, job_name, system, nix_name, log,
 status, timestamp, starttime, stoptime)
@@ -446,21 +467,22 @@ VALUES ("
  (or (assq-ref build #:timestamp) 0) ", "
  (or (assq-ref build #:starttime) 0) ", "
  (or (assq-ref build #:stoptime) 0) ");")
-(let ((derivation (assq-ref build #:derivation)))
-  (for-each (lambda (output)
-  (match output
-((name . path)
- (sqlite-exec db "\
-INSERT INTO Outputs (derivation, name, path) VALUES ("
-  derivation ", " name ", " path ");"
-(assq-ref build #:outputs))
-  derivation))
+(let* ((derivation (assq-ref build #:derivation))
+   (outputs (assq-ref build #:outputs))
+   (new-outputs (filter-map (cut db-add-output derivation <>)
+outputs)))
+  (if (null? new-outputs)
+  (begin (sqlite-exec db "ROLLBACK;")
+ #f)
+  (begin (sqlite-exec db "COMMIT;")
+ derivation
   (lambda (key who code message . rest)
 ;; If we get a unique-constraint-failed error, that means we have
 ;; already inserted the same build.  That happens when several jobs
 ;; produce the same derivation, and we can ignore it.
 (if (= code SQLITE_CONSTRAINT_PRIMARYKEY)
-#f
+(begin (sqlite-exec db "ROLLBACK;")
+   #f)
 (apply throw key who code rest))
 
 (define* (db-update-build-status! drv status #:key log-file)
diff --git a/src/schema.sql b/src/schema.sql
index bfc9ca7..a9e4a6a 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -46,8 +46,7 @@ CREATE TABLE Evaluations (
 CREATE TABLE 

[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit 3b08d6ea9872e0649ccc5805538c6f9425a55f9a
Author: TSholokhova 
Date:   Sun Aug 5 19:15:57 2018 +0200

templates: Add build log links.

* src/cuirass/templates.scm (build-eval-table): Add build log links to the
table.
---
 src/cuirass/templates.scm | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 31c6081..3017880 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -173,7 +173,8 @@ and BUILD-MAX are global minimal and maximal (stoptime, 
rowid) pairs."
(th (@ (scope "col")) "Finished at")
(th (@ (scope "col")) Job)
(th (@ (scope "col")) Nixname)
-   (th (@ (scope "col")) System
+   (th (@ (scope "col")) System)
+   (th (@ (scope "col")) Log
 
   (define (table-row build)
 `(tr
@@ -195,7 +196,9 @@ and BUILD-MAX are global minimal and maximal (stoptime, 
rowid) pairs."
   (td ,(strftime "%c" (localtime (assq-ref build #:stoptime
   (td ,(assq-ref build #:job))
   (td ,(assq-ref build #:nixname))
-  (td ,(assq-ref build #:system
+  (td ,(assq-ref build #:system))
+  (td (a (@ (href "/build/" ,(assq-ref build #:id) "/log/raw"))
+ raw
 
   (define (build-id build)
 (match build



master updated (8d40c49 -> fe2b73c)

2018-10-02 Thread Clment Lassieur
snape pushed a change to branch master.

  from  8d40c49   database: Add a Checkouts table.
   new  4e66155   database: Add builds only if one of their outputs is new.
   new  f51bd3f   templates: Allow to filter builds by status.
   new  3b08d6e   templates: Add build log links.
   new  cbf8e13   templates: Add a navigation bar.
   new  bccb268   templates: Add title to the evaluations table.
   new  fe2b73c   database: Return #f when one row is expected and there is 
none.


Summary of changes:
 Makefile.am   |   3 +-
 src/cuirass/database.scm  | 115 +-
 src/cuirass/http.scm  |  88 ++-
 src/cuirass/templates.scm |  89 +--
 src/schema.sql|   3 +-
 src/sql/upgrade-4.sql |  18 
 tests/database.scm|  16 ++-
 7 files changed, 239 insertions(+), 93 deletions(-)
 create mode 100644 src/sql/upgrade-4.sql



[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit cbf8e138354ab24b597e16b1a10d9d472d63bc53
Author: TSholokhova 
Date:   Sun Aug 5 21:25:37 2018 +0200

templates: Add a navigation bar.

* src/cuirass/database.scm (db-get-evaluation-specification): New exported
procedure.
* src/cuirass/http.scm (respond-html): Allow to pass CODE as argument.
(respond-html-eval-not-found): New procedure.
(url-handler): Fill navigation arguments.  Handle the case where the
evaluation doesn't exist.
* src/cuirass/templates.scm (navigation-items): New procedure.
(html-page): Add navigation bar.

Co-authored-by: Clément Lassieur 
---
 src/cuirass/database.scm  | 11 ++
 src/cuirass/http.scm  | 90 +--
 src/cuirass/templates.scm | 28 ---
 3 files changed, 91 insertions(+), 38 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index e17d4f0..e949d1b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -53,6 +53,7 @@
 db-get-evaluations-build-summary
 db-get-evaluations-id-min
 db-get-evaluations-id-max
+db-get-evaluation-specification
 read-sql-file
 read-quoted-string
 sqlite-exec
@@ -751,3 +752,13 @@ AND (" status " IS NULL OR (" status " = 'pending'
 OR (" status " = 'failed'
 AND Builds.status > 0")))
   (vector->list (car rows)
+
+(define (db-get-evaluation-specification eval)
+  "Return specification of evaluation with id EVAL."
+  (with-db-critical-section db
+(let ((rows (sqlite-exec db "
+SELECT specification FROM Evaluations
+WHERE id = " eval)))
+  (match rows
+((row) (vector-ref row 0))
+(() #f)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 7878452..62294d3 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -167,15 +167,19 @@ Hydra format."
  (object->json-string
   `((error . ,message)
 
-  (define (respond-html body)
-(respond '((content-type . (application/xhtml+xml)))
- #:body
- (lambda (port)
-   (format
-port ""
-"-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;)
-   (sxml->xml body port
+  (define* (respond-html body #:key code)
+(respond
+ (let ((content-type '((content-type . (application/xhtml+xml)
+   (if code
+   (build-response #:headers content-type #:code code)
+   content-type))
+ #:body
+ (lambda (port)
+   (format
+port ""
+"-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;)
+   (sxml->xml body port
 
   (define (respond-static-file path)
 ;; PATH is a list of path components
@@ -194,6 +198,13 @@ Hydra format."
  404
  (format #f "Build with ID ~a doesn't exist." build-id)))
 
+  (define (respond-html-eval-not-found eval-id)
+(respond-html
+ (html-page "Page not found"
+(format #f "Evaluation with ID ~a doesn't exist." eval-id)
+'())
+ #:code 404))
+
   (define (respond-build-log-not-found build)
 (let ((drv (assq-ref build #:derivation)))
   (respond-json-with-error
@@ -275,7 +286,8 @@ Hydra format."
 ('()
  (respond-html (html-page
 "Cuirass"
-(specifications-table (db-get-specifications)
+(specifications-table (db-get-specifications))
+'(
 
 (("jobset" name)
  (respond-html
@@ -291,32 +303,42 @@ Hydra format."
 (html-page name (evaluation-info-table name
evaluations
evaluation-id-min
-   evaluation-id-max)
+   evaluation-id-max)
+   `(((#:name . ,name)
+  (#:link . ,(string-append "/jobset/" name
 
 (("eval" id)
- (respond-html
-  (let* ((params (request-parameters request))
- (status (assq-ref params 'status))
- (builds-id-max (db-get-builds-max id status))
- (builds-id-min (db-get-builds-min id status))
- (border-high-time (assq-ref params 'border-high-time))
- (border-low-time (assq-ref params 'border-low-time))
- (border-high-id (assq-ref params 'border-high-id))
- (border-low-id (assq-ref params 'border-low-id)))
-(html-page
- "Evaluation"
- (build-eval-table
-  (handle-builds-request `((evaluation . ,id)
-   (status . ,(and=> status string->symbol))
-   (nr . ,%page-size)
-  

[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit fe2b73c2353d106431ed0659345391f14ed64600
Author: Clément Lassieur 
Date:   Sun Sep 30 17:26:12 2018 +0200

database: Return #f when one row is expected and there is none.

* src/cuirass/database.scm (expect-one-row): New procedure.
(db-get-build, db-get-evaluations-id-min, db-get-evaluations-id-max,
db-get-builds-min, db-get-builds-max, db-get-evaluation-specification): Use
it.
---
 src/cuirass/database.scm | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index e949d1b..25058b7 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -251,6 +251,13 @@ database object."
   (vector-ref (car (sqlite-exec db "SELECT last_insert_rowid();"))
   0))
 
+(define (expect-one-row rows)
+  "Several SQL queries expect one result, or zero if not found.  This gets rid
+of the list, and returns #f when there is no result."
+  (match rows
+((row) row)
+(() #f)))
+
 (define (db-add-input spec-name input)
   (with-db-critical-section db
 (sqlite-exec db "\
@@ -621,10 +628,7 @@ ORDER BY ~a, rowid ASC;" order))
   "Retrieve a build in the database which corresponds to DERIVATION-OR-ID."
   (with-db-critical-section db
 (let ((key (if (number? derivation-or-id) 'id 'derivation)))
-  (match (db-get-builds `((,key . ,derivation-or-id)))
-((build)
- build)
-(() #f)
+  (expect-one-row (db-get-builds `((,key . ,derivation-or-id)))
 
 (define (db-get-pending-derivations)
   "Return the list of derivation file names corresponding to pending builds in
@@ -705,7 +709,7 @@ ORDER BY E.id ASC;"))
 (let ((rows (sqlite-exec db "
 SELECT MIN(id) FROM Evaluations
 WHERE specification=" spec)))
-  (vector-ref (car rows) 0
+  (and=> (expect-one-row rows) (cut vector-ref <> 0)
 
 (define (db-get-evaluations-id-max spec)
   "Return the max id of evaluations for the given specification SPEC."
@@ -713,7 +717,7 @@ WHERE specification=" spec)))
 (let ((rows (sqlite-exec db "
 SELECT MAX(id) FROM Evaluations
 WHERE specification=" spec)))
-  (vector-ref (car rows) 0
+  (and=> (expect-one-row rows) (cut vector-ref <> 0)
 
 (define (db-get-builds-min eval status)
   "Return the min build (stoptime, rowid) pair for the given evaluation EVAL
@@ -732,7 +736,7 @@ AND (" status " IS NULL OR (" status " = 'pending'
 AND Builds.status = 0)
 OR (" status " = 'failed'
 AND Builds.status > 0")))
-  (vector->list (car rows)
+  (and=> (expect-one-row rows) vector->list
 
 (define (db-get-builds-max eval status)
   "Return the max build (stoptime, rowid) pair for the given evaluation EVAL
@@ -751,7 +755,7 @@ AND (" status " IS NULL OR (" status " = 'pending'
 AND Builds.status = 0)
 OR (" status " = 'failed'
 AND Builds.status > 0")))
-  (vector->list (car rows)
+  (and=> (expect-one-row rows) vector->list
 
 (define (db-get-evaluation-specification eval)
   "Return specification of evaluation with id EVAL."
@@ -759,6 +763,4 @@ AND (" status " IS NULL OR (" status " = 'pending'
 (let ((rows (sqlite-exec db "
 SELECT specification FROM Evaluations
 WHERE id = " eval)))
-  (match rows
-((row) (vector-ref row 0))
-(() #f)
+  (and=> (expect-one-row rows) (cut vector-ref <> 0)



[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit bccb268f80b39ccdadecb07b3d1bf26b2e1ec1a0
Author: TSholokhova 
Date:   Sun Sep 30 01:06:39 2018 +0200

templates: Add title to the evaluations table.

* src/cuirass/http.scm (url-handler): Pass the ID argument to
BUILD-EVAL-TABLE.
* src/cuirass/templates.scm (build-eval-table): Add an EVAL-ID argument, add
title.
---
 src/cuirass/http.scm  | 1 +
 src/cuirass/templates.scm | 9 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 62294d3..bf171ee 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -322,6 +322,7 @@ Hydra format."
 (html-page
  "Evaluation"
  (build-eval-table
+  id
   (handle-builds-request
`((evaluation . ,id)
  (status . ,(and=> status string->symbol))
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index fda3b48..d4968d7 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -181,7 +181,7 @@
 (format #f "?border-high=~d" page-id-min))
 (format #f "?border-low=~d" (1- id-min)))
 
-(define (build-eval-table builds build-min build-max status)
+(define (build-eval-table eval-id builds build-min build-max status)
   "Return HTML for the BUILDS table evaluation with given STATUS.  BUILD-MIN
 and BUILD-MAX are global minimal and maximal (stoptime, rowid) pairs."
   (define (table-header)
@@ -228,7 +228,12 @@ and BUILD-MAX are global minimal and maximal (stoptime, 
rowid) pairs."
 (match build
   ((stoptime id) stoptime)))
 
-  `((table
+  `((p (@ (class "lead"))
+   ,(format #f "~@[~a~] ~:[B~;b~]uilds of evaluation #~a"
+(and=> status string-capitalize)
+status
+eval-id))
+(table
  (@ (class "table table-sm table-hover table-striped"))
  ,@(if (null? builds)
`((th (@ (scope "col")) "No elements here."))



[no subject]

2018-10-02 Thread Clment Lassieur
branch: master
commit f51bd3f55427d65d7d28260ceb05b889a657e0ab
Author: TSholokhova 
Date:   Sun Aug 5 16:55:16 2018 +0200

templates: Allow to filter builds by status.

* src/cuirass/database.scm (db-get-builds): Add 'succeeded' and 'failed'
status filters.
(db-get-builds-min, db-get-builds-max): Add support for a new 'status'
argument.
* src/cuirass/http.scm (url-handler): Add a status argument for the 
'/eval/id'
endpoint.
* src/cuirass/templates.scm (evaluation-badges): Add links to the buttons.
(build-eval-table): Add a 'status' argument.

Co-authored-by: Clément Lassieur 
---
 src/cuirass/database.scm  | 38 +++---
 src/cuirass/http.scm  | 11 +++
 src/cuirass/templates.scm | 47 +--
 3 files changed, 63 insertions(+), 33 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 9664f1b..e17d4f0 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -559,7 +559,9 @@ AND (:job IS NULL OR (:job = Builds.job_name))
 AND (:system IS NULL OR (:system = Builds.system))
 AND (:evaluation IS NULL OR (:evaluation = Builds.evaluation))
 AND (:status IS NULL OR (:status = 'done' AND Builds.status >= 0)
- OR (:status = 'pending' AND Builds.status < 0))
+ OR (:status = 'pending' AND Builds.status < 0)
+ OR (:status = 'succeeded' AND Builds.status = 0)
+ OR (:status = 'failed' AND Builds.status > 0))
 AND (:borderlowtime IS NULL OR :borderlowid IS NULL
  OR ((:borderlowtime, :borderlowid) < (Builds.stoptime, Builds.rowid)))
 AND (:borderhightime IS NULL OR :borderhighid IS NULL
@@ -712,26 +714,40 @@ SELECT MAX(id) FROM Evaluations
 WHERE specification=" spec)))
   (vector-ref (car rows) 0
 
-(define (db-get-builds-min eval)
-  "Return the min build (stoptime, id) pair for
-   the given evaluation EVAL."
+(define (db-get-builds-min eval status)
+  "Return the min build (stoptime, rowid) pair for the given evaluation EVAL
+and STATUS."
   (with-db-critical-section db
 (let ((rows (sqlite-exec db "
 SELECT stoptime, MIN(rowid) FROM
 (SELECT rowid, stoptime FROM Builds
-WHERE evaluation=" eval " AND
-stoptime = (SELECT MIN(stoptime)
-FROM Builds WHERE evaluation=" eval "))")))
+WHERE evaluation=" eval "
+AND stoptime = (SELECT MIN(stoptime)
+FROM Builds
+WHERE evaluation = " eval "
+AND (" status " IS NULL OR (" status " = 'pending'
+AND Builds.status < 0)
+OR (" status " = 'succeeded'
+AND Builds.status = 0)
+OR (" status " = 'failed'
+AND Builds.status > 0")))
   (vector->list (car rows)
 
-(define (db-get-builds-max eval)
-  "Return the max build (stoptime, id) pair for
-   the given evaluation EVAL."
+(define (db-get-builds-max eval status)
+  "Return the max build (stoptime, rowid) pair for the given evaluation EVAL
+and STATUS."
   (with-db-critical-section db
 (let ((rows (sqlite-exec db "
 SELECT stoptime, MAX(rowid) FROM
 (SELECT rowid, stoptime FROM Builds
 WHERE evaluation=" eval " AND
 stoptime = (SELECT MAX(stoptime)
-FROM Builds WHERE evaluation=" eval "))")))
+FROM Builds
+WHERE evaluation = " eval "
+AND (" status " IS NULL OR (" status " = 'pending'
+AND Builds.status < 0)
+OR (" status " = 'succeeded'
+AND Builds.status = 0)
+OR (" status " = 'failed'
+AND Builds.status > 0")))
   (vector->list (car rows)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index d70517b..7878452 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -295,9 +295,10 @@ Hydra format."
 
 (("eval" id)
  (respond-html
-  (let* ((builds-id-max (db-get-builds-max id))
- (builds-id-min (db-get-builds-min id))
- (params (request-parameters request))
+  (let* ((params (request-parameters request))
+ (status (assq-ref params 'status))
+ (builds-id-max (db-get-builds-max id status))
+ (builds-id-min (db-get-builds-min id status))
  (border-high-time (assq-ref params 'border-high-time))
  (border-low-time (assq-ref params 'border-low-time))
  (border-high-id (assq-ref params 'border-high-id))
@@ -306,6 +307,7 @@ Hydra format."
  "Evaluation"
  (build-eval-table
   (handle-builds-request `((evaluation . ,id)
+   (status . ,(and=> status string->symbol))
(nr . ,%page-size)
(order . finish-time+build-id)
(border-high-time . ,border-high-time)
@@ -313,7 +315,8 @@ Hydra format."
  

branch master updated (03c95f0 -> 6ffffb3)

2018-09-14 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  03c95f0   gnu: Add r-abps.
   new  6b3   hydra: Remove useless 'parameterize'.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-aux/hydra/gnu-system.scm | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)



01/01: hydra: Remove useless 'parameterize'.

2018-09-14 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 6b3c96779cdbec692e3d8e20281f258d660f
Author: Clément Lassieur 
Date:   Thu Sep 13 17:55:31 2018 +0200

hydra: Remove useless 'parameterize'.

* build-aux/hydra/gnu-system.scm (manifests->packages): Remove 
'parameterize'.
---
 build-aux/hydra/gnu-system.scm | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index 7234e2d..d6b0132 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -330,12 +330,11 @@ valid."
(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)
+  (delete-duplicates!
+   (map manifest-entry-item
+(append-map (compose manifest-entries
+ load-manifest)
+manifests
 
 
 ;;;



01/01: hydra: Add support for manifests.

2018-09-13 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 88bfabf111dfc794dc8c8f6d44d253842b39b55e
Author: Clément Lassieur 
Date:   Mon Aug 27 22:47:14 2018 +0200

hydra: Add support for manifests.

* 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 | 35 ++
 doc/guix.texi  | 56 --
 2 files changed, 73 insertions(+), 18 deletions(-)

diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index b1554ce..7234e2d 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès 

 ;;; Copyright © 2017 Jan Nieuwenhuizen 
+;;; Copyright © 2018 Clément Lassieur 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -56,6 +57,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 +313,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)
+
 
 ;;;
 ;;; Hydra entry point.
@@ -323,6 +349,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 +446,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 19a497c..cccf166 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18165,23 +18165,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 

branch master updated (73dc783 -> 88bfabf)

2018-09-13 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  73dc783   gnu: rust@1.20.0: Replace "default-ar" by "ar".
   new  88bfabf   hydra: Add support for manifests.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-aux/hydra/gnu-system.scm | 35 ++
 doc/guix.texi  | 56 --
 2 files changed, 73 insertions(+), 18 deletions(-)



01/01: services: nginx: Get the Shepherd to respawn NGINX.

2018-08-31 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 9fc2922794ffaae48e0a7c536e530ea2e0d46cf3
Author: Clément Lassieur 
Date:   Mon Aug 13 21:05:55 2018 +0200

services: nginx: Get the Shepherd to respawn NGINX.

* gnu/services/web.scm (nginx-shepherd-service): Change 'start' (that is, 
all
actions that don't send a signal to the master process) to return the PID.
Wait until the PID file is created and contains an integer because it might 
be
created after the parent process exits.
---
 gnu/services/web.scm | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 9797650..4676564 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -599,19 +599,33 @@ of index files."
 
 (nginx file run-directory)
(let* ((nginx-binary (file-append nginx "/sbin/nginx"))
+  (pid-file (in-vicinity run-directory "pid"))
   (nginx-action
(lambda args
  #~(lambda _
  (invoke #$nginx-binary "-c"
  #$(or file
(default-nginx-config config))
- #$@args)
+ #$@args)
+ (match '#$args
+   (("-s" . _) #t)
+   (_
+(let loop ((duration 0))
+  ;; 
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864/comments/7
+  (sleep duration)
+  (if (file-exists? #$pid-file)
+  (let ((pid (call-with-input-file #$pid-file read)))
+;; it could be #
+(if (integer? pid) pid (loop 1)))
+  (loop 1)
 
  ;; TODO: Add 'reload' action.
  (list (shepherd-service
 (provision '(nginx))
 (documentation "Run the nginx daemon.")
 (requirement '(user-processes loopback))
+(modules `((ice-9 match)
+   ,@%default-modules))
 (start (nginx-action "-p" run-directory))
 (stop (nginx-action "-s" "stop")))
 



branch master updated (0b6678c -> 9fc2922)

2018-08-31 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  0b6678c   gnu: retroarch: Update to 1.7.4.
   new  9fc2922   services: nginx: Get the Shepherd to respawn NGINX.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/services/web.scm | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)



branch master updated (4715f92 -> a30cbd5)

2018-08-27 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  4715f92   Update email for Pierre Neidhardt.
   new  a30cbd5   gnu: cuirass: Update to 8d40c49.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



01/01: gnu: cuirass: Update to 8d40c49.

2018-08-27 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit a30cbd5dfb57681bf381ead54263def2d0236536
Author: Clément Lassieur 
Date:   Mon Aug 27 16:06:51 2018 +0200

gnu: cuirass: Update to 8d40c49.

* gnu/packages/ci.scm (cuirass): Update to 8d40c49.
---
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index 599fd8c..e26983d 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -185,8 +185,8 @@ their dependencies.")
   (license l:gpl3+
 
 (define-public cuirass
-  (let ((commit "4db99f647b3677086a2007763726d05a59b0cdcb")
-(revision "18"))
+  (let ((commit "8d40c49170971ad7bbf8b97336934dbb3d949fc1")
+(revision "19"))
 (package
   (name "cuirass")
   (version (string-append "0.0.1-" revision "." (string-take commit 7)))
@@ -198,7 +198,7 @@ their dependencies.")
 (file-name (string-append name "-" version))
 (sha256
  (base32
-  "1lg3w0xjg6b806y8gfxj2dq1g0djm5pyk886j8g7n5n9ljlhjzxj"
+  "0xxcapf9ag3zx6131v128vhin5m2j3w2gjbjbpdwr0qkaysh0gvf"
   (build-system gnu-build-system)
   (arguments
'(#:modules ((guix build utils)



[no subject]

2018-08-27 Thread Clment Lassieur
branch: master
commit 4612a3a70f1e70afa4e0ce00e8cb1a7848dddf58
Author: Clément Lassieur 
Date:   Sun Aug 5 13:14:44 2018 +0200

database: Serialize all database accesses in a thread.

Fixes .

* bin/cuirass.in (main): Keep only one WITH-DATABASE call around all fibers.
Remove all DB arguments.
* src/cuirass/base.scm (evaluate, update-build-statuses!, spawn-builds,
handle-build-event, build-packages): Remove all DB arguments.
(clear-build-queue, cancel-old-builds): Wrap in WITH-DB-CRITICAL-SECTION,
remove all DB arguments.
(restart-builds): Remove the NON-BLOCKING call, remove all DB arguments.
(process-specs): Remove all DB arguments, remove the WITH-DATABASE call.
* src/cuirass/database.scm (%db-channel): New parameter.
(with-db-critical-section): New macro.
(db-add-input, db-add-specification, db-get-inputs, db-get-specifications,
db-add-evaluation, db-add-build, db-update-build-status!, db-get-outputs,
db-get-builds, db-get-build, db-get-pending-derivations, db-get-stamp,
db-add-stamp, db-get-evaluations, db-get-evaluations-build-summary,
db-get-evaluations-id-min, db-get-evaluations-id-max, db-get-builds-min,
db-get-builds-max): Wrap in WITH-DB-CRITICAL-SECTION, remove all DB 
arguments.
(with-database): Wrap BODY in PARAMETERIZE form that sets %DB-CHANNEL to the
channel returned by MAKE-CRITICAL-SECTION.
* src/cuirass/http.scm (handle-build-request, handle-builds-request): Remove
all DB arguments.
(url-handler): Remove all DB arguments, remove the DB-CHANNEL state, remove
the WITH-CRITICAL-SECTION calls.
(run-cuirass-server): Remove the DB arguments, remove the
MAKE-CRITICAL-SECTION call.
* src/cuirass/utils.scm (make-critical-section): Replace SPAWN-FIBER with
CALL-WITH-NEW-THREAD.  Wrap body in PARAMETERIZE form that clears
CURRENT-FIBER.
* tests/database.scm (with-temporary-database, "db-add-specification",
"db-add-build", "db-update-build-status!", "db-get-builds",
"db-get-pending-derivations"): Remove the DB arguments.
("db-init"): Set the %DB-CHANNEL parameter to the channel returned by
MAKE-CRITICAL-SECTION, and return #t.
("database"): Set %DB-CHANNEL to #f during cleanup.
* tests/http.scm ("db-init"): Set the %DB-CHANNEL parameter to the channel
returned by MAKE-CRITICAL-SECTION, and return #t.
("cuirass-run", "fill-db"): Remove the DB arguments.
("http"): Set %DB-CHANNEL to #f during cleanup.
---
 .dir-locals.el   |   3 +-
 bin/cuirass.in   |  23 +-
 src/cuirass/base.scm |  94 
 src/cuirass/database.scm | 545 +--
 src/cuirass/http.scm | 136 +---
 src/cuirass/utils.scm|  23 +-
 tests/database.scm   | 103 -
 tests/http.scm   |  21 +-
 8 files changed, 491 insertions(+), 457 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 9a065ae..465aa58 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -12,7 +12,8 @@
   (eval put 'call-with-time 'scheme-indent-function 1)
   (eval put 'test-error 'scheme-indent-function 1)
   (eval put 'make-parameter 'scheme-indent-function 1)
-  (eval put 'with-database 'scheme-indent-function 1)
+  (eval put 'with-database 'scheme-indent-function 0)
+  (eval put 'with-db-critical-section 'scheme-indent-function 1)
   (eval . (put 'with-critical-section 'scheme-indent-function 2)))
  (texinfo-mode
   (indent-tabs-mode)
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 11eb975..d30f788 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -115,19 +115,19 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" 
"$@"
   (log-message "running Fibers on ~a kernel threads" threads)
   (run-fibers
(lambda ()
- (with-database db
+ (with-database
(and specfile
 (let ((new-specs (save-module-excursion
   (lambda ()
 (set-current-module (make-user-module 
'()))
 (primitive-load specfile)
-  (for-each (lambda (spec) (db-add-specification db spec))
+  (for-each (lambda (spec) (db-add-specification spec))
 new-specs)))
(if one-shot?
-   (process-specs db (db-get-specifications db))
+   (process-specs (db-get-specifications))
(let ((exit-channel (make-channel)))
 
- (clear-build-queue db)
+ (clear-build-queue)
 
  ;; First off, restart builds that had not completed or
  ;; were not even started on a previous run.
@@ -135,25 +135,22 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" 
"$@"
   (essential-task
  

[no subject]

2018-08-27 Thread Clment Lassieur
branch: master
commit 8d40c49170971ad7bbf8b97336934dbb3d949fc1
Author: Clément Lassieur 
Date:   Sat Aug 11 20:30:11 2018 +0200

database: Add a Checkouts table.

It is used to know when a new evaluation must be triggered and to display
input changes.

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-3.sql'.
* bin/cuirass.in (main): Call DB-SET-EVALUATION-DONE at startup to clear
'in-progress' evaluations.
* bin/evaluate.in (input-checkout, format-checkouts): Rename '#:name' to
'#:input'.
* doc/cuirass.texi (Stamps): Remove section.
(Checkouts): New section.
* src/cuirass/base.scm (fetch-input, fetch-inputs, compile-checkouts): 
Rename
'#:name' to '#:input'.
(evaluate): Remove the COMMITS argument.  Add an EVAL-ID argument.  Don't 
call
DB-ADD-EVALUATION because it was called sooner.  Remove the EVAL-ID argument
to AUGMENT-JOB because it's a closure.
(build-packages): Add an EVAL-ID argument.  Call DB-SET-EVALUATION-DONE once
all the derivations are registered.
(process-specs): Replace the stamping mechanism by the primary key 
constraint
of the Checkouts table: call "evaluate" only when DB-ADD-EVALUATION is true,
which means that at least one checkout was added.  Change the EVALUATE and
BUILD-PACKAGES arguments accordingly.
* src/cuirass/database.scm (db-add-stamp, db-get-stamp): Remove procedures.
(db-set-evaluations-done, db-set-evaluation-done): New exported procedure.
(db-add-checkout): New procedure that returns #f if a checkout with the same
revision already exists.
(db-add-evaluation): Replace the EVAL argument with a SPEC-NAME and a
CHECKOUTS arguments.  Insert the evaluation only if at least one checkout 
was
inserted.  Return #f otherwise.
(db-get-checkouts): New procedure.
(db-get-evaluations, db-get-evaluations-build-summary): Handle the
'in_progress' column, remove the 'commits' column.  Return the result of
DB-GET-CHECKOUTS as part of the evaluation.
* src/cuirass/templates.scm (input-changes, evaluation-badges): New
procedures.
(evaluation-info-table): Rename "Commits" to "Input changes".  Use
INPUT-CHANGES to display the input changes that triggered the evaluation.  
Use
EVALUATION-BADGES to display a message indicating that the evaluation is in
progress.
* src/schema.sql (Stamps): Remove table.
(Checkouts): New table.
(Evaluations): Remove the 'commits' column.  Add an 'in_progress' column.
* src/sql/upgrade-3.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-eval): Remove procedure.
(make-dummy-checkouts): New procedure.
("sqlite-exec"): Remove the 'commits' column.  Add the 'in_progress' column.
("db-update-build-status!", "db-get-builds", "db-get-pending-derivations"):
Update the arguments of DB-ADD-EVALUATION accordingly.
* tests/http.scm (hash-table=?): Add support for lists of hash tables.
(evaluations-query-result): Replace '#:commits' with '#:checkouts'.  Return 
a
list instead of returning one element, for symmetry.
("fill-db"): Add a new input so that the second checkout can refer to it.
Replace EVALUATION1 and EVALUATION2 with CHECKOUTS1 and CHECKOUTS2.  Update
the arguments of DB-ADD-EVALUATION accordingly.
("/api/queue?nr=100"): Take the CAR of the EVALUATIONS-QUERY-RESULT list to
make it symmetrical with the other argument of HASH-TABLE=?.
---
 Makefile.am   |   3 +-
 bin/cuirass.in|   6 +++
 bin/evaluate.in   |   4 +-
 doc/cuirass.texi  |  33 +++
 src/cuirass/base.scm  |  49 ++
 src/cuirass/database.scm  | 105 --
 src/cuirass/templates.scm |  35 +++-
 src/schema.sql|  16 ---
 src/sql/upgrade-3.sql |  46 
 tests/database.scm|  31 --
 tests/http.scm|  55 
 11 files changed, 266 insertions(+), 117 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index db56165..2f83659 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,7 +66,8 @@ dist_pkgdata_DATA = src/schema.sql
 
 dist_sql_DATA =\
   src/sql/upgrade-1.sql\
-  src/sql/upgrade-2.sql
+  src/sql/upgrade-2.sql\
+  src/sql/upgrade-3.sql
 
 dist_css_DATA =\
   src/static/css/bootstrap.css \
diff --git a/bin/cuirass.in b/bin/cuirass.in
index d30f788..a7af5b2 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -129,6 +129,12 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" 
"$@"
 
  (clear-build-queue)
 
+ ;; If Cuirass was stopped during an evaluation, consider
+ ;; it done.  Builds that were not registered during this
+  

master updated (4db99f6 -> 8d40c49)

2018-08-27 Thread Clment Lassieur
snape pushed a change to branch master.

  from  4db99f6   database: Merge Derivations into Builds table.
   new  e66e545   utils: Avoid deadlock when WITH-CRITICAL-SECTION calls 
are nested.
   new  4612a3a   database: Serialize all database accesses in a thread.
   new  8d40c49   database: Add a Checkouts table.


Summary of changes:
 .dir-locals.el|   3 +-
 Makefile.am   |   3 +-
 bin/cuirass.in|  29 ++-
 bin/evaluate.in   |   4 +-
 doc/cuirass.texi  |  33 ++-
 src/cuirass/base.scm  | 127 +-
 src/cuirass/database.scm  | 600 ++
 src/cuirass/http.scm  | 136 +--
 src/cuirass/templates.scm |  35 ++-
 src/cuirass/utils.scm |  38 +--
 src/schema.sql|  16 +-
 src/sql/upgrade-3.sql |  46 
 tests/database.scm| 120 +-
 tests/http.scm|  72 --
 14 files changed, 726 insertions(+), 536 deletions(-)
 create mode 100644 src/sql/upgrade-3.sql



[no subject]

2018-08-27 Thread Clment Lassieur
branch: master
commit e66e545b69c3adfba6fd1adb0f018f85ceed495f
Author: Clément Lassieur 
Date:   Sun Aug 5 21:10:07 2018 +0200

utils: Avoid deadlock when WITH-CRITICAL-SECTION calls are nested.

* src/cuirass/utils.scm (%critical-section-args): New parameter.
(make-critical-section): Put ARGS into a parameter, so that
CALL-WITH-CRITICAL-SECTION knows when it's called from the critical section.
In that case it would just apply PROC to ARGS.
(call-with-critical-section): If already in the critical section, apply PROC
to %CRITICAL-SECTION-ARGS instead of sending the message through the 
critical
section channel.
---
 src/cuirass/utils.scm | 27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index 9e9ac36..6083890 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -94,6 +94,9 @@ delimited continuations and fibers."
 (conclusion)
 (apply throw args)
 
+(define %critical-section-args
+  (make-parameter #f))
+
 (define (make-critical-section . args)
   "Return a channel used to implement a critical section.  That channel can
 then be passed to 'join-critical-section', which will ensure sequential
@@ -104,19 +107,23 @@ dedicated fiber."
   (let ((channel (make-channel)))
 (spawn-fiber
  (lambda ()
-   (let loop ()
- (match (get-message channel)
-   (((? channel? reply) . (? procedure? proc))
-(put-message reply (apply proc args
- (loop
+   (parameterize ((%critical-section-args args))
+ (let loop ()
+   (match (get-message channel)
+ (((? channel? reply) . (? procedure? proc))
+  (put-message reply (apply proc args
+   (loop)
 channel))
 
 (define (call-with-critical-section channel proc)
-  "Call PROC in the critical section corresponding to CHANNEL.  Return the
-result of PROC."
-  (let ((reply (make-channel)))
-(put-message channel (cons reply proc))
-(get-message reply)))
+  "Send PROC to the critical section through CHANNEL.  Return the result of
+PROC.  If already in the critical section, call PROC immediately."
+  (let ((args (%critical-section-args)))
+(if args
+(apply proc args)
+(let ((reply (make-channel)))
+  (put-message channel (cons reply proc))
+  (get-message reply)
 
 (define-syntax-rule (with-critical-section channel (vars ...) exp ...)
   "Evaluate EXP... in the critical section corresponding to CHANNEL.



branch master updated (288c8c9 -> 41c0380)

2018-08-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  288c8c9   gnu: Add texlive-latex-ocgx2.
   new  41c0380   gnu: cuirass: Update to 4db99f6.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



01/01: gnu: cuirass: Update to 4db99f6.

2018-08-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 41c038078e795005420012c173725d06c7e23256
Author: Clément Lassieur 
Date:   Thu Aug 16 22:54:05 2018 +0200

gnu: cuirass: Update to 4db99f6.

* gnu/packages/ci.scm (cuirass): Update to 4db99f6.
---
 gnu/packages/ci.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index 05353a7..599fd8c 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -185,8 +185,8 @@ their dependencies.")
   (license l:gpl3+
 
 (define-public cuirass
-  (let ((commit "99241ef1af24cadf39e3cad39f9ff27c96b22068")
-(revision "17"))
+  (let ((commit "4db99f647b3677086a2007763726d05a59b0cdcb")
+(revision "18"))
 (package
   (name "cuirass")
   (version (string-append "0.0.1-" revision "." (string-take commit 7)))
@@ -198,7 +198,7 @@ their dependencies.")
 (file-name (string-append name "-" version))
 (sha256
  (base32
-  "1hj17s07sq6nn9wlssd4pi4hzdfyp74kyz5rqv7wr4468xh80pk7"
+  "1lg3w0xjg6b806y8gfxj2dq1g0djm5pyk886j8g7n5n9ljlhjzxj"
   (build-system gnu-build-system)
   (arguments
'(#:modules ((guix build utils)



[no subject]

2018-08-16 Thread Clment Lassieur
branch: master
commit b4d058fc8d279a92208aa46b2f8a43e35feb5369
Author: Clément Lassieur 
Date:   Sat Aug 4 15:25:55 2018 +0200

database: Fix the builds limit issue.

Fixes .

* src/cuirass/database.scm (filters->order): New procedure.
(db-get-builds): Remove FORMAT-OUTPUT, CONS-OUTPUT, COLLECT-OUTPUTS,
FINISH-GROUP, SAME-GROUP?, GROUP-OUTPUTS procedures.  Remove the 'LEFT JOIN
Outputs' clause.  Use DB-GET-OUTPUTS for each build that was fetched.
---
 src/cuirass/database.scm | 126 ++-
 1 file changed, 37 insertions(+), 89 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index e772f3d..e73b648 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -443,104 +443,33 @@ log file for DRV."
  (cons `(,name . ((#:path . ,path)))
outputs))
 
+(define (filters->order filters)
+  (match (assq 'order filters)
+(('order . 'build-id) "id ASC")
+(('order . 'decreasing-build-id) "id DESC")
+(('order . 'finish-time) "stoptime DESC")
+(('order . 'finish-time+build-id) "stoptime DESC, id DESC")
+(('order . 'start-time) "starttime DESC")
+(('order . 'submission-time) "timestamp DESC")
+;; With this order, builds in 'running' state (-1) appear
+;; before those in 'scheduled' state (-2).
+(('order . 'status+submission-time) "status DESC, timestamp DESC")
+(_ "id DESC")))
+
 (define (db-get-builds db filters)
   "Retrieve all builds in database DB which are matched by given FILTERS.
 FILTERS is an assoc list whose possible keys are 'id | 'jobset | 'job |
 'system | 'nr | 'order | 'status | 'evaluation."
-
-  (define (format-output name path)
-`(,name . ((#:path . ,path
-
-  (define (cons-output name path rest)
-"If NAME and PATH are both not #f, cons them to REST.
-Otherwise return REST unchanged."
-(if (and (not name) (not path))
-rest
-(cons (format-output name path) rest)))
-
-  (define (collect-outputs repeated-builds-id repeated-row outputs rows)
-"Given rows somewhat like
-1 'a 'b  2 'x
-^ 'c 'd  2 'x
-| ^  
-| group  - group headers
-| detail
-+ group id
-
-return rows somewhat like
-
-1 2 'x '((a b) (c d))
-
-.
-
-As a special case, if the group detail is #f #f, ignore it.
-This is made specifically to support LEFT JOINs.
-
-Assumes that if group id stays the same the group headers stay the same."
-(define (finish-group)
-  (match repeated-row
-(#(timestamp starttime stoptime log status derivation job-name system
- nix-name specification)
- `((#:id . ,repeated-builds-id)
-   (#:timestamp  . ,timestamp)
-   (#:starttime  . ,starttime)
-   (#:stoptime   . ,stoptime)
-   (#:log. ,log)
-   (#:status . ,status)
-   (#:derivation . ,derivation)
-   (#:job-name   . ,job-name)
-   (#:system . ,system)
-   (#:nix-name   . ,nix-name)
-   (#:specification . ,specification)
-   (#:outputs. ,outputs)
-
-(define (same-group? builds-id)
-  (= builds-id repeated-builds-id))
-
-(match rows
-  (() (list (finish-group)))
-  ((#((? same-group? x-builds-id) x-output-name x-output-path other-cells 
...) . rest)
-   ;; Accumulate group members of current group.
-   (let ((outputs (cons-output x-output-name x-output-path outputs)))
- (collect-outputs repeated-builds-id repeated-row outputs rest)))
-  ((#(x-builds-id x-output-name x-output-path other-cells ...) . rest)
-   (cons (finish-group)   ;finish current group
-
- ;; Start new group.
- (let* ((outputs (cons-output x-output-name x-output-path '()))
-(x-repeated-row (list->vector other-cells)))
-   (collect-outputs x-builds-id x-repeated-row outputs rest))
-
-  (define (group-outputs rows)
-(match rows
-  (() '())
-  ((#(x-builds-id x-output-name x-output-path other-cells ...) . rest)
-   (let ((x-repeated-row (list->vector other-cells)))
- (collect-outputs x-builds-id x-repeated-row '() rows)
-
-  (let* ((order (match (assq 'order filters)
-  (('order . 'build-id) "id ASC")
-  (('order . 'decreasing-build-id) "id DESC")
-  (('order . 'finish-time) "stoptime DESC")
-  (('order . 'finish-time+build-id) "stoptime DESC, id DESC")
-  (('order . 'start-time) "starttime DESC")
-  (('order . 'submission-time) "timestamp DESC")
-  (('order . 'status+submission-time)
-   ;; With this order, builds in 'running' state (-1) appear
-   ;; before those in 'scheduled' state (-2).
-   "status DESC, timestamp DESC")
-  (_ "id DESC")))
+  

master updated (31a398f -> 4db99f6)

2018-08-16 Thread Clment Lassieur
snape pushed a change to branch master.

  from  31a398f   database: Put database in /var/lib to avoid removal at 
each boot.
   new  b4d058f   database: Fix the builds limit issue.
   new  4db99f6   database: Merge Derivations into Builds table.


Summary of changes:
 Makefile.am  |   3 +-
 doc/cuirass.texi |  55 +++---
 src/cuirass/base.scm |  25 +++--
 src/cuirass/database.scm | 278 +--
 src/schema.sql   |  28 ++---
 src/sql/upgrade-2.sql|  49 +
 tests/database.scm   |  78 -
 tests/http.scm   |  20 +---
 8 files changed, 219 insertions(+), 317 deletions(-)
 create mode 100644 src/sql/upgrade-2.sql



[no subject]

2018-08-16 Thread Clment Lassieur
branch: master
commit 4db99f647b3677086a2007763726d05a59b0cdcb
Author: Clément Lassieur 
Date:   Wed Aug 1 00:03:12 2018 +0200

database: Merge Derivations into Builds table.

Fixes .

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-2.sql'.
* doc/cuirass.texi (Derivations): Remove section.
(Builds): Update accordingly.  Add columns from the Derivations table.
(Outputs): Replace 'id' with 'derivation'.
* src/cuirass/base.scm (evaluate): Don't add jobs to the Derivations table.
(build-packages): Add columns that were in the Derivations table before.  
Only
build the derivations that were successfully registered, that is, those that
didn't exist in the Builds table.  Give a derivation instead of a build id 
to
DB-GET-BUILD.  Compute the number of failed jobs based on the derivations 
that
were added to the table, instead of the jobs.
* src/cuirass/database.scm (db-add-derivation, db-get-derivation): Remove
exported procedures.
(db-add-build): Catch SQLITE_CONSTRAINT_PRIMARYKEY error, which means that 
two
jobs produced the same derivation, and return #f in that case.  Add columns
that were in the Derivations table before.  Use 'derivation' as primary key
for the Outputs table.
(db-get-outputs): Use 'derivation' as identifier, instead of 'build-id'.
(filters->order): Replace 'id' with 'rowid'.
(db-get-builds): Add a 'derivation' filter.  Replace 'id' with 'rowid'.
Remove the 'INNER JOIN Derivations'.  Replace Derivations with Builds.  
Return
'derivation' in first position to make it clear that it's the primary key.
Pass DERIVATION instead of ID to DB-GET-OUTPUTS.
(db-get-build): Allow to take a derivation as argument.  Use NUMBER? to
differentiate between derivations and ids.
(db-get-pending-derivations): Remove the 'SELECT DISTINCT' clause now that
derivations are unique.  Remove the 'INNER JOIN Builds'.
(db-get-evaluations-build-summary, db-get-builds-min, db-get-builds-max):
Replace 'id' with 'rowid'.
* src/schema.sql (Derivations): Remove table.
(Outputs): Replace Builds.id with Builds.derivation.
(Builds): Use 'derivation' as primary key.  Remove the 'id' column.  Add
'job_name', 'system', 'nix_name' columns that were in the Derivations table
before.
(Builds_Derivations_index): Rename to Builds_index.  Update accordingly.
(Derivations_index): Remove index.
* src/sql/upgrade-2.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-job, make-dummy-derivation): Remove
procedures.
(make-dummy-build): Add columns that were in MAKE-DUMMY-DERIVATION.  Get the
DRV parameter to be mandatory because it's a primary key.
(%id): Remove parameter.
("db-add-derivation", "db-get-derivation"): Remove tests.
("db-add-build"): Expect #f, because it adds twice the same derivation.  
Pass
the derivation argument to MAKE-DUMMY-BUILD.
("db-update-build-status!"): Rename 'id' to 'derivation'.  Pass the 
derivation
argument to MAKE-DUMMY-BUILD.  Remove the DB-ADD-DERIVATION call.
("db-get-builds", "db-get-pending-derivations"): Pass the derivation 
argument
to MAKE-DUMMY-BUILD.  Remove the DB-ADD-DERIVATION calls.
* tests/http.scm ("fill-db"): Remove DERIVATION1 and DERIVATION2, and put
their content in BUILD1 and BUILD2.  Remove the DB-ADD-DERIVATION calls.
---
 Makefile.am  |   3 +-
 doc/cuirass.texi |  55 +--
 src/cuirass/base.scm |  25 ---
 src/cuirass/database.scm | 174 ---
 src/schema.sql   |  28 +++-
 src/sql/upgrade-2.sql|  49 +
 tests/database.scm   |  78 +++--
 tests/http.scm   |  20 ++
 8 files changed, 193 insertions(+), 239 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ac22601..db56165 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,7 +65,8 @@ nodist_webobject_DATA =   \
 dist_pkgdata_DATA = src/schema.sql
 
 dist_sql_DATA =\
-  src/sql/upgrade-1.sql
+  src/sql/upgrade-1.sql\
+  src/sql/upgrade-2.sql
 
 dist_css_DATA =\
   src/static/css/bootstrap.css \
diff --git a/doc/cuirass.texi b/doc/cuirass.texi
index d4c6ae1..b51cfad 100644
--- a/doc/cuirass.texi
+++ b/doc/cuirass.texi
@@ -249,9 +249,8 @@ Cuirass uses a SQLite database to store information about 
jobs and past
 build results, but also to coordinate the execution of jobs.
 
 The database contains the following tables: @code{Specifications},
-@code{Inputs}, @code{Stamps}, @code{Evaluations}, @code{Derivations},
-@code{Builds} and @code{Outputs}.  The purpose of each of these tables is
-explained below.
+@code{Inputs}, @code{Stamps}, @code{Evaluations}, @code{Builds} and

01/01: services: cuirass: Put data in /var/lib to avoid removal at boot.

2018-08-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 8d4805ba2934e492524512aac8a95662f2cf97c7
Author: Clément Lassieur 
Date:   Thu Aug 16 19:07:33 2018 +0200

services: cuirass: Put data in /var/lib to avoid removal at boot.

Fixes .

* gnu/services/cuirass.scm ()[database]: Change 
default
from /var/run/cuirass/cuirass.db to /var/lib/cuirass/cuirass.db.
(cuirass-account): Change home directory from /var/run/ to
/var/lib/.
---
 gnu/services/cuirass.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 9c62080..496b2d0 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -61,7 +61,7 @@
   (interval cuirass-configuration-interval ;integer (seconds)
 (default 60))
   (database cuirass-configuration-database ;string (file-name)
-(default "/var/run/cuirass/cuirass.db"))
+(default "/var/lib/cuirass/cuirass.db"))
   (port cuirass-configuration-port ;integer (port)
 (default 8081))
   (host cuirass-configuration-host ;string
@@ -131,7 +131,7 @@
(group cuirass-group)
(system? #t)
(comment "Cuirass privilege separation user")
-   (home-directory (string-append "/var/run/" cuirass-user))
+   (home-directory (string-append "/var/lib/" cuirass-user))
(shell #~(string-append #$shadow "/sbin/nologin"))
 
 (define (cuirass-activation config)



master updated (7d7f683 -> 31a398f)

2018-08-16 Thread Clment Lassieur
snape pushed a change to branch master.

  from  7d7f683   doc: Fix database description.
   new  31a398f   database: Put database in /var/lib to avoid removal at 
each boot.


Summary of changes:
 src/cuirass/database.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



branch master updated (8f60e53 -> 8d4805b)

2018-08-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  8f60e53   gnu: python-pyxdg: Use PYPI-URI.
   new  8d4805b   services: cuirass: Put data in /var/lib to avoid removal 
at boot.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/services/cuirass.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[no subject]

2018-08-16 Thread Clment Lassieur
branch: master
commit 31a398f8a30ac35aa29c64112622e25cc4e5ce8c
Author: Clément Lassieur 
Date:   Thu Aug 16 18:13:26 2018 +0200

database: Put database in /var/lib to avoid removal at each boot.

Fixes .

* src/cuirass/database.scm (%package-database): Change default file name 
from
/var/run/cuirass/cuirass.db to /var/lib/cuirass/cuirass.db.
---
 src/cuirass/database.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 4927f2a..e772f3d 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -126,7 +126,7 @@ question marks matches the number of arguments to bind."
 
 (define %package-database
   ;; Define to the database file name of this package.
-  (make-parameter (string-append %localstatedir "/run/" %package
+  (make-parameter (string-append %localstatedir "/lib/" %package
  "/" %package ".db")))
 
 (define %package-schema-file



branch master updated (5f9a994 -> 037d185)

2018-08-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  5f9a994   gnu: vlc: Fix build with recent versions of libx264.
   new  037d185   gnu: argon2: Install pkgconfig file.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/password-utils.scm | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)



01/01: gnu: argon2: Install pkgconfig file.

2018-08-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 037d1851116fed5e9bf901abe923bff49078e2dd
Author: Amirouche 
Date:   Thu Aug 9 21:32:38 2018 +0200

gnu: argon2: Install pkgconfig file.

* gnu/packages/password-utils.scm (argon2)[arguments]: Patch libargon2.pc.
Add phase to install it.

Signed-off-by: Clément Lassieur 
---
 gnu/packages/password-utils.scm | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 06b2873..b965369 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2018 Thomas Sigurdsen 
 ;;; Copyright © 2018 Arun Isaac 
 ;;; Copyright © 2018 Pierre Neidhardt 
+;;; Copyright © 2018 Amirouche Boubekki 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -461,8 +462,18 @@ through the pass command.")
  (let ((out (assoc-ref outputs "out")))
(substitute* "Makefile"
  (("PREFIX = /usr") (string-append "PREFIX = " out)))
+   (substitute* "libargon2.pc"
+ (("prefix=/usr") (string-append "prefix=" out))
+ (("@HOST_MULTIARCH@") "")
+ (("@UPSTREAM_VER@") ,version))
#t)))
- (delete 'configure
+ (delete 'configure)
+ (add-after 'install 'install-argon2.pc
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+   (install-file "libargon2.pc"
+ (string-append out "/lib/pkgconfig"))
+   #t))
 (home-page "https://www.argon2.com/;)
 (synopsis "Password hashing library")
 (description "Argon2 provides a key derivation function that was declared



branch master updated (ff64363 -> 4ae0607)

2018-08-13 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  ff64363   gnu: BIND: Use HTTPS source URL.
   new  ef2dda8   services: postgresql: Get the Shepherd to respawn 
PostgreSQL.
   new  4ae0607   services: nginx: Use 'invoke' rather than 'system*'.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/services/databases.scm |  9 -
 gnu/services/web.scm   | 11 +--
 2 files changed, 13 insertions(+), 7 deletions(-)



01/02: services: postgresql: Get the Shepherd to respawn PostgreSQL.

2018-08-13 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit ef2dda8edb2b78cf6a2ffcdac138421b2553aec8
Author: Clément Lassieur 
Date:   Mon Aug 13 20:37:09 2018 +0200

services: postgresql: Get the Shepherd to respawn PostgreSQL.

* gnu/services/databases.scm (postgresql-shepherd-service): Change 'start' 
to
return the PID.
---
 gnu/services/databases.scm | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index 8ae248e..aff78a0 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -221,13 +221,20 @@ host  all all ::1/128 trust"))
(setuid (passwd:uid user))
(execl pg_ctl pg_ctl "-D" #$data-directory "-o" options
   mode)))
+(pid-file (in-vicinity data-directory "postmaster.pid"))
 (action (lambda args
   #~(lambda _
-  (invoke #$pg_ctl-wrapper #$@args)
+  (invoke #$pg_ctl-wrapper #$@args)
+  (match '#$args
+(("start")
+ (call-with-input-file #$pid-file read))
+(_ #t))
(list (shepherd-service
   (provision '(postgres))
   (documentation "Run the PostgreSQL daemon.")
   (requirement '(user-processes loopback syslogd))
+  (modules `((ice-9 match)
+ ,@%default-modules))
   (start (action "start"))
   (stop (action "stop"
 



02/02: services: nginx: Use 'invoke' rather than 'system*'.

2018-08-13 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 4ae0607dd88cfb36a56fa27d0e04f6e6228058e8
Author: Clément Lassieur 
Date:   Mon Aug 13 21:02:39 2018 +0200

services: nginx: Use 'invoke' rather than 'system*'.

* gnu/services/web.scm (nginx-shepherd-service): Replace SYSTEM* with 
INVOKE.
---
 gnu/services/web.scm | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 9a58eff..9797650 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2016, 2017, 2018 Julien Lepiller 
 ;;; Copyright © 2017 Christopher Baines 
 ;;; Copyright © 2017 nee 
-;;; Copyright © 2017 Clément Lassieur 
+;;; Copyright © 2017, 2018 Clément Lassieur 
 ;;; Copyright © 2018 Pierre-Antoine Rouby 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -602,11 +602,10 @@ of index files."
   (nginx-action
(lambda args
  #~(lambda _
- (zero?
-  (system* #$nginx-binary "-c"
-   #$(or file
- (default-nginx-config config))
-   #$@args))
+ (invoke #$nginx-binary "-c"
+ #$(or file
+   (default-nginx-config config))
+ #$@args)
 
  ;; TODO: Add 'reload' action.
  (list (shepherd-service



02/02: services: prosody: Get the Shepherd to respawn Prosody.

2018-08-13 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit fdbca05d78d091bfc075e54c9fb90125262eadf0
Author: Clément Lassieur 
Date:   Mon Aug 13 17:35:24 2018 +0200

services: prosody: Get the Shepherd to respawn Prosody.

* gnu/services/messaging.scm (prosody-shepherd-service): Return the PID when
the action is "start".
---
 gnu/services/messaging.scm | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 6d3a580..1108006 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -632,13 +632,20 @@ See also @url{https://prosody.im/doc/modules/mod_muc}.;
   (opaque-prosody-configuration-prosody config)
   (prosody-configuration-prosody config)))
  (prosodyctl-bin (file-append prosody "/bin/prosodyctl"))
+ (pid-file (prosody-configuration-pidfile config))
  (prosodyctl-action (lambda args
   #~(lambda _
-  (invoke #$prosodyctl-bin #$@args)
+  (invoke #$prosodyctl-bin #$@args)
+  (match '#$args
+(("start")
+ (call-with-input-file #$pid-file read))
+(_ #t))
 (list (shepherd-service
(documentation "Run the Prosody XMPP server")
(provision '(prosody xmpp-daemon))
(requirement '(networking syslogd user-processes))
+   (modules `((ice-9 match)
+  ,@%default-modules))
(start (prosodyctl-action "start"))
(stop (prosodyctl-action "stop"))
 



01/02: services: prosody: Use 'invoke' rather than 'system*'.

2018-08-13 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 2ded865665850d9f257ee62a995658c1381a8f4a
Author: Clément Lassieur 
Date:   Mon Aug 13 17:36:05 2018 +0200

services: prosody: Use 'invoke' rather than 'system*'.

* gnu/services/messaging.scm (prosody-shepherd-service): Replace SYSTEM* 
with
INVOKE.
---
 gnu/services/messaging.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 4b7e724..6d3a580 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -634,7 +634,7 @@ See also @url{https://prosody.im/doc/modules/mod_muc}.;
  (prosodyctl-bin (file-append prosody "/bin/prosodyctl"))
  (prosodyctl-action (lambda args
   #~(lambda _
-  (zero? (system* #$prosodyctl-bin 
#$@args))
+  (invoke #$prosodyctl-bin #$@args)
 (list (shepherd-service
(documentation "Run the Prosody XMPP server")
(provision '(prosody xmpp-daemon))



branch master updated (18e56ad -> fdbca05)

2018-08-13 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  18e56ad   gnu: aegisub: Fix build.
   new  2ded865   services: prosody: Use 'invoke' rather than 'system*'.
   new  fdbca05   services: prosody: Get the Shepherd to respawn Prosody.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/services/messaging.scm | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)



branch master updated (162c8ab -> efb22b4)

2018-08-12 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  162c8ab   nls: Update 'da' translation.
   new  efb22b4   services: cgit: Disable repo booleans having a global 
counterpart.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/guix.texi | 24 
 gnu/services/cgit.scm | 13 +++--
 2 files changed, 19 insertions(+), 18 deletions(-)



01/01: services: cgit: Disable repo booleans having a global counterpart.

2018-08-12 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit efb22b47dbafff233e0a2d332d019270297be8b5
Author: Clément Lassieur 
Date:   Sun Aug 12 21:19:38 2018 +0200

services: cgit: Disable repo booleans having a global counterpart.

Otherwise the global counterpart is never taken into account.

* doc/guix.texi (Version Control Services): Update accordingly.
* gnu/services/cgit.scm (repo-boolean?, serialize-repo-boolean): Use the
DEFINE-MAYBE macro to allow for the 'disabled value.
(repository-cgit-configuration)[enable-commit-graph?, enable-log-filecount?,
enable-log-linecount?, enable-remote-branches?, enable-subject-links?,
enable-html-serving?]: Change default value to 'disabled.
---
 doc/guix.texi | 24 
 gnu/services/cgit.scm | 13 +++--
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a9bb6d8..1cc73eb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20061,51 +20061,51 @@ Defaults to @samp{""}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-commit-graph?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-commit-graph?
 A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-log-filecount?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-log-filecount?
 A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-log-linecount?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-log-linecount?
 A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-remote-branches?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-remote-branches?
 Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-subject-links?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-subject-links?
 A flag which can be used to override the global setting
 @code{enable-subject-links?}.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
-@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean 
enable-html-serving?
+@deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean 
enable-html-serving?
 A flag which can be used to override the global setting
 @code{enable-html-serving?}.
 
-Defaults to @samp{#f}.
+Defaults to @samp{disabled}.
 
 @end deftypevr
 
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 3289d37..a84a2da 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -149,6 +149,7 @@
 
 (define (serialize-repo-boolean field-name val)
   (serialize-repo-integer field-name (if val 1 0)))
+(define-maybe repo-boolean)
 
 (define repo-list? list?)
 
@@ -239,27 +240,27 @@ is no suitable HEAD.")
(repo-file-object "")
"Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (repo-boolean #f)
+   (maybe-repo-boolean 'disabled)
"A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?



master updated (fb11e79 -> 7d7f683)

2018-08-04 Thread Clment Lassieur
snape pushed a change to branch master.

  from  fb11e79   database: Fix the evaluations limit issue.
   new  7d7f683   doc: Fix database description.


Summary of changes:
 doc/cuirass.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



[no subject]

2018-08-04 Thread Clment Lassieur
branch: master
commit 7d7f6831069933e8961656385e178c03f0a492a9
Author: Clément Lassieur 
Date:   Sat Aug 4 18:33:04 2018 +0200

doc: Fix database description.

* doc/cuirass.texi (Database schema): Add 'Outputs' to the database
description.
---
 doc/cuirass.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/cuirass.texi b/doc/cuirass.texi
index 6cf82ba..d4c6ae1 100644
--- a/doc/cuirass.texi
+++ b/doc/cuirass.texi
@@ -249,8 +249,9 @@ Cuirass uses a SQLite database to store information about 
jobs and past
 build results, but also to coordinate the execution of jobs.
 
 The database contains the following tables: @code{Specifications},
-@code{Inputs}, @code{Stamps}, @code{Evaluations}, @code{Derivations} and
-@code{Builds}.  The purpose of each of these tables is explained below.
+@code{Inputs}, @code{Stamps}, @code{Evaluations}, @code{Derivations},
+@code{Builds} and @code{Outputs}.  The purpose of each of these tables is
+explained below.
 
 @section Specifications
 @cindex specifications, database



[no subject]

2018-08-04 Thread Clment Lassieur
branch: master
commit dc27cb369c7bc358717e586262fdb2a7d509ff29
Author: Clément Lassieur 
Date:   Sat Aug 4 16:20:59 2018 +0200

database: Remove unused DB-FORMAT-BUILD procedure.

* src/cuirass/database.scm (db-format-build): Remove it.
---
 src/cuirass/database.scm | 17 -
 1 file changed, 17 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 1a51705..1f86a1d 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -443,23 +443,6 @@ log file for DRV."
  (cons `(,name . ((#:path . ,path)))
outputs))
 
-(define (db-format-build db build)
-  (match build
-(#(id timestamp starttime stoptime log status derivation job-name system
-  nix-name repo-name)
- `((#:id . ,id)
-   (#:timestamp  . ,timestamp)
-   (#:starttime  . ,starttime)
-   (#:stoptime   . ,stoptime)
-   (#:log. ,log)
-   (#:status . ,status)
-   (#:derivation . ,derivation)
-   (#:job-name   . ,job-name)
-   (#:system . ,system)
-   (#:nix-name   . ,nix-name)
-   (#:repo-name  . ,repo-name)
-   (#:outputs. ,(db-get-outputs db id))
-
 (define (db-get-builds db filters)
   "Retrieve all builds in database DB which are matched by given FILTERS.
 FILTERS is an assoc list whose possible keys are 'id | 'jobset | 'job |



[no subject]

2018-08-04 Thread Clment Lassieur
branch: master
commit 4c044c658a6f7b40ca78b4d1c56ca225d62c1129
Author: Clément Lassieur 
Date:   Sat Aug 4 16:22:57 2018 +0200

Rename 'repo-name' to 'specification'.

* src/cuirass/database.scm (db-get-builds): Rename 'repo-name' to
'specification'.
* src/cuirass/http.scm (build->hydra-build): Idem.
---
 src/cuirass/database.scm | 4 ++--
 src/cuirass/http.scm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 130a9c3..1a51705 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -497,7 +497,7 @@ Assumes that if group id stays the same the group headers 
stay the same."
 (define (finish-group)
   (match repeated-row
 (#(timestamp starttime stoptime log status derivation job-name system
- nix-name repo-name)
+ nix-name specification)
  `((#:id . ,repeated-builds-id)
(#:timestamp  . ,timestamp)
(#:starttime  . ,starttime)
@@ -508,7 +508,7 @@ Assumes that if group id stays the same the group headers 
stay the same."
(#:job-name   . ,job-name)
(#:system . ,system)
(#:nix-name   . ,nix-name)
-   (#:repo-name  . ,repo-name)
+   (#:specification . ,specification)
(#:outputs. ,outputs)
 
 (define (same-group? builds-id)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 2d66ff9..16bbda0 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -79,7 +79,7 @@
  (build-status started)
 
   `((#:id . ,(assq-ref build #:id))
-(#:jobset . ,(assq-ref build #:repo-name))
+(#:jobset . ,(assq-ref build #:specification))
 (#:job . ,(assq-ref build #:job-name))
 
 ;; Hydra's API uses "timestamp" as the time of the last useful event for



[no subject]

2018-08-04 Thread Clment Lassieur
branch: master
commit d36ec7a3852772e2bac14f79ea9c2faa111b5d92
Author: Clément Lassieur 
Date:   Sat Aug 4 16:07:31 2018 +0200

database: Limit SQL queries to 80 columns.
---
 src/cuirass/database.scm | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 56f421d..130a9c3 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -563,12 +563,21 @@ AND (:jobset IS NULL OR (:jobset = Specifications.name))
 AND (:job IS NULL OR (:job = Derivations.job_name))
 AND (:system IS NULL OR (:system = Derivations.system))
 AND (:evaluation IS NULL OR (:evaluation = Builds.evaluation))
-AND (:status IS NULL OR (:status = 'done' AND Builds.status >= 0) OR (:status 
= 'pending' AND Builds.status < 0))
-AND (:borderlowtime IS NULL OR :borderlowid IS NULL OR ((:borderlowtime, 
:borderlowid) < (Builds.stoptime, Builds.id)))
-AND (:borderhightime IS NULL OR :borderhighid IS NULL OR ((:borderhightime, 
:borderhighid) > (Builds.stoptime, Builds.id)))
+AND (:status IS NULL OR (:status = 'done' AND Builds.status >= 0)
+ OR (:status = 'pending' AND Builds.status < 0))
+AND (:borderlowtime IS NULL OR :borderlowid IS NULL
+ OR ((:borderlowtime, :borderlowid) < (Builds.stoptime, Builds.id)))
+AND (:borderhightime IS NULL OR :borderhighid IS NULL
+ OR ((:borderhightime, :borderhighid) > (Builds.stoptime, Builds.id)))
 ORDER BY
-CASE WHEN :borderlowtime IS NULL OR :borderlowid IS NULL THEN Builds.stoptime 
ELSE -Builds.stoptime END DESC,
-CASE WHEN :borderlowtime IS NULL OR :borderlowid IS NULL THEN Builds.id ELSE 
-Builds.id END DESC
+CASE WHEN :borderlowtime IS NULL
+   OR :borderlowid IS NULL THEN Builds.stoptime
+   ELSE -Builds.stoptime
+END DESC,
+CASE WHEN :borderlowtime IS NULL
+   OR :borderlowid IS NULL THEN Builds.id
+   ELSE -Builds.id
+END DESC
 LIMIT :nr)
 ORDER BY ~a, id ASC;" order))
  (stmt (sqlite-prepare db stmt-text #:cache? #t)))



master updated (99241ef -> fb11e79)

2018-08-04 Thread Clment Lassieur
snape pushed a change to branch master.

  from  99241ef   http: Change the paramater format from two-elements lists 
to pairs.
   new  d36ec7a   database: Limit SQL queries to 80 columns.
   new  4c044c6   Rename 'repo-name' to 'specification'.
   new  dc27cb3   database: Remove unused DB-FORMAT-BUILD procedure.
   new  fb11e79   database: Fix the evaluations limit issue.


Summary of changes:
 src/cuirass/database.scm | 57 +---
 src/cuirass/http.scm |  2 +-
 2 files changed, 26 insertions(+), 33 deletions(-)



[no subject]

2018-08-04 Thread Clment Lassieur
branch: master
commit fb11e79c2e3bfa6ebe2b4e4a09889d0aff7f35fe
Author: Clément Lassieur 
Date:   Sat Aug 4 14:46:37 2018 +0200

database: Fix the evaluations limit issue.

* src/cuirass/database.scm (db-get-evaluations-build-summary): Use a 'LEFT
JOIN' instead of a 'JOIN', with 'Evaluations' on the left, so that 
evaluations
are displayed even when they don't have associated builds.
---
 src/cuirass/database.scm | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 1f86a1d..4927f2a 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -639,11 +639,7 @@ FROM Evaluations ORDER BY id DESC LIMIT " limit ";"))
 (define (db-get-evaluations-build-summary db spec limit border-low border-high)
   (let loop ((rows (sqlite-exec db "
 SELECT E.id, E.commits, B.succeeded, B.failed, B.scheduled
-FROM (SELECT id, evaluation, SUM(status=0) as succeeded,
-SUM(status>0) as failed, SUM(status<0) as scheduled
-FROM Builds
-GROUP BY evaluation) B
-JOIN
+FROM
 (SELECT id, commits
 FROM Evaluations
 WHERE (specification=" spec ")
@@ -651,6 +647,11 @@ AND (" border-low "IS NULL OR (id >" border-low "))
 AND (" border-high "IS NULL OR (id <" border-high "))
 ORDER BY CASE WHEN " border-low "IS NULL THEN id ELSE -id END DESC
 LIMIT " limit ") E
+LEFT JOIN
+(SELECT id, evaluation, SUM(status=0) as succeeded,
+SUM(status>0) as failed, SUM(status<0) as scheduled
+FROM Builds
+GROUP BY evaluation) B
 ON B.evaluation=E.id
 ORDER BY E.id ASC;"))
  (evaluations '()))
@@ -660,9 +661,9 @@ ORDER BY E.id ASC;"))
(loop rest
  (cons `((#:id . ,id)
  (#:commits . ,commits)
- (#:succeeded . ,succeeded)
- (#:failed . ,failed)
- (#:scheduled . ,scheduled))
+ (#:succeeded . ,(or succeeded 0))
+ (#:failed . ,(or failed 0))
+ (#:scheduled . ,(or scheduled 0)))
evaluations))
 
 (define (db-get-evaluations-id-min db spec)



01/01: doc: Fix Cuirass URL.

2018-07-30 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 4bfa256ca1ba4cd5539d0c5956b36ed423683d52
Author: Clément Lassieur 
Date:   Mon Jul 30 21:44:51 2018 +0200

doc: Fix Cuirass URL.

* doc/guix.texi (Continuous Integration): Fix Cuirass URL.
---
 doc/guix.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index d558806..080b091 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17688,9 +17688,9 @@ If it is @code{#f} then the daemon will use the host's 
fully qualified domain na
 @subsubsection Continuous Integration
 
 @cindex continuous integration
-@uref{https://notabug.org/mthl/cuirass, Cuirass} is a continuous
-integration tool for Guix.  It can be used both for development and for
-providing substitutes to others (@pxref{Substitutes}).
+@uref{https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git, Cuirass} is a
+continuous integration tool for Guix.  It can be used both for development and
+for providing substitutes to others (@pxref{Substitutes}).
 
 The @code{(gnu services cuirass)} module provides the following service.
 



branch master updated (e4a744d -> 4bfa256)

2018-07-30 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  e4a744d   gnu: minetest: Update to 0.4.17.1.
   new  4bfa256   doc: Fix Cuirass URL.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/guix.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



01/01: nginx: berlin: Route '/' to Cuirass.

2018-07-29 Thread Clment Lassieur
snape pushed a commit to branch master
in repository maintenance.

commit e6e422af18c6d5dfacad3ede6df40a6c08d5d59f
Author: Clément Lassieur 
Date:   Mon Jul 30 01:14:20 2018 +0200

nginx: berlin: Route '/' to Cuirass.

* hydra/nginx/berlin-locations.conf: Change '/' route with the Cuirass
proxy_pass.  Remove Cuirass exceptions.
---
 hydra/nginx/berlin-locations.conf | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/hydra/nginx/berlin-locations.conf 
b/hydra/nginx/berlin-locations.conf
index 11171f7..9d08e91 100644
--- a/hydra/nginx/berlin-locations.conf
+++ b/hydra/nginx/berlin-locations.conf
@@ -1,12 +1,13 @@
 # Configuration of the various HTTP locations.
 # This file is meant to be included in the bayfront configuration file.
 
-location = / {
-# Make sure index.html lives in there.
-root @WWWROOT@;
+# Cuirass.
+location / {
+proxy_pass http://localhost:8081;
 }
 
 location = /index.html {
+# Make sure index.html lives in there.
 root @WWWROOT@;
 }
 
@@ -124,12 +125,6 @@ location /file/ {
 proxy_ignore_client_abort on;
 }
 
-# Cuirass.
-location /specifications { proxy_pass http://localhost:8081; }
-location /jobsets { proxy_pass http://localhost:8081; }
-location /build { proxy_pass http://localhost:8081; }
-location /api { proxy_pass http://localhost:8081; }
-
 # For use by Certbot.
 location /.well-known {
 root /var/www;



branch master updated (428a5f5 -> e6e422a)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch master
in repository maintenance.

  from  428a5f5   doc: Add roadmap for 1.0.
   new  e6e422a   nginx: berlin: Route '/' to Cuirass.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hydra/nginx/berlin-locations.conf | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)



01/01: gnu: cuirass: Update to 99241ef.

2018-07-29 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 78022159a79c7ae30750a91c8630bf170dc336ea
Author: Clément Lassieur 
Date:   Mon Jul 30 00:46:26 2018 +0200

gnu: cuirass: Update to 99241ef.

* gnu/packages/ci.scm (cuirass): Update to 99241ef.
---
 gnu/packages/ci.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index 85dbefa..05353a7 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -185,7 +185,7 @@ their dependencies.")
   (license l:gpl3+
 
 (define-public cuirass
-  (let ((commit "7b2f9e0de1ad2d320973b7aea132a8afcad8bece")
+  (let ((commit "99241ef1af24cadf39e3cad39f9ff27c96b22068")
 (revision "17"))
 (package
   (name "cuirass")
@@ -198,7 +198,7 @@ their dependencies.")
 (file-name (string-append name "-" version))
 (sha256
  (base32
-  "0knww99adgjh8s6f38z3hpwi9hxhmnvqj5g35pcj80xv8j4xj3y3"
+  "1hj17s07sq6nn9wlssd4pi4hzdfyp74kyz5rqv7wr4468xh80pk7"
   (build-system gnu-build-system)
   (arguments
'(#:modules ((guix build utils)



branch master updated (1237653 -> 7802215)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  1237653   gnu: Add emacs-agda2-mode
   new  7802215   gnu: cuirass: Update to 99241ef.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/ci.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



master updated (675cd04 -> 99241ef)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch master.

  from  675cd04   Add a web interface.
   new  99241ef   http: Change the paramater format from two-elements lists 
to pairs.


Summary of changes:
 src/cuirass/database.scm | 49 +++-
 src/cuirass/http.scm | 42 -
 tests/database.scm   | 10 ++
 3 files changed, 45 insertions(+), 56 deletions(-)



[no subject]

2018-07-29 Thread Clment Lassieur
branch: master
commit 99241ef1af24cadf39e3cad39f9ff27c96b22068
Author: Clément Lassieur 
Date:   Fri Jul 20 10:50:48 2018 +0200

http: Change the paramater format from two-elements lists to pairs.

* src/cuirass/database.scm (assqx-ref): Remove exported procedure.
(db-get-builds, db-get-build): Adapt to new format.
* src/cuirass/http.scm (request-parameters): Use (cons key param) instead
of (list key param).
(url-handler): Adapt to new format.
* tests/database.scm ("db-get-builds"): Idem.
---
 src/cuirass/database.scm | 49 +++-
 src/cuirass/http.scm | 42 -
 tests/database.scm   | 10 ++
 3 files changed, 45 insertions(+), 56 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 9b442c1..56f421d 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -58,7 +58,6 @@
 read-sql-file
 read-quoted-string
 sqlite-exec
-assqx-ref
 ;; Parameters.
 %package-database
 %package-schema-file
@@ -461,16 +460,6 @@ log file for DRV."
(#:repo-name  . ,repo-name)
(#:outputs. ,(db-get-outputs db id))
 
-;; XXX Change caller and remove
-(define (assqx-ref filters key)
-  (match filters
-(()
- #f)
-(((xkey xvalue) rest ...)
- (if (eq? key xkey)
- xvalue
- (assqx-ref rest key)
-
 (define (db-get-builds db filters)
   "Retrieve all builds in database DB which are matched by given FILTERS.
 FILTERS is an assoc list whose possible keys are 'id | 'jobset | 'job |
@@ -547,13 +536,13 @@ Assumes that if group id stays the same the group headers 
stay the same."
  (collect-outputs x-builds-id x-repeated-row '() rows)
 
   (let* ((order (match (assq 'order filters)
-  (('order 'build-id) "id ASC")
-  (('order 'decreasing-build-id) "id DESC")
-  (('order 'finish-time) "stoptime DESC")
-  (('order 'finish-time+build-id) "stoptime DESC, id DESC")
-  (('order 'start-time) "starttime DESC")
-  (('order 'submission-time) "timestamp DESC")
-  (('order 'status+submission-time)
+  (('order . 'build-id) "id ASC")
+  (('order . 'decreasing-build-id) "id DESC")
+  (('order . 'finish-time) "stoptime DESC")
+  (('order . 'finish-time+build-id) "stoptime DESC, id DESC")
+  (('order . 'start-time) "starttime DESC")
+  (('order . 'submission-time) "timestamp DESC")
+  (('order . 'status+submission-time)
;; With this order, builds in 'running' state (-1) appear
;; before those in 'scheduled' state (-2).
"status DESC, timestamp DESC")
@@ -585,17 +574,17 @@ ORDER BY ~a, id ASC;" order))
  (stmt (sqlite-prepare db stmt-text #:cache? #t)))
 (sqlite-bind-arguments
  stmt
- #:id (assqx-ref filters 'id)
- #:jobset (assqx-ref filters 'jobset)
- #:job (assqx-ref filters 'job)
- #:evaluation (assqx-ref filters 'evaluation)
- #:system (assqx-ref filters 'system)
- #:status (and=> (assqx-ref filters 'status) object->string)
- #:borderlowid (assqx-ref filters 'border-low-id)
- #:borderhighid (assqx-ref filters 'border-high-id)
- #:borderlowtime (assqx-ref filters 'border-low-time)
- #:borderhightime (assqx-ref filters 'border-high-time)
- #:nr (match (assqx-ref filters 'nr)
+ #:id (assq-ref filters 'id)
+ #:jobset (assq-ref filters 'jobset)
+ #:job (assq-ref filters 'job)
+ #:evaluation (assq-ref filters 'evaluation)
+ #:system (assq-ref filters 'system)
+ #:status (and=> (assq-ref filters 'status) object->string)
+ #:borderlowid (assq-ref filters 'border-low-id)
+ #:borderhighid (assq-ref filters 'border-high-id)
+ #:borderlowtime (assq-ref filters 'border-low-time)
+ #:borderhightime (assq-ref filters 'border-high-time)
+ #:nr (match (assq-ref filters 'nr)
 (#f -1)
 (x x)))
 (sqlite-reset stmt)
@@ -603,7 +592,7 @@ ORDER BY ~a, id ASC;" order))
 
 (define (db-get-build db id)
   "Retrieve a build in database DB which corresponds to ID."
-  (match (db-get-builds db `((id ,id)))
+  (match (db-get-builds db `((id . ,id)))
 ((build)
  build)
 (() #f)))
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 5a5eb52..2d66ff9 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -118,7 +118,7 @@
 
 (define (request-parameters request)
   "Parse the REQUEST query parameters and return them under the form
-  '((parameter value) ...)."
+  '((parameter . value) ...)."
   (let* ((uri (request-uri request))
  (query (uri-query uri)))
 (if query
@@ -126,7 +126,7 @@
(match (string-split 

branch web-interface deleted (was 6c6f4ae)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch web-interface.

   was  6c6f4ae   Add web-interface.

This change permanently discards the following revisions:

  discards  6c6f4ae   Add web-interface.
  discards  fae8a30   Add static files.



[no subject]

2018-07-29 Thread Clment Lassieur
branch: master
commit 675cd04a8530fdc16f68758a410b91ce10d46b18
Author: TSholokhova 
Date:   Sat Jul 21 15:39:10 2018 +0200

Add a web interface.

* Makefile.am (dist_sql_DATA): Add static files.
* src/cuirass/database.scm (assqx-ref): Export it.
(db-get-builds): Add 'evaluation' filter and filters for pagination.
(db-get-evaluations-build-summary, db-get-evaluations-id-min,
db-get-evaluations-id-max, db-get-builds-min, db-get-builds-max): New 
exported
procedures.
* src/cuirass/http.scm (%static-directory): New parameter.
(%page-size, %file-mime-types, %file-white-list): New variables.
(handle-build-request, handle-builds-request): Move the 
WITH-CRITICAL-SECTION
call out.
(url-handler): Add RESPOND-HTML, RESPOND-STATIC-FILE and RESPOND-NOT-FOUND
procedures.  Call WITH-CRITICAL-SECTION sooner for the '/build',
'/api/latestbuilds' and '/api/queue' routes.  Add '/', '/jobset/',
'/eval/', '/static/' routes.  Use RESPOND-NOT-FOUND when the route
isn't found.
* src/cuirass/templates.scm: New file.
(html-page, specifications-table, evaluation-info-table,
build-eval-table): New exported procedures.
(pagination): New procedure.

Signed-off-by: Clément Lassieur 
---
 Makefile.am   |  20 -
 src/cuirass/database.scm  | 174 +++-
 src/cuirass/http.scm  | 158 +++--
 src/cuirass/templates.scm | 222 ++
 4 files changed, 505 insertions(+), 69 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4f6c089..ac22601 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,7 @@
 # Copyright © 2016, 2017 Mathieu Lirzin 
 # Copyright © 2018 Ludovic Courtès 
 # Copyright © 2018 Clément Lassieur 
+# Copyright © 2018 Tatiana Sholokhova 
 #
 # This file is part of Cuirass.
 #
@@ -34,6 +35,10 @@ pkgobjectdir = $(guileobjectdir)/$(PACKAGE)
 webmoduledir = $(guilesitedir)/web/server
 webobjectdir = $(guileobjectdir)/web/server
 sqldir = $(pkgdatadir)/sql
+staticdir = $(pkgdatadir)/static
+cssdir = $(staticdir)/css
+fontsdir = $(staticdir)/fonts
+imagesdir = $(staticdir)/images
 
 dist_pkgmodule_DATA =  \
   src/cuirass/base.scm \
@@ -41,7 +46,8 @@ dist_pkgmodule_DATA = \
   src/cuirass/http.scm \
   src/cuirass/logging.scm  \
   src/cuirass/ui.scm   \
-  src/cuirass/utils.scm
+  src/cuirass/utils.scm \
+  src/cuirass/templates.scm
 
 nodist_pkgmodule_DATA = \
   src/cuirass/config.scm
@@ -61,6 +67,18 @@ dist_pkgdata_DATA = src/schema.sql
 dist_sql_DATA =\
   src/sql/upgrade-1.sql
 
+dist_css_DATA =\
+  src/static/css/bootstrap.css \
+  src/static/css/open-iconic-bootstrap.css
+dist_fonts_DATA =  \
+  src/static/fonts/open-iconic.eot \
+  src/static/fonts/open-iconic.otf \
+  src/static/fonts/open-iconic.svg \
+  src/static/fonts/open-iconic.ttf \
+  src/static/fonts/open-iconic.woff
+dist_images_DATA = \
+  src/static/images/logo.png
+
 TEST_EXTENSIONS = .scm .sh
 AM_TESTS_ENVIRONMENT = \
   env GUILE_AUTO_COMPILE='0' \
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index df41d75..9b442c1 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe 
 ;;; Copyright © 2018 Ludovic Courtès 
 ;;; Copyright © 2018 Clément Lassieur 
+;;; Copyright © 2018 Tatiana Sholokhova 
 ;;;
 ;;; This file is part of Cuirass.
 ;;;
@@ -48,10 +49,16 @@
 db-update-build-status!
 db-get-build
 db-get-builds
+db-get-builds-min
+db-get-builds-max
 db-get-evaluations
+db-get-evaluations-build-summary
+db-get-evaluations-id-min
+db-get-evaluations-id-max
 read-sql-file
 read-quoted-string
 sqlite-exec
+assqx-ref
 ;; Parameters.
 %package-database
 %package-schema-file
@@ -454,20 +461,20 @@ log file for DRV."
(#:repo-name  . ,repo-name)
(#:outputs. ,(db-get-outputs db id))
 
+;; XXX Change caller and remove
+(define (assqx-ref filters key)
+  (match filters
+(()
+ #f)
+(((xkey xvalue) rest ...)
+ (if (eq? key xkey)
+ xvalue
+ (assqx-ref rest key)
+
 (define (db-get-builds db filters)
   "Retrieve all builds in database DB which are matched by given FILTERS.
-FILTERS is an assoc list which possible keys are 'jobset | 'job | 'system |
-'nr | 'order | 'status."
-
-  ;; XXX Change caller and remove
-  (define (assqx-ref filters key)
-(match filters
-  (()
-   #f)
-  (((xkey 

master updated (e0cd000 -> 675cd04)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch master.

  from  e0cd000   Add static files.
   new  675cd04   Add a web interface.


Summary of changes:
 Makefile.am   |  20 -
 src/cuirass/database.scm  | 174 +++-
 src/cuirass/http.scm  | 158 +++--
 src/cuirass/templates.scm | 222 ++
 4 files changed, 505 insertions(+), 69 deletions(-)
 create mode 100644 src/cuirass/templates.scm



master updated (70d85c0 -> e0cd000)

2018-07-29 Thread Clment Lassieur
snape pushed a change to branch master.

  from  70d85c0   utils: Prevent critical section clients to talk to each 
other.
   new  e0cd000   Add static files.


Summary of changes:
 src/static/css/bootstrap.css | 8981 ++
 src/static/css/open-iconic-bootstrap.css |  952 
 src/static/fonts/open-iconic.eot |  Bin 0 -> 28196 bytes
 src/static/fonts/open-iconic.otf |  Bin 0 -> 20996 bytes
 src/static/fonts/open-iconic.svg |  543 ++
 src/static/fonts/open-iconic.ttf |  Bin 0 -> 28028 bytes
 src/static/fonts/open-iconic.woff|  Bin 0 -> 14984 bytes
 src/static/images/logo.png   |  Bin 0 -> 9494 bytes
 8 files changed, 10476 insertions(+)
 create mode 100644 src/static/css/bootstrap.css
 create mode 100644 src/static/css/open-iconic-bootstrap.css
 create mode 100644 src/static/fonts/open-iconic.eot
 create mode 100644 src/static/fonts/open-iconic.otf
 create mode 100644 src/static/fonts/open-iconic.svg
 create mode 100644 src/static/fonts/open-iconic.ttf
 create mode 100644 src/static/fonts/open-iconic.woff
 create mode 100644 src/static/images/logo.png



[no subject]

2018-07-27 Thread Clment Lassieur
branch: web-interface
commit 6c6f4ae0be308d9977586ff7f99b6c33734c1b1a
Author: TSholokhova 
Date:   Sat Jul 21 15:39:10 2018 +0200

Add web-interface.

  Add basic HTML templates, main and specification builds pages.

  * src/cuirass/templates.scm: New file. Add main page template. Add 
builds tables (latest and queue). Add hyperref from the main page to the builds 
pages.
  * Makefile.am (dist_pkgmodule_DATA): Add it.
  * src/cuirass/http.scm (url-handler): Add handler for “status” 
endpoint. (%static-directory, file-mime-types): New variables. (url-handler): 
Add handler for “/status/”; add handler for static files.

  Implement first feature. Add bootstrap style.

  * src/cuirass/templates.scm: Bootstrap based html templates. New 
functions: evaluation-info-table, build-eval-table, pagination.
  * src/cuirass/database.scm: Add new requests to database: 
db-get-evaluations-info, db-get-evaluations-count. Add evaluation filter to 
db-get-builds.
  * src/cuirass/http.scm (url-handler): Change "status" endpoint to 
"/". Add endpoints: ("jobset" name), ("eval" id).

  Change HTML5 to XHTML. Fix codestyle.

  * src/cuirass/http.scm (respond-html): Add XHTML preamble and 
content-type.
  * src/cuirass/templates.scm (html-page): Add XHTML preamble; fix 
codestyle.
  * src/cuirass/database.scm: Fix codestyle.

  Add white-list.

  * src/cuirass/http.scm (respond-static-file, file-white-list): Add 
white list check.

  Update id pagination.

  * src/cuirass/http.scm: Change parameters.
  * src/cuirass/templates.scm: Fix pagination function. Added min and 
max functions for lists.
  * src/cuirass/database.scm: Add borders parameters to evaluation 
request.

  Update id pagination (previous+last buttons).
  * src/cuirass/templates.scm: Add buttons for pagination.
  * src/cuirass/database.scm(db-get-evaluations-build-summary): 
Implement different order for low and high borders.

  Add pagination for each evaluation page.

  * src/cuirass/templates.scm (build-eval-table): Add pagination.
  * src/cuirass/database.scm: Add border filters for pagination in 
db-get-builds. Add functions for searching max and min stoptimes.
  * src/cuirass/http.scm: Add pagination parameters in "eval" query.

  Fix codestyle.

  * src/cuirass/templates.scm: Fix codestyle.
  * src/cuirass/database.scm: Fix codestyle.
  * src/cuirass/http.scm: Fix codestyle.
  * tests/database.scm: Fix test.
  * Makefile.am: Add static files paths.

  Fix with-critical-section wrapping.

  * /src/cuirass/http.scm: Use one critical-section per function.

  Fix pagination for builds.
  * src/cuirass/templates.scm: Rewrite pagination template.
  * src/cuirass/database.scm: Change build filtering for pagination.
  * src/cuirass/http.scm: Add parameters for tuple-pagination.
  * tests/database.scm: Fix test.
---
 Makefile.am   |  19 +++-
 src/cuirass/database.scm  | 149 +++--
 src/cuirass/http.scm  | 190 ++---
 src/cuirass/templates.scm | 234 ++
 4 files changed, 530 insertions(+), 62 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4f6c089..549713a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,10 @@ pkgobjectdir = $(guileobjectdir)/$(PACKAGE)
 webmoduledir = $(guilesitedir)/web/server
 webobjectdir = $(guileobjectdir)/web/server
 sqldir = $(pkgdatadir)/sql
+staticdir = $(pkgdatadir)/static
+cssdir = $(staticdir)/css
+fontsdir = $(staticdir)/fonts
+imagesdir = $(staticdir)/images
 
 dist_pkgmodule_DATA =  \
   src/cuirass/base.scm \
@@ -41,7 +45,8 @@ dist_pkgmodule_DATA = \
   src/cuirass/http.scm \
   src/cuirass/logging.scm  \
   src/cuirass/ui.scm   \
-  src/cuirass/utils.scm
+  src/cuirass/utils.scm \
+  src/cuirass/templates.scm
 
 nodist_pkgmodule_DATA = \
   src/cuirass/config.scm
@@ -61,6 +66,18 @@ dist_pkgdata_DATA = src/schema.sql
 dist_sql_DATA =\
   src/sql/upgrade-1.sql
 
+dist_css_DATA =\
+  src/static/css/bootstrap.css \
+  src/static/css/open-iconic-bootstrap.css
+dist_fonts_DATA =  \
+  src/static/fonts/open-iconic.eot \
+  src/static/fonts/open-iconic.otf \
+  src/static/fonts/open-iconic.svg \
+  src/static/fonts/open-iconic.ttf \
+  src/static/fonts/open-iconic.woff
+dist_images_DATA = \
+  src/static/images/logo.png
+
 TEST_EXTENSIONS = 

branch web-interface created (now 6c6f4ae)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch web-interface.

at  6c6f4ae   Add web-interface.

This branch includes the following new commits:

   new  fae8a30   Add static files.
   new  6c6f4ae   Add web-interface.




branch web-interface deleted (was db6aee3)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch web-interface.

   was  db6aee3   Add web-interface.

This change permanently discards the following revisions:

  discards  db6aee3   Add web-interface.
  discards  d971fcc   Add static files.



branch web-interface-rebased deleted (was 6c6f4ae)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch web-interface-rebased.

   was  6c6f4ae   Add web-interface.

This change permanently discards the following revisions:

  discards  6c6f4ae   Add web-interface.
  discards  fae8a30   Add static files.



[no subject]

2018-07-27 Thread Clment Lassieur
branch: web-interface-rebased
commit 6c6f4ae0be308d9977586ff7f99b6c33734c1b1a
Author: TSholokhova 
Date:   Sat Jul 21 15:39:10 2018 +0200

Add web-interface.

  Add basic HTML templates, main and specification builds pages.

  * src/cuirass/templates.scm: New file. Add main page template. Add 
builds tables (latest and queue). Add hyperref from the main page to the builds 
pages.
  * Makefile.am (dist_pkgmodule_DATA): Add it.
  * src/cuirass/http.scm (url-handler): Add handler for “status” 
endpoint. (%static-directory, file-mime-types): New variables. (url-handler): 
Add handler for “/status/”; add handler for static files.

  Implement first feature. Add bootstrap style.

  * src/cuirass/templates.scm: Bootstrap based html templates. New 
functions: evaluation-info-table, build-eval-table, pagination.
  * src/cuirass/database.scm: Add new requests to database: 
db-get-evaluations-info, db-get-evaluations-count. Add evaluation filter to 
db-get-builds.
  * src/cuirass/http.scm (url-handler): Change "status" endpoint to 
"/". Add endpoints: ("jobset" name), ("eval" id).

  Change HTML5 to XHTML. Fix codestyle.

  * src/cuirass/http.scm (respond-html): Add XHTML preamble and 
content-type.
  * src/cuirass/templates.scm (html-page): Add XHTML preamble; fix 
codestyle.
  * src/cuirass/database.scm: Fix codestyle.

  Add white-list.

  * src/cuirass/http.scm (respond-static-file, file-white-list): Add 
white list check.

  Update id pagination.

  * src/cuirass/http.scm: Change parameters.
  * src/cuirass/templates.scm: Fix pagination function. Added min and 
max functions for lists.
  * src/cuirass/database.scm: Add borders parameters to evaluation 
request.

  Update id pagination (previous+last buttons).
  * src/cuirass/templates.scm: Add buttons for pagination.
  * src/cuirass/database.scm(db-get-evaluations-build-summary): 
Implement different order for low and high borders.

  Add pagination for each evaluation page.

  * src/cuirass/templates.scm (build-eval-table): Add pagination.
  * src/cuirass/database.scm: Add border filters for pagination in 
db-get-builds. Add functions for searching max and min stoptimes.
  * src/cuirass/http.scm: Add pagination parameters in "eval" query.

  Fix codestyle.

  * src/cuirass/templates.scm: Fix codestyle.
  * src/cuirass/database.scm: Fix codestyle.
  * src/cuirass/http.scm: Fix codestyle.
  * tests/database.scm: Fix test.
  * Makefile.am: Add static files paths.

  Fix with-critical-section wrapping.

  * /src/cuirass/http.scm: Use one critical-section per function.

  Fix pagination for builds.
  * src/cuirass/templates.scm: Rewrite pagination template.
  * src/cuirass/database.scm: Change build filtering for pagination.
  * src/cuirass/http.scm: Add parameters for tuple-pagination.
  * tests/database.scm: Fix test.
---
 Makefile.am   |  19 +++-
 src/cuirass/database.scm  | 149 +++--
 src/cuirass/http.scm  | 190 ++---
 src/cuirass/templates.scm | 234 ++
 4 files changed, 530 insertions(+), 62 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4f6c089..549713a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,10 @@ pkgobjectdir = $(guileobjectdir)/$(PACKAGE)
 webmoduledir = $(guilesitedir)/web/server
 webobjectdir = $(guileobjectdir)/web/server
 sqldir = $(pkgdatadir)/sql
+staticdir = $(pkgdatadir)/static
+cssdir = $(staticdir)/css
+fontsdir = $(staticdir)/fonts
+imagesdir = $(staticdir)/images
 
 dist_pkgmodule_DATA =  \
   src/cuirass/base.scm \
@@ -41,7 +45,8 @@ dist_pkgmodule_DATA = \
   src/cuirass/http.scm \
   src/cuirass/logging.scm  \
   src/cuirass/ui.scm   \
-  src/cuirass/utils.scm
+  src/cuirass/utils.scm \
+  src/cuirass/templates.scm
 
 nodist_pkgmodule_DATA = \
   src/cuirass/config.scm
@@ -61,6 +66,18 @@ dist_pkgdata_DATA = src/schema.sql
 dist_sql_DATA =\
   src/sql/upgrade-1.sql
 
+dist_css_DATA =\
+  src/static/css/bootstrap.css \
+  src/static/css/open-iconic-bootstrap.css
+dist_fonts_DATA =  \
+  src/static/fonts/open-iconic.eot \
+  src/static/fonts/open-iconic.otf \
+  src/static/fonts/open-iconic.svg \
+  src/static/fonts/open-iconic.ttf \
+  src/static/fonts/open-iconic.woff
+dist_images_DATA = \
+  src/static/images/logo.png
+
 

branch web-interface-rebased created (now 6c6f4ae)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch web-interface-rebased.

at  6c6f4ae   Add web-interface.

This branch includes the following new commits:

   new  fae8a30   Add static files.
   new  6c6f4ae   Add web-interface.




branch web-interface-rebased deleted (was 3d0c809)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch web-interface-rebased.

   was  3d0c809   Add web-interface.

This change permanently discards the following revisions:

  discards  3d0c809   Add web-interface.
  discards  f8b0030   Add static files.



master updated (6f8dc0b -> 70d85c0)

2018-07-27 Thread Clment Lassieur
snape pushed a change to branch master.

  from  6f8dc0b   database: Use SQLite in Multi-thread mode.
   new  70d85c0   utils: Prevent critical section clients to talk to each 
other.


Summary of changes:
 src/cuirass/utils.scm | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)



[no subject]

2018-07-27 Thread Clment Lassieur
branch: master
commit 70d85c0c642be0b5aaca567857ba416a1f4cee8c
Author: Clément Lassieur 
Date:   Fri Jul 27 08:28:12 2018 +0200

utils: Prevent critical section clients to talk to each other.

* src/cuirass/utils.scm (make-critical-section): Put the modified message to
the REPLY channel that was part of the initial message.
(call-with-critical-section): Create a REPLY channel, add it to the sent
message, get the modified message from that channel.

Co-authored-by: Ludovic Courtès 
---
 src/cuirass/utils.scm | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index 6629bc1..9e9ac36 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -106,16 +106,17 @@ dedicated fiber."
  (lambda ()
(let loop ()
  (match (get-message channel)
-   ((? procedure? proc)
-(put-message channel (apply proc args
+   (((? channel? reply) . (? procedure? proc))
+(put-message reply (apply proc args
  (loop
 channel))
 
 (define (call-with-critical-section channel proc)
   "Call PROC in the critical section corresponding to CHANNEL.  Return the
 result of PROC."
-  (put-message channel proc)
-  (get-message channel))
+  (let ((reply (make-channel)))
+(put-message channel (cons reply proc))
+(get-message reply)))
 
 (define-syntax-rule (with-critical-section channel (vars ...) exp ...)
   "Evaluate EXP... in the critical section corresponding to CHANNEL.



[no subject]

2018-07-24 Thread Clment Lassieur
branch: web-interface-rebased
commit 3d0c80985c2ed2db1d5721cc6be51faedf1beb10
Author: TSholokhova 
Date:   Sat Jul 21 15:39:10 2018 +0200

Add web-interface.

  Add basic HTML templates, main and specification builds pages.

  * src/cuirass/templates.scm: New file. Add main page template. Add 
builds tables (latest and queue). Add hyperref from the main page to the builds 
pages.
  * Makefile.am (dist_pkgmodule_DATA): Add it.
  * src/cuirass/http.scm (url-handler): Add handler for “status” 
endpoint. (%static-directory, file-mime-types): New variables. (url-handler): 
Add handler for “/status/”; add handler for static files.

  Implement first feature. Add bootstrap style.

  * src/cuirass/templates.scm: Bootstrap based html templates. New 
functions: evaluation-info-table, build-eval-table, pagination.
  * src/cuirass/database.scm: Add new requests to database: 
db-get-evaluations-info, db-get-evaluations-count. Add evaluation filter to 
db-get-builds.
  * src/cuirass/http.scm (url-handler): Change "status" endpoint to 
"/". Add endpoints: ("jobset" name), ("eval" id).

  Change HTML5 to XHTML. Fix codestyle.

  * src/cuirass/http.scm (respond-html): Add XHTML preamble and 
content-type.
  * src/cuirass/templates.scm (html-page): Add XHTML preamble; fix 
codestyle.
  * src/cuirass/database.scm: Fix codestyle.

  Add white-list.

  * src/cuirass/http.scm (respond-static-file, file-white-list): Add 
white list check.

  Update id pagination.

  * src/cuirass/http.scm: Change parameters.
  * src/cuirass/templates.scm: Fix pagination function. Added min and 
max functions for lists.
  * src/cuirass/database.scm: Add borders parameters to evaluation 
request.

  Update id pagination (previous+last buttons).
  * src/cuirass/templates.scm: Add buttons for pagination.
  * src/cuirass/database.scm(db-get-evaluations-build-summary): 
Implement different order for low and high borders.

  Add pagination for each evaluation page.

  * src/cuirass/templates.scm (build-eval-table): Add pagination.
  * src/cuirass/database.scm: Add border filters for pagination in 
db-get-builds. Add functions for searching max and min stoptimes.
  * src/cuirass/http.scm: Add pagination parameters in "eval" query.

  Fix codestyle.

  * src/cuirass/templates.scm: Fix codestyle.
  * src/cuirass/database.scm: Fix codestyle.
  * src/cuirass/http.scm: Fix codestyle.
  * tests/database.scm: Fix test.
  * Makefile.am: Add static files paths.

  Fix with-critical-section wrapping.

  * /src/cuirass/http.scm: Use one critical-section per function.

  Fix pagination for builds.
  * src/cuirass/templates.scm: Rewrite pagination template.
  * src/cuirass/database.scm: Change build filtering for pagination.
  * src/cuirass/http.scm: Add parameters for tuple-pagination.
  * tests/database.scm: Fix test.
---
 Makefile.am   |  19 +++-
 src/cuirass/database.scm  | 149 +++--
 src/cuirass/http.scm  | 190 ++---
 src/cuirass/templates.scm | 234 ++
 4 files changed, 530 insertions(+), 62 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4f6c089..549713a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,10 @@ pkgobjectdir = $(guileobjectdir)/$(PACKAGE)
 webmoduledir = $(guilesitedir)/web/server
 webobjectdir = $(guileobjectdir)/web/server
 sqldir = $(pkgdatadir)/sql
+staticdir = $(pkgdatadir)/static
+cssdir = $(staticdir)/css
+fontsdir = $(staticdir)/fonts
+imagesdir = $(staticdir)/images
 
 dist_pkgmodule_DATA =  \
   src/cuirass/base.scm \
@@ -41,7 +45,8 @@ dist_pkgmodule_DATA = \
   src/cuirass/http.scm \
   src/cuirass/logging.scm  \
   src/cuirass/ui.scm   \
-  src/cuirass/utils.scm
+  src/cuirass/utils.scm \
+  src/cuirass/templates.scm
 
 nodist_pkgmodule_DATA = \
   src/cuirass/config.scm
@@ -61,6 +66,18 @@ dist_pkgdata_DATA = src/schema.sql
 dist_sql_DATA =\
   src/sql/upgrade-1.sql
 
+dist_css_DATA =\
+  src/static/css/bootstrap.css \
+  src/static/css/open-iconic-bootstrap.css
+dist_fonts_DATA =  \
+  src/static/fonts/open-iconic.eot \
+  src/static/fonts/open-iconic.otf \
+  src/static/fonts/open-iconic.svg \
+  src/static/fonts/open-iconic.ttf \
+  src/static/fonts/open-iconic.woff
+dist_images_DATA = \
+  src/static/images/logo.png
+
 

branch web-interface-rebased created (now 3d0c809)

2018-07-24 Thread Clment Lassieur
snape pushed a change to branch web-interface-rebased.

at  3d0c809   Add web-interface.

This branch includes the following new commits:

   new  f8b0030   Add static files.
   new  3d0c809   Add web-interface.




01/01: hydra: services: Fix Cuirass configuration.

2018-07-20 Thread Clment Lassieur
snape pushed a commit to branch master
in repository maintenance.

commit 641b9750c30cd8275765aaa6457aea961224f928
Author: Clément Lassieur 
Date:   Fri Jul 20 20:10:28 2018 +0200

hydra: services: Fix Cuirass configuration.

* hydra/modules/sysadmin/services.scm (guix-input): Take a NAME argument.
(cuirass-specs): Use the correct input names.  Rename '#:proc-arguments' to
'#:proc-args'.  Add specifications for the "staging" and "core-updates"
branches.  Add missing '#:load-path-inputs' and '#:package-path-inputs'
fields.
---
 hydra/modules/sysadmin/services.scm | 35 ++-
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/hydra/modules/sysadmin/services.scm 
b/hydra/modules/sysadmin/services.scm
index 168c599..9380090 100644
--- a/hydra/modules/sysadmin/services.scm
+++ b/hydra/modules/sysadmin/services.scm
@@ -61,8 +61,8 @@
 ;;; Cuirass.
 ;;;
 
-(define* (guix-input #:optional (branch "master"))
-  `((#:name . "guix")
+(define* (guix-input name #:optional (branch "master"))
+  `((#:name . ,name)
 (#:url . "https://git.savannah.gnu.org/git/guix.git;)
 (#:load-path . ".")
 (#:branch . ,branch)
@@ -72,19 +72,36 @@
   "Return the Cuirass specifications to build Guix for the given SYSTEMS."
   #~(list `((#:name . "guix-master")
 (#:load-path-inputs . ("guix"))
-
+(#:package-path-inputs . ())
 (#:proc-input . "guix")
 (#:proc-file . "build-aux/cuirass/gnu-system.scm")
 (#:proc . cuirass-jobs)
-(#:proc-arguments (subset . "all") (systems #$@systems))
-(#:inputs . ,(list #$(guix-input "master"
-
+(#:proc-args (subset . "all") (systems #$@systems))
+(#:inputs . (#$(guix-input "guix" "master"
   `((#:name . "guix-modular-master")
-(#:proc-input . "guix")
+(#:load-path-inputs . ("guix-modular"))
+(#:package-path-inputs . ())
+(#:proc-input . "guix-modular")
 (#:proc-file . "build-aux/cuirass/guix-modular.scm")
 (#:proc . cuirass-jobs)
-(#:proc-arguments (systems #$@systems))
-(#:inputs . ,(list #$(guix-input "master"))
+(#:proc-args (systems #$@systems))
+(#:inputs . (#$(guix-input "guix-modular" "master"
+  `((#:name . "staging-staging")
+(#:load-path-inputs . ("staging"))
+(#:package-path-inputs . ())
+(#:proc-input . "staging")
+(#:proc-file . "build-aux/cuirass/gnu-system.scm")
+(#:proc . cuirass-jobs)
+(#:proc-args (systems #$@systems))
+(#:inputs . (#$(guix-input "staging" "staging"
+  `((#:name . "core-updates-core-updates")
+(#:load-path-inputs . ("core-updates"))
+(#:package-path-inputs . ())
+(#:proc-input . "core-updates")
+(#:proc-file . "build-aux/cuirass/gnu-system.scm")
+(#:proc . cuirass-jobs)
+(#:proc-args (subset . core) (systems #$@systems))
+(#:inputs . (#$(guix-input "core-updates" "core-updates"))
 
 
 ;;;



branch master updated (ff4f32a -> 641b975)

2018-07-20 Thread Clment Lassieur
snape pushed a change to branch master
in repository maintenance.

  from  ff4f32a   hydra: services: Another typo.
   new  641b975   hydra: services: Fix Cuirass configuration.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hydra/modules/sysadmin/services.scm | 35 ++-
 1 file changed, 26 insertions(+), 9 deletions(-)



master updated (7b2f9e0 -> 6f8dc0b)

2018-07-20 Thread Clment Lassieur
snape pushed a change to branch master.

  from  7b2f9e0   Add support for multiple inputs.
   new  6f8dc0b   database: Use SQLite in Multi-thread mode.


Summary of changes:
 src/cuirass/database.scm | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)



[no subject]

2018-07-20 Thread Clment Lassieur
branch: master
commit 6f8dc0b6169fa43a340377e3a95a0352cfc2148a
Author: Clément Lassieur 
Date:   Thu Jul 19 12:48:44 2018 +0200

database: Use SQLite in Multi-thread mode.

This disables mutexing on database connection and prepared statement 
objects,
thus making us responsible for serializing access to database connections 
and
prepared statements.  It may result in a performance improvement.

* src/cuirass/database.scm (db-init, db-open): Pass the SQLITE_OPEN_NOMUTEX
flag to SQLITE-OPEN.
---
 src/cuirass/database.scm | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 72acb15..df41d75 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -189,7 +189,8 @@ database object."
 (format (current-error-port) "Removing leftover database ~a~%" db-name)
 (delete-file db-name))
   (let ((db (sqlite-open db-name (logior SQLITE_OPEN_CREATE
- SQLITE_OPEN_READWRITE
+ SQLITE_OPEN_READWRITE
+ SQLITE_OPEN_NOMUTEX
 (db-load db schema)
 (db-set-schema-version db (latest-db-schema-version))
 db))
@@ -215,8 +216,14 @@ database object."
   ;; Use "write-ahead log" mode because it improves concurrency and should
   ;; avoid SQLITE_LOCKED errors when we have several readers:
   ;; .
+
+  ;; SQLITE_OPEN_NOMUTEX disables mutexing on database connection and prepared
+  ;; statement objects, thus making us responsible for serializing access to
+  ;; database connections and prepared statements.
   (set-db-options (if (file-exists? db)
-  (db-upgrade (sqlite-open db SQLITE_OPEN_READWRITE))
+  (db-upgrade
+   (sqlite-open db (logior SQLITE_OPEN_READWRITE
+   SQLITE_OPEN_NOMUTEX)))
   (db-init db
 
 (define (db-close db)



branch master updated (a545090 -> 701cbfd)

2018-07-16 Thread Clment Lassieur
snape pushed a change to branch master
in repository guix.

  from  a545090   gnu: python-cairocffi: Fix loading of shared libraries.
   new  701cbfd   doc: Remove the documentation about Cuirass' load-path.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/guix.texi | 4 
 1 file changed, 4 deletions(-)



01/01: doc: Remove the documentation about Cuirass' load-path.

2018-07-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 701cbfd15d7077ad51326a636b0b48658da21cc6
Author: Clément Lassieur 
Date:   Mon Jul 16 23:55:44 2018 +0200

doc: Remove the documentation about Cuirass' load-path.

* doc/guix.texi (Continuous Integration): Remove the load-path field.
---
 doc/guix.texi | 4 
 1 file changed, 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c759ccb..84347d1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17742,10 +17742,6 @@ Only evaluate specifications and build derivations 
once.
 When substituting a pre-built binary fails, fall back to building
 packages locally.
 
-@item @code{load-path} (default: @code{'()})
-This allows users to define their own packages and make them visible to
-cuirass as in @command{guix build} command.
-
 @item @code{cuirass} (default: @code{cuirass})
 The Cuirass package to use.
 @end table



02/02: services: cuirass: Remove the LOAD-PATH option.

2018-07-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit cd62e5d36835a7ec7b003500f1d1ad58b09738e3
Author: Clément Lassieur 
Date:   Sun Jul 15 13:18:00 2018 +0200

services: cuirass: Remove the LOAD-PATH option.

* gnu/services/cuirass.scm (,
cuirass-shepherd-service): Remove the LOAD-PATH option.
---
 gnu/services/cuirass.scm | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 4664a36..9c62080 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe 
 ;;; Copyright © 2017 Jan Nieuwenhuizen 
 ;;; Copyright © 2018 Ricardo Wurmus 
+;;; Copyright © 2018 Clément Lassieur 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -72,9 +73,7 @@
   (one-shot?cuirass-configuration-one-shot? ;boolean
 (default #f))
   (fallback?cuirass-configuration-fallback? ;boolean
-(default #f))
-  (load-pathcuirass-configuration-load-path
-(default '(
+(default #f)))
 
 (define (cuirass-shepherd-service config)
   "Return a  for the Cuirass service with CONFIG."
@@ -92,8 +91,7 @@
  (specs(cuirass-configuration-specifications config))
  (use-substitutes? (cuirass-configuration-use-substitutes? config))
  (one-shot?(cuirass-configuration-one-shot? config))
- (fallback?(cuirass-configuration-fallback? config))
- (load-path(cuirass-configuration-load-path config)))
+ (fallback?(cuirass-configuration-fallback? config)))
  (list (shepherd-service
 (documentation "Run Cuirass.")
 (provision '(cuirass))
@@ -109,9 +107,7 @@
 "--interval" #$(number->string interval)
 #$@(if use-substitutes? '("--use-substitutes") '())
 #$@(if one-shot? '("--one-shot") '())
-#$@(if fallback? '("--fallback") '())
-#$@(if (null? load-path) '()
- `("--load-path" ,(string-join load-path 
":"
+#$@(if fallback? '("--fallback") '()))
 
   #:environment-variables
   (list "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"



01/02: gnu: cuirass: Update to 7b2f9e0.

2018-07-16 Thread Clment Lassieur
snape pushed a commit to branch master
in repository guix.

commit 68a653ab6493a5e9ea45145985a3e62d14bbcd5d
Author: Clément Lassieur 
Date:   Tue Jun 19 16:39:15 2018 +0200

gnu: cuirass: Update to 7b2f9e0.

* gnu/packages/ci.scm (cuirass): Update to 7b2f9e0.
---
 gnu/packages/ci.scm | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index ba95dc1..85dbefa 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016, 2017 Mathieu Lirzin 
 ;;; Copyright © 2017 Mathieu Othacehe 
 ;;; Copyright © 2017 Ricardo Wurmus 
+;;; Copyright © 2018 Clément Lassieur 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -184,8 +185,8 @@ their dependencies.")
   (license l:gpl3+
 
 (define-public cuirass
-  (let ((commit "238f856e48ee333ed3e19fa32ce5e1742c650c67")
-(revision "16"))
+  (let ((commit "7b2f9e0de1ad2d320973b7aea132a8afcad8bece")
+(revision "17"))
 (package
   (name "cuirass")
   (version (string-append "0.0.1-" revision "." (string-take commit 7)))
@@ -197,7 +198,7 @@ their dependencies.")
 (file-name (string-append name "-" version))
 (sha256
  (base32
-  "15iwdgy561gnsr224rs5z8qn7nrsh1wdlsxr8gwxyk0v4zp6yvbf"
+  "0knww99adgjh8s6f38z3hpwi9hxhmnvqj5g35pcj80xv8j4xj3y3"
   (build-system gnu-build-system)
   (arguments
'(#:modules ((guix build utils)



  1   2   3   >