summaryrefslogtreecommitdiff
path: root/gnu/ci.scm
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2019-11-17 13:29:19 +0100
committerClément Lassieur <clement@lassieur.org>2019-12-01 11:26:11 +0100
commitf71b0a0012d46bd30ead1a14ed58fd59647415e2 (patch)
treec5ab18f066db9d12255c325a5aed1998cab8f156 /gnu/ci.scm
parentdb1106e2b5693aff5063b74d4a78eef3c0a4d900 (diff)
ci: Make sure the Guix checkout is the one providing Cuirass proc.
Fixes <https://bugs.gnu.org/36378>. Reported by Reza Alizadeh Majd <r.majd@pantherx.org>. * build-aux/hydra/gnu-system.scm (find-current-checkout): New procedure. (hydra-jobs): Use FIND-CURRENT-CHECKOUT to define CHECKOUT. Pass it to the inferior Guix as an extra argument whose key is 'superior-guix-checkout'. * gnu/ci.scm (find-current-checkout): New procedure. (hydra-jobs): Use FIND-CURRENT-CHECKOUT to define CHECKOUT. This will return '#f' if the current Guix is an inferior. In that case, use the 'superior-guix-checkout' argument provided by the superior Guix.
Diffstat (limited to 'gnu/ci.scm')
-rw-r--r--gnu/ci.scm22
1 files changed, 14 insertions, 8 deletions
diff --git a/gnu/ci.scm b/gnu/ci.scm
index f24049e772a..d6eb2d018f5 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -1,7 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org> 3;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
4;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> 4;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
5;;; 5;;;
6;;; This file is part of GNU Guix. 6;;; This file is part of GNU Guix.
7;;; 7;;;
@@ -374,6 +374,17 @@ valid."
374 load-manifest) 374 load-manifest)
375 manifests)))) 375 manifests))))
376 376
377(define (find-current-checkout arguments)
378 "Find the first checkout of ARGUMENTS that provided the current file.
379Return #f if no such checkout is found."
380 (let ((current-root
381 (canonicalize-path
382 (string-append (dirname (current-filename)) "/.."))))
383 (find (lambda (argument)
384 (and=> (assq-ref argument 'file-name)
385 (lambda (name)
386 (string=? name current-root)))) arguments)))
387
377 388
378;;; 389;;;
379;;; Hydra entry point. 390;;; Hydra entry point.
@@ -396,13 +407,8 @@ valid."
396 ((? string? str) (call-with-input-string str read)))) 407 ((? string? str) (call-with-input-string str read))))
397 408
398 (define checkout 409 (define checkout
399 ;; Extract metadata about the 'guix' checkout. Its key in ARGUMENTS may 410 (or (find-current-checkout arguments)
400 ;; vary, so pick up the first one that's neither 'subset' nor 'systems'. 411 (assq-ref arguments 'superior-guix-checkout)))
401 (any (match-lambda
402 ((key . value)
403 (and (not (memq key '(systems subset)))
404 value)))
405 arguments))
406 412
407 (define commit 413 (define commit
408 (assq-ref checkout 'revision)) 414 (assq-ref checkout 'revision))