help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug? Importing (gnu rest ...) fails due to lack of patch files on build


From: David Dashyan
Subject: Bug? Importing (gnu rest ...) fails due to lack of patch files on build side.
Date: Mon, 12 Apr 2021 12:48:14 +0300
User-agent: mu4e 1.4.15; emacs 27.2

Hello Guix!

I've been having lots of fun with derivations and gexps lately :)

There are couple of quirks I stumbled upon and I'm not sure whether It's
a bug or I'm doing weird things.

Take a look at this snippet:

(define select?
  (match-lambda
    (('guix  'config)   #f)
    (('guix  rest ...)  #t)
    (('gnu   rest ...)  #t)
    (_ #f)))

(with-store store
  (let* ((exp (with-extensions (list guile-gcrypt)
                (with-imported-modules
                    `(((guix config) => ,(make-config.scm))
                      ,@(source-module-closure
                         '((gnu packages base)) #:select? select?))
                  #~(pk 'hello))))
         (drv (run-with-store store
                (mlet %store-monad ((drv (gexp->script "error" exp)))
                  (return drv)))))
    (build-derivations store (list drv))))

Here I building derivation producing dummy script that pk-ing 'hello.
The point really is to try to include source module closure containing
(gnu packages base), or really almost any (gnu rest ..) module that
requires loading package patches.  As I found looking at .drv file
dependencies patch files are not included there.

Here is the tail of error trace-back:

222:17 11 (map1 (((gnu packages gnuzilla)) ((gnu packages #)) # ?))
  3297:17 10 (resolve-interface (gnu packages gnuzilla) #:select _ # ?)
In ice-9/threads.scm:
    390:8  9 (_ _)
In ice-9/boot-9.scm:
  3223:13  8 (_)
In ice-9/threads.scm:
    390:8  7 (_ _)
In ice-9/boot-9.scm:
  3507:20  6 (_)
   2806:4  5 (save-module-excursion _)
  3527:26  4 (_)
In unknown file:
           3 (primitive-load-path "gnu/packages/gnuzilla" #<procedur?>)
In ice-9/eval.scm:
   626:19  2 (_ #<directory (gnu packages gnuzilla) 7fffee6206e0>)
   293:34  1 (_ #(#(#(#(#(#(#(#(#(#<direc?> ?) ?) ?) ?) ?) ?) ?) ?) ?))
    159:9  0 (_ #(#(#(#(#(#(#(#(#(#<direc?> ?) ?) ?) ?) ?) ?) ?) ?) ?))

ice-9/eval.scm:159:9: ERROR:
  1. &formatted-message:
      format: "~a: patch not found\n"
      arguments: ("icecat-use-older-reveal-hidden-html.patch")
builder for 
`/gnu/store/7g4kk1ncyh2s3yb55rhpblks4z3bf27h-module-import-compiled.drv' failed 
with exit code 1
cannot build derivation 
`/gnu/store/ksjs8j167mgj1bpqvqnf0rci9pv7ib3k-error.drv': 1 dependencies 
couldn't be built
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
ERROR:
  1. &store-protocol-error:
      message: "build of 
`/gnu/store/ksjs8j167mgj1bpqvqnf0rci9pv7ib3k-error.drv' failed"
      status: 100

So again.  Is it supposed to work?  I think it could have gone unnoticed
because after searching through guix repo I found that (gnu rest ...)
are generally not included in with-imported-modules.

Some context to why am I doing it in the first place.
I found this out while I was implementing "guix-cloud-init" service.
The service to simplify guix deployment to digialocean, aws and others.
Cloud-init is widely used way of configuring cloud vm instances and it
works by providing metadata via mounted storage or link-local address
http endpoint.  This includes ip addresses, devices, ssh keys etc...  So
given you have a guix image with guix-cloud-init service you can upload
to your cloud and it will "just work". :)

So my thinking was that I will write shepherd-root-service extension
that will query metadata import (gnu services ...) modules and run them
with values gotten from metadata.  To be honest it feels a bit hackish
to me, but I didn't find any other ways to make such service and reuse
existing code.

Comments are much appreciated!

P.S. Side note to macrologysts out there...
If I embed select? into with-imported-modules form like so:

(with-imported-modules
    `(((guix config) => ,(make-config.scm))
      ,@(source-module-closure
         '((gnu packages base))
         #:select? (match-lambda
                     (('guix  'config)   #f)
                     (('guix  rest ...)  #t)
                     (('gnu   rest ...)  #t)
                     (_ #f))))
  #~(pk 'hello))

I get this:

While compiling expression:
Syntax error:
unknown file:139:0: syntax: extra ellipsis in form (syntax (quasiquote
(((guix config) => (unquote (make-config.scm))) (unquote-splicing
(source-module-closure (quote ((gnu packages base))) #:select?
(match-lambda (((quote guix) (quote config)) #f) (((quote guix) rest
...) #t) (((quote gnu) rest ...) #t) (_ #f)))))))

Any ideas why is that?

-- 
David aka zzappie



reply via email to

[Prev in Thread] Current Thread [Next in Thread]