GNU bug report logs - #36378
Guix Cuirass Issue with Input channels

Previous Next

Package: guix;

Reported by: "Reza Alizadeh Majd" <r.majd <at> pantherx.org>

Date: Tue, 25 Jun 2019 15:17:02 UTC

Severity: normal

Done: clement <at> lassieur.org (Clément Lassieur)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36378 in the body.
You can then email your comments to 36378 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to help-debbugs <at> gnu.org:
bug#36378; Package cuirass. (Tue, 25 Jun 2019 15:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Reza Alizadeh Majd" <r.majd <at> pantherx.org>:
New bug report received and forwarded. Copy sent to help-debbugs <at> gnu.org. (Tue, 25 Jun 2019 15:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Reza Alizadeh Majd" <r.majd <at> pantherx.org>
To: bug-guix <at> gnu.org
Subject: Guix Cuirass Issue with Input channels
Date: Tue, 25 Jun 2019 19:46:42 +0430
Package: cuirass

adding additional inputs to cuirass specification with name started with `p` letter, fails the evaluation of specification. 


considering following specification: 

--8<---------------cut here---------------start------------->8---
(list 
  '((#:name . "hello-spec")
    (#:load-path-inputs . ("guix"))
    (#:package-path-inputs . ())
    (#:proc-input ."guix")
    (#:proc-file . "build-aux/cuirass/gnu-system.scm")
    (#:proc . cuirass-jobs)
    (#:proc-args . ((subset . "hello")
		    (systems . ("x86_64-linux"))))
    (#:inputs . (((#:name . "guix")
		  (#:url . "git://git.savannah.gnu.org/guix.git")
		  (#:load-path . ".")
		  (#:branch . "master")
		  (#:no-compile? . #t))
		 ((#:name . "pkginput")
		  (#:url . "git://git.savannah.gnu.org/guix/guix-cuirass.git")
		  (#:load-path . ".")
		  (#:branch . "master")
		  (#:no-compile? . #t))
		 ))))
--8<---------------cut here---------------end--------------->8---

we receive following error: 

--8<---------------cut here---------------start------------->8---
root <at> panther ~/ci# cuirass --listen=0.0.0.0 --port=8082 -D test.db -S tttt.scm 
...
2019-06-25T19:17:33 fetching input 'guix' of spec 'hello-spec'
2019-06-25T19:17:33 fetching input 'pkginput' of spec 'hello-spec'
2019-06-25T19:17:35 fetched input 'pkginput' of spec 'hello-spec' (commit "fed15b83b0b54d17057733935eb53e94e1a2c926")
2019-06-25T19:17:35 fetched input 'guix' of spec 'hello-spec' (commit "5fbb9f0b51a1caeb86009192654f650c5cb4d167")
2019-06-25T19:17:35 next evaluation in 300 seconds
2019-06-25T19:17:35 evaluating spec 'hello-spec'
Backtrace:
          17 (apply-smob/1 #<catch-closure 128b780>)
In ice-9/boot-9.scm:
    705:2 16 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8 15 (_ #(#(#<directory (guile-user) 1316140>)))
   293:34 14 (_ #(#(#(#(#(#(#(#(#(#(#(…) …) …) …) …) …) …) …) …) …) …))
    159:9 13 (_ _)
    619:8 12 (_ #(#(#(#<module (#{ g18}#) 1339640>) #<store-co…> …) …))
   626:19 11 (_ #(#(#(#<module (#{ g18}#) 1339640>) #<store-co…> …) …))
In guix/store.scm:
  1794:24 10 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
In guix/channels.scm:
    498:2  9 (_ _)
    455:2  8 (_ _)
In guix/monads.scm:
    482:9  7 (_ _)
In guix/store.scm:
   1667:8  6 (_ _)
In guix/gexp.scm:
    708:2  5 (_ _)
In guix/monads.scm:
    482:9  4 (_ _)
In guix/gexp.scm:
   573:13  3 (_ _)
In guix/store.scm:
  1667:13  2 (_ _)
In guix/gexp.scm:
    210:2  1 (lower-object #f _ #:target _)
   189:36  0 (lookup-compiler #f)

guix/gexp.scm:189:36: In procedure lookup-compiler:
In procedure struct_vtable: Wrong type argument in position 1 (expecting struct): #f

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
2019-06-25T19:17:36 failed to evaluate spec 'hello-spec'
--8<---------------cut here---------------end--------------->8---

but by just renaming the `pkginput` to something that is not starts with `p` word like `_pkginput` spec evaluation will succeed. 


--8<---------------cut here---------------start------------->8---
root <at> panther ~/ci# cuirass --listen=0.0.0.0 --port=8082 -D test.db -S bug.scm
...
2019-06-25T19:41:34 fetching input 'guix' of spec 'hello-spec'
2019-06-25T19:41:34 fetching input '_pkginput' of spec 'hello-spec'
2019-06-25T19:41:35 fetched input 'guix' of spec 'hello-spec' (commit "5fbb9f0b51a1caeb86009192654f650c5cb4d167")
2019-06-25T19:41:35 fetched input '_pkginput' of spec 'hello-spec' (commit "fed15b83b0b54d17057733935eb53e94e1a2c926")
2019-06-25T19:41:35 next evaluation in 300 seconds
2019-06-25T19:41:35 evaluating spec 'hello-spec'
warning:
building things during evaluation
'build-things' arguments: (("/gnu/store/h8fsfj550mikscspyg4x9fi7jgliq8qa-compute-guix-derivation.drv") 0)
Computing Guix derivation for 'x86_64-linux'... -
warning:
building things during evaluation
'build-things' arguments: (("/gnu/store/sz3l35mnfhphqnrgzg78k84chm3fys5i-profile.drv") 0)

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
2019-06-25T19:42:35 evaluation 1 for 'hello-spec' completed
2019-06-25T19:42:35 building 1 jobs for 'hello-spec'
2019-06-25T19:42:35 evaluation 1 registered 1 new derivations
2019-06-25T19:42:35 building 1 derivations in batches of 200
2019-06-25T19:42:35 building batch of 200 derivations (0/1)
2019-06-25T19:42:35 done with 1 derivations
2019-06-25T19:42:35 outputs:
/gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10
2019-06-25T19:42:35 success: 1, fail: 0
--8<---------------cut here---------------end--------------->8---

--
Reza




bug reassigned from package 'cuirass' to 'guix'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 16:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Mon, 01 Jul 2019 09:06:02 GMT) Full text and rfc822 format available.

Message #10 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Reza Alizadeh Majd" <r.majd <at> pantherx.org>
Cc: 36378 <at> debbugs.gnu.org
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Mon, 01 Jul 2019 11:05:25 +0200
Hello Reza,

"Reza Alizadeh Majd" <r.majd <at> pantherx.org> skribis:

> Package: cuirass
>
> adding additional inputs to cuirass specification with name started with `p` letter, fails the evaluation of specification. 

[...]

> 2019-06-25T19:17:35 evaluating spec 'hello-spec'
> Backtrace:
>           17 (apply-smob/1 #<catch-closure 128b780>)
> In ice-9/boot-9.scm:
>     705:2 16 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
> In ice-9/eval.scm:
>     619:8 15 (_ #(#(#<directory (guile-user) 1316140>)))
>    293:34 14 (_ #(#(#(#(#(#(#(#(#(#(#(…) …) …) …) …) …) …) …) …) …) …))
>     159:9 13 (_ _)
>     619:8 12 (_ #(#(#(#<module (#{ g18}#) 1339640>) #<store-co…> …) …))
>    626:19 11 (_ #(#(#(#<module (#{ g18}#) 1339640>) #<store-co…> …) …))
> In guix/store.scm:
>   1794:24 10 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
> In guix/channels.scm:
>     498:2  9 (_ _)
>     455:2  8 (_ _)
> In guix/monads.scm:
>     482:9  7 (_ _)
> In guix/store.scm:
>    1667:8  6 (_ _)
> In guix/gexp.scm:
>     708:2  5 (_ _)
> In guix/monads.scm:
>     482:9  4 (_ _)
> In guix/gexp.scm:
>    573:13  3 (_ _)
> In guix/store.scm:
>   1667:13  2 (_ _)
> In guix/gexp.scm:
>     210:2  1 (lower-object #f _ #:target _)
>    189:36  0 (lookup-compiler #f)
>
> guix/gexp.scm:189:36: In procedure lookup-compiler:
> In procedure struct_vtable: Wrong type argument in position 1 (expecting struct): #f
>
> Some deprecated features have been used.  Set the environment
> variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
> program to get more information.  Set it to "no" to suppress
> this message.
> 2019-06-25T19:17:36 failed to evaluate spec 'hello-spec'
>
>
> but by just renaming the `pkginput` to something that is not starts with `p` word like `_pkginput` spec evaluation will succeed. 

I find it hard to believe this has anything to do with the name starting
with ‘p’.

If you change back from ‘_pkginput’ to ‘pkginput’, does it fail again?

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Tue, 02 Jul 2019 06:49:01 GMT) Full text and rfc822 format available.

Message #13 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: "Reza Alizadeh Majd" <r.majd <at> pantherx.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 36378 <at> debbugs.gnu.org
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Tue, 02 Jul 2019 11:18:27 +0430
Hi Ludo, 


> 
> I find it hard to believe this has anything to do with the name starting
> with ‘p’.
> 
> If you change back from ‘_pkginput’ to ‘pkginput’, does it fail again?
> 

yes, renaming the input name back to `pkginput` I received same error 
again. 

It is so strange for me, but I had various tests, and received same results 
on each attempt. 

steps to reproduce this issue: 

1. install GuixSD on a virtual machine
2. update package repository using `guix pull`
3. install cuirass using `guix package -i cuirass`
4. create an spec file with following contents: 

--8<---------------cut here---------------start------------->8---
(list 
  '((#:name . "hello-spec")
    (#:load-path-inputs . ("guix"))
    (#:package-path-inputs . ())
    (#:proc-input . "guix")
    (#:proc-file . "build-aux/cuirass/gnu-system.scm")
    (#:proc . cuirass-jobs)
    (#:proc-args . ((subset . ("hello" "wget"))
		    (systems . ("x86_64-linux"))))
    (#:inputs . (((#:name . "guix")
		  (#:url . "git://git.savannah.gnu.org/guix.git")
		  (#:load-path . ".")
		  (#:branch . "master")
		  (#:no-compile? . #t))
		 ((#:name . "pkginput")
		  (#:url . "git://git.savannah.gnu.org/guix/guix-cuirass.git")
		  (#:load-path . ".")
		  (#:branch . "master")
		  (#:no-compile? . #t))))))
--8<---------------cut here---------------end--------------->8---

5. run cuirass manually using following command shows the issue:
`cuirass --listen=0.0.0.0 --port=8082 -D test.db -S spec.scm`

6. removing the `test.db` and rename the `pkginput` to `_pkginput`
cuirass starts without problem. 

7. restore back the name of `_pkginput` to `pkginput`, remove the 
`test.db` file, and re run the cuirass, same error occurs again. 


Best,
Reza




Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Mon, 08 Jul 2019 06:03:02 GMT) Full text and rfc822 format available.

Message #16 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: "Reza Alizadeh Majd" <r.majd <at> pantherx.org>
To: 36378 <at> debbugs.gnu.org
Subject: bug#36378: Guix Cuirass Issue with Input channels
Date: Mon, 08 Jul 2019 10:32:43 +0430
Hi, 

Does anyone checked steps to reproduce this issue? 
Is it occur for anyone else? 

Best, 
Reza




Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Sun, 17 Nov 2019 02:40:01 GMT) Full text and rfc822 format available.

Message #19 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: clement <at> lassieur.org (Clément Lassieur)
To: Reza Alizadeh Majd <r.majd <at> pantherx.org>, Ludovic Courtès <ludo <at> gnu.org>
Cc: 36378 <at> debbugs.gnu.org
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Sun, 17 Nov 2019 03:38:58 +0100
Hi Reza and Ludo,

Reza Alizadeh Majd <r.majd <at> pantherx.org> writes:

> adding additional inputs to cuirass specification with name started
> with `p` letter, fails the evaluation of specification.

Thank you for reporting this!  It actually fails with names that come
after the first input (in this case: "guix") in alphabetical order.

> considering following specification: 
>
> (list 
>   '((#:name . "hello-spec")
>     (#:load-path-inputs . ("guix"))
>     (#:package-path-inputs . ())
>     (#:proc-input ."guix")
>     (#:proc-file . "build-aux/cuirass/gnu-system.scm")
>     (#:proc . cuirass-jobs)
>     (#:proc-args . ((subset . "hello")
> 		    (systems . ("x86_64-linux"))))
>     (#:inputs . (((#:name . "guix")
> 		  (#:url . "git://git.savannah.gnu.org/guix.git")
> 		  (#:load-path . ".")
> 		  (#:branch . "master")
> 		  (#:no-compile? . #t))
> 		 ((#:name . "pkginput")
> 		  (#:url . "git://git.savannah.gnu.org/guix/guix-cuirass.git")
> 		  (#:load-path . ".")
> 		  (#:branch . "master")
> 		  (#:no-compile? . #t))
> 		 ))))

It's because the 'proc' you use (CUIRASS-JOBS, from the Guix
repository), interprets the first input it finds as a Guix checkout.
There's a comment about this[1]:

    ;; Extract metadata about the 'guix' checkout.  Its key in ARGUMENTS may
    ;; vary, so pick up the first one that's neither 'subset' nor 'systems'.

The argument list you sent to 'proc' looked like this:

    '((pkginput
       (no-compile? . #t)
       (load-path . ".")
       (revision . "8bf095fc503ddac18a9457e1379e497ae16324fa")
       (file-name . "/gnu/store/fcq3axxh5kpva6kphi58ibklfz4wnbnr-cuirass-8bf095f"))
      (guix
       (no-compile? . #t)
       (load-path . ".")
       (revision . "3e9ca3358a8cfffaeb4997389bb767065e70876a")
       (file-name . "/gnu/store/5nmsf6464vhdifmvzassp3b3cwfis5j4-guix-3e9ca33"))
      (subset . "hello"))

so the 'proc' thought 'pkginput' was a Guix checkout and tried to build
Guix with a Cuirass source, which obviously doesn't work.  (It fails
line 60 of [1].)

If the input name were "cuirass" instead of "pkginput", you would have
sent:

    '((guix
       (no-compile? . #t)
       (load-path . ".")
       (revision . "3e9ca3358a8cfffaeb4997389bb767065e70876a")
       (file-name . "/gnu/store/5nmsf6464vhdifmvzassp3b3cwfis5j4-guix-3e9ca33"))
      (cuirass
       (no-compile? . #t)
       (load-path . ".")
       (revision . "8bf095fc503ddac18a9457e1379e497ae16324fa")
       (file-name . "/gnu/store/fcq3axxh5kpva6kphi58ibklfz4wnbnr-cuirass-8bf095f"))
      (subset . "hello"))

And it would have worked.

So it's indeed a bug in Guix, introduced by commit
b5f8c2c88543158e8aca76aa98f9009f6b9e743a (hydra: Compute jobs in an
inferior).  We can't just take the first input we find, build it and
open an inferior for it.  I believe we should take the input whose name
is "guix" (as we do with manifests[2]).

What do you think?

Clément

[1]: https://git.savannah.gnu.org/cgit/guix.git/tree/build-aux/hydra/gnu-system.scm#n40
[2]: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/ci.scm#n361




Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Sun, 17 Nov 2019 10:47:01 GMT) Full text and rfc822 format available.

Message #22 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Reza Alizadeh Majd <r.majd <at> pantherx.org>, Ludovic Courtès <ludo <at> gnu.org>
Cc: 36378 <at> debbugs.gnu.org
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Sun, 17 Nov 2019 11:45:56 +0100
Clément Lassieur <clement <at> lassieur.org> writes:

> So it's indeed a bug in Guix, introduced by commit
> b5f8c2c88543158e8aca76aa98f9009f6b9e743a (hydra: Compute jobs in an
> inferior).  We can't just take the first input we find, build it and
> open an inferior for it.  I believe we should take the input whose name
> is "guix" (as we do with manifests[2]).

Well, we need something a bit more subtle, because in
https://ci.guix.info Guix inputs are named "core-updates", "guix",
"guix-modular", "staging", "version-1.0.0", "version-1.0.1",
"wip-haskell-updates".




Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Sun, 17 Nov 2019 16:17:02 GMT) Full text and rfc822 format available.

Message #25 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Reza Alizadeh Majd <r.majd <at> pantherx.org>, Ludovic Courtès <ludo <at> gnu.org>
Cc: 36378 <at> debbugs.gnu.org
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Sun, 17 Nov 2019 17:16:32 +0100
[Message part 1 (text/plain, inline)]
Clément Lassieur <clement <at> lassieur.org> writes:

>> So it's indeed a bug in Guix, introduced by commit
>> b5f8c2c88543158e8aca76aa98f9009f6b9e743a (hydra: Compute jobs in an
>> inferior).  We can't just take the first input we find, build it and
>> open an inferior for it.  I believe we should take the input whose name
>> is "guix" (as we do with manifests[2]).
>
> Well, we need something a bit more subtle, because in
> https://ci.guix.info Guix inputs are named "core-updates", "guix",
> "guix-modular", "staging", "version-1.0.0", "version-1.0.1",
> "wip-haskell-updates".

Attached is a patch that makes sure the checkout is from the Guix input
providing the 'proc'.

I'm not sure about one thing: in gnu/ci.scm I call FIND-CURRENT-CHECKOUT
in case the current Guix is not an inferior.  But I don't know if it can
happen.  If it can't happen, we could just do:

  (define checkout
    (assq-ref arguments 'superior-guix-checkout))

What do you think?
Clément

[0001-ci-Make-sure-the-Guix-checkout-is-the-one-providing-.patch (text/x-diff, inline)]
From f484bba1b8a202dce6e6ac01d19eaee0b40b2501 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= <clement <at> lassieur.org>
Date: Sun, 17 Nov 2019 13:29:19 +0100
Subject: [PATCH] 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 <at> 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.
---
 build-aux/hydra/gnu-system.scm | 36 +++++++++++++++++++++-------------
 gnu/ci.scm                     | 22 +++++++++++++--------
 2 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index 775bbd9db2..f54302cf63 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke <at> gnu.org>
-;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
+;;; Copyright © 2018, 2019 Clément Lassieur <clement <at> lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,16 +34,22 @@
 (setvbuf (current-error-port) _IOLBF)
 (set-current-output-port (current-error-port))
 
+(define (find-current-checkout arguments)
+  "Find the first checkout of ARGUMENTS that provided the current file.
+Return #f if no such checkout is found."
+  (let ((current-root
+         (canonicalize-path
+          (string-append (dirname (current-filename)) "/../.."))))
+    (find (lambda (argument)
+            (and=> (assq-ref argument 'file-name)
+                   (lambda (name)
+                     (string=? name current-root)))) arguments)))
+
 (define (hydra-jobs store arguments)
   "Return a list of jobs where each job is a NAME/THUNK pair."
+
   (define checkout
-    ;; Extract metadata about the 'guix' checkout.  Its key in ARGUMENTS may
-    ;; vary, so pick up the first one that's neither 'subset' nor 'systems'.
-    (any (match-lambda
-           ((key . value)
-            (and (not (memq key '(systems subset)))
-                 value)))
-         arguments))
+    (find-current-checkout arguments))
 
   (define commit
     (assq-ref checkout 'revision))
@@ -70,9 +76,11 @@
            ((name . fields)
             ;; Hydra expects a thunk, so here it is.
             (cons name (lambda () fields))))
-         (inferior-eval-with-store inferior store
-                                   `(lambda (store)
-                                      (map (match-lambda
-                                             ((name . thunk)
-                                              (cons name (thunk))))
-                                           (hydra-jobs store ',arguments)))))))
+         (inferior-eval-with-store
+          inferior store
+          `(lambda (store)
+             (map (match-lambda
+                    ((name . thunk)
+                     (cons name (thunk))))
+                  (hydra-jobs store '((superior-guix-checkout . ,checkout)
+                                      ,@arguments))))))))
diff --git a/gnu/ci.scm b/gnu/ci.scm
index f24049e772..d6eb2d018f 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke <at> gnu.org>
-;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
+;;; Copyright © 2018, 2019 Clément Lassieur <clement <at> lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -374,6 +374,17 @@ valid."
                              load-manifest)
                     manifests))))
 
+(define (find-current-checkout arguments)
+  "Find the first checkout of ARGUMENTS that provided the current file.
+Return #f if no such checkout is found."
+  (let ((current-root
+         (canonicalize-path
+          (string-append (dirname (current-filename)) "/.."))))
+    (find (lambda (argument)
+            (and=> (assq-ref argument 'file-name)
+                   (lambda (name)
+                     (string=? name current-root)))) arguments)))
+
 
 ;;;
 ;;; Hydra entry point.
@@ -396,13 +407,8 @@ valid."
       ((? string? str) (call-with-input-string str read))))
 
   (define checkout
-    ;; Extract metadata about the 'guix' checkout.  Its key in ARGUMENTS may
-    ;; vary, so pick up the first one that's neither 'subset' nor 'systems'.
-    (any (match-lambda
-           ((key . value)
-            (and (not (memq key '(systems subset)))
-                 value)))
-         arguments))
+    (or (find-current-checkout arguments)
+        (assq-ref arguments 'superior-guix-checkout)))
 
   (define commit
     (assq-ref checkout 'revision))
-- 
2.23.0


Information forwarded to bug-guix <at> gnu.org:
bug#36378; Package guix. (Sat, 30 Nov 2019 10:35:02 GMT) Full text and rfc822 format available.

Message #28 received at 36378 <at> debbugs.gnu.org (full text, mbox):

From: clement <at> lassieur.org (Clément Lassieur)
To: Reza Alizadeh Majd <r.majd <at> pantherx.org>
Cc: 36378 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Sat, 30 Nov 2019 11:34:00 +0100
Hi,

Clément Lassieur <clement <at> lassieur.org> writes:

> Attached is a patch that makes sure the checkout is from the Guix input
> providing the 'proc'.

I'll push this tomorrow if nobody objects.

Thanks,
Clément




Reply sent to clement <at> lassieur.org (Clément Lassieur):
You have taken responsibility. (Sun, 01 Dec 2019 10:33:02 GMT) Full text and rfc822 format available.

Notification sent to "Reza Alizadeh Majd" <r.majd <at> pantherx.org>:
bug acknowledged by developer. (Sun, 01 Dec 2019 10:33:02 GMT) Full text and rfc822 format available.

Message #33 received at 36378-done <at> debbugs.gnu.org (full text, mbox):

From: clement <at> lassieur.org (Clément Lassieur)
To: Reza Alizadeh Majd <r.majd <at> pantherx.org>
Cc: 36378-done <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#36378: Guix Cuirass Issue with Input channels
Date: Sun, 01 Dec 2019 11:32:43 +0100
Pushed, closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.