Subject: Re: bug#47949: Failed to produce output path for guix-package-cache

From: Simon Tournier <[email-masked]>
Date: Thu, 04 May 2023 20:05:09 +0200

Hi Maxim,

On jeu., 04 mai 2023 at 08:53, Maxim Cournoyer <[email-masked]> wrote:

> [0]  https://gitlab.com/Apteryks/sfl-guix-channel

>From a Guile point of view, where the symbol ’python-pycrypto’ [1,2] is
it defined?  And it’s defined nowhere.

I would suggest to bind the symbol ’python-pycrypto’ to a package from
an inferior.  Hum, but that’s not working as expected…

Applying this patch:

--8<---------------cut here---------------start------------->8---
diff --git a/sfl/packages/sflvault.scm b/sfl/packages/sflvault.scm
index 74a975f..eb04a5b 100644
--- a/sfl/packages/sflvault.scm
+++ b/sfl/packages/sflvault.scm
@@ -8,7 +8,28 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix packages)
-  #:use-module (guix build-system python))
+  #:use-module (guix build-system python)
+
+  #:use-module (guix inferior)
+  #:use-module (guix channels)
+  #:use-module (srfi srfi-1))
+
+(define channels
+  ;; This is the old revision from which we want to
+  ;; extract guile-json.
+  (list (channel
+         (name 'guix)
+         (url "https://git.savannah.gnu.org/git/guix.git")
+         (commit
+          "9ed65e6af77893b658a7159b091b5002892c2f95"))))
+
+(define inferior
+  ;; An inferior representing the above revision.
+  (inferior-for-channels channels))
+
+(define python-pycrypto
+  (first (lookup-inferior-packages inferior "python-pycrypto")))
+
 
 ;;; python-keyring > 1.6.1 API has changed, which breaks 'sflvault
 ;;; wallet' (see:
--8<---------------cut here---------------end--------------->8---

then that works:

--8<---------------cut here---------------start------------->8---
$ guix show -L sfl-guix-channel python-sflvault-common
name: python-sflvault-common
version: 0.9.2-2.120617c
outputs:
+ out: everything
systems: x86_64-linux i686-linux
dependencies: [email-masked]
location: sfl-guix-channel/sfl/packages/sflvault.scm:84:2
homepage: https://www.sflvault.org
license: GPL 3+
synopsis: Network credentials store and authentication manager library  
description: This package is a Python library that contains code common to the
+ SFLvault server and its clients.

$ guix time-machine --commit=9ed65e6af77893b658a7159b091b5002892c2f95 \
       -- build python-pycrypto --no-grafts --check -K -q
/gnu/store/3kbr3lnwajc16a7w2jq3knxsphlrqkrz-python-pycrypto-2.6.1

$ guix time-machine --commit=9ed65e6af77893b658a7159b091b5002892c2f95 \
       -- build python-pycrypto --check -K -q
/gnu/store/yrpcsjjb3b5wr2jahp5rbr8vbbg1n3yg-python-pycrypto-2.6.1

$ guix build -L sfl-guix-channel -e '(@@ (sfl packages sflvault) python-pycrypto)'
/gnu/store/yrpcsjjb3b5wr2jahp5rbr8vbbg1n3yg-python-pycrypto-2.6.1
--8<---------------cut here---------------end--------------->8---

However, then this,

    guix build -L sfl-guix-channel python-sflvault-common

fails with:

--8<---------------cut here---------------start------------->8---
starting phase `sanity-check'
validating 'SFLvault-common' /gnu/store/r3kfygxwzpnsia687bf0d1xsval5cid7-python-sflvault-common-0.9.2-2.120617c/lib/python3.10/site-packages
...checking requirements: ERROR: SFLvault-common==0.9.2 DistributionNotFound(Requirement.parse('pycrypto'), {'SFLvault-common'})
error: in phase 'sanity-check': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py" "/gnu/store/r3kfygxwzpnsia687bf0d1xsval5cid7-python-sflvault-common-0.9.2-2.120617c/lib/python3.10/site-packages") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `sanity-check' failed after 0.1 seconds
command "python" "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py" "/gnu/store/r3kfygxwzpnsia687bf0d1xsval5cid7-python-sflvault-common-0.9.2-2.120617c/lib/python3.10/site-packages" failed with status 1
builder for `/gnu/store/6i075y53h83rasrw898n6qnsn673hnll-python-sflvault-common-0.9.2-2.120617c.drv' failed with exit code 1
build of /gnu/store/6i075y53h83rasrw898n6qnsn673hnll-python-sflvault-common-0.9.2-2.120617c.drv failed
View build log at '/var/log/guix/drvs/6i/075y53h83rasrw898n6qnsn673hnll-python-sflvault-common-0.9.2-2.120617c.drv.gz'.
guix build: error: build of `/gnu/store/6i075y53h83rasrw898n6qnsn673hnll-python-sflvault-common-0.9.2-2.120617c.drv' failed
--8<---------------cut here---------------end--------------->8---

Bah I do not know.  Somehow, it would be the strategy I would try to follow.

Last, I get an error:

--8<---------------cut here---------------start------------->8---
$ cat channels.scm
(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git")
        (branch "master")
        (commit
          "fa685c87eaa9888a4278f39bb2b815673589dced"))
      (channel
        (name 'sfl)
        (url "file:///tmp/sfl-guix-channel")
        (branch "master")
        (commit
         "11bbb36e28ee80ce17785f09b33ed20af18d4832"
         ;"bc6b32b116d3e62b5f41cb73df63a6024f1324ba"
         )))
         
$ guix time-machine -C /tmp/channels.scm -- help
[...]

building /gnu/store/56ilhij5y51xg5znaspwk2zl731bq8za-sfl.drv...
|builder for `/gnu/store/56ilhij5y51xg5znaspwk2zl731bq8za-sfl.drv' failed to produce output path `/gnu/store/nlpvr38p83jwrwcsj1czwhi8r2jpa2ic-sfl'
build of /gnu/store/56ilhij5y51xg5znaspwk2zl731bq8za-sfl.drv failed
View build log at '/var/log/guix/drvs/56/ilhij5y51xg5znaspwk2zl731bq8za-sfl.drv.gz'.
cannot build derivation `/gnu/store/spikfdg9lhxy98z33dqiv6clmjm2kwv6-profile.drv': 1 dependencies couldn't be built
guix time-machine: error: build of `/gnu/store/spikfdg9lhxy98z33dqiv6clmjm2kwv6-profile.drv' failed
--8<---------------cut here---------------end--------------->8---

which reads,

--8<---------------cut here---------------start------------->8---
(repl-version 0 1 1)
(exception %exception (non-self-quoting 140737182622144 "#<&store-connection-error file: \"/var/guix/daemon-socket/socket\" errno: 2>"))
--8<---------------cut here---------------end--------------->8---

Hum?!

Cheers,
simon

1: https://gitlab.com/Apteryks/sfl-guix-channel/-/blob/master/sfl/packages/sflvault.scm#L75
2: https://gitlab.com/Apteryks/sfl-guix-channel/-/blob/master/sfl/packages/sflvault.scm#L99

PS: Please note that the example from the manual [#] fails with Guix
fa685c8:

--8<---------------cut here---------------start------------->8---
$ cat manifest.scm
(use-modules (guix inferior) (guix channels)
             (srfi srfi-1))   ;for 'first'

(define channels
  ;; This is the old revision from which we want to
  ;; extract guile-json.
  (list (channel
         (name 'guix)
         (url "https://git.savannah.gnu.org/git/guix.git")
         (commit
          "65956ad3526ba09e1f7a40722c96c6ef7c0936fe"))))

(define inferior
  ;; An inferior representing the above revision.
  (inferior-for-channels channels))

;; Now create a manifest with the current "guile" package
;; and the old "guile-json" package.
(packages->manifest
 (list (first (lookup-inferior-packages inferior "guile-json"))
       (specification->package "guile")))

$ guix build -m manifest.scm
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
The following derivations will be built:
  /gnu/store/01d4kdfqx0hq2lj0ir9yk7fl3kmpanyh-compute-guix-derivation.drv
  /gnu/store/1dgn5q7q8gm5y9dssaws2bbcdvwznvj9-module-import-compiled.drv
  /gnu/store/xxrxdi543lcfmw43svp8nxpbp3d3d4rd-module-import-compiled.drv
building path(s) `/gnu/store/hrvp38jfh5gvdhd2rh4v2rxk39vvgzi9-module-import-compiled'
[ 1/78] Loading './gnu/packages/bootstrap.scm'...
Backtrace:
In ice-9/boot-9.scm:
  2887:24 19 (_)
   222:17 18 (map1 (((guix config)) ((srfi srfi-1)) ((srfi #)) (#) ?))
  2800:17 17 (resolve-interface (guix config) #:select _ #:hide _ # _ ?)
In ice-9/threads.scm:
    390:8 16 (_ _)
In ice-9/boot-9.scm:
  2726:13 15 (_)
In ice-9/threads.scm:
    390:8 14 (_ _)
In ice-9/boot-9.scm:
  2994:20 13 (_)
   2312:4 12 (save-module-excursion #<procedure 7ffff7818090 at ice-?>)
  3014:26 11 (_)
In unknown file:
          10 (primitive-load-path "guix/config" #<procedure 7ffff77e?>)
In ice-9/eval.scm:
   721:20  9 (primitive-eval (begin (define-module (guix #) # (?)) #))
In ice-9/psyntax.scm:
  1235:36  8 (expand-top-sequence ((begin (define-module (# ?) ?) ?)) ?)
  1182:24  7 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
  1182:24  6 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
  1182:24  5 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
   285:10  4 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) ?)
In ice-9/eval.scm:
   626:19  3 (_ #<directory (guix config) 7fffeebd45a0>)
   182:19  2 (proc #<directory (guix config) 7fffeebd45a0>)
   142:16  1 (compile-top-call _ (7 . repository) ((10 (13 . #) #) ?))
In unknown file:
           0 (%resolve-variable (7 . repository) #<directory (guix c?>)

ERROR: In procedure %resolve-variable:
Unbound variable: repository
builder for `/gnu/store/1dgn5q7q8gm5y9dssaws2bbcdvwznvj9-module-import-compiled.drv' failed with exit code 1
cannot build derivation `/gnu/store/01d4kdfqx0hq2lj0ir9yk7fl3kmpanyh-compute-guix-derivation.drv': 1 dependencies couldn't be built
guix build: error: exception thrown: #<&store-protocol-error message: "build of `/gnu/store/01d4kdfqx0hq2lj0ir9yk7fl3kmpanyh-compute-guix-derivation.drv' failed" status: 100>
--8<---------------cut here---------------end--------------->8---

#: https://guix.gnu.org/manual/devel/en/guix.html#Inferiors