all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug? Importing (gnu rest ...) fails due to lack of patch files on build side.
@ 2021-04-12  9:48 David Dashyan
  2021-04-13 22:10 ` David Dashyan
  2021-04-25 16:24 ` Maxime Devos
  0 siblings, 2 replies; 7+ messages in thread
From: David Dashyan @ 2021-04-12  9:48 UTC (permalink / raw)
  To: Guix Help


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-27 18:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-12  9:48 Bug? Importing (gnu rest ...) fails due to lack of patch files on build side David Dashyan
2021-04-13 22:10 ` David Dashyan
2021-04-16 14:10   ` Joshua Branson
2021-04-17 21:39     ` David Dashyan
2021-04-25 16:24 ` Maxime Devos
2021-04-27 17:03   ` David Dashyan
2021-04-27 17:36     ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.