From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yPk1A2WMdGBi/QAAgWs5BA (envelope-from ) for ; Mon, 12 Apr 2021 20:07:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AJyKOGSMdGA+LgAAbx9fmQ (envelope-from ) for ; Mon, 12 Apr 2021 18:07:32 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 59C4C28504 for ; Mon, 12 Apr 2021 20:07:32 +0200 (CEST) Received: from localhost ([::1]:56714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW0yB-0007uY-9s for larch@yhetil.org; Mon, 12 Apr 2021 14:07:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVtBN-0003xi-Dq for help-guix@gnu.org; Mon, 12 Apr 2021 05:48:37 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:37983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVtBK-0007X5-TX for help-guix@gnu.org; Mon, 12 Apr 2021 05:48:36 -0400 X-Originating-IP: 185.213.154.169 Received: from neinpad (unknown [185.213.154.169]) (Authenticated sender: mail@davie.li) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 36338E000E for ; Mon, 12 Apr 2021 09:48:29 +0000 (UTC) User-agent: mu4e 1.4.15; emacs 27.2 From: David Dashyan To: Guix Help Subject: Bug? Importing (gnu rest ...) fails due to lack of patch files on build side. Date: Mon, 12 Apr 2021 12:48:14 +0300 Message-ID: <87blajj0kh.fsf@davie.li> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.196; envelope-from=mail@davie.li; helo=relay4-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 12 Apr 2021 14:02:14 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618250852; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=kNEjBKOtCQ9g9wwC0Z48jRkmUrZMNu/W/5eGAKoQvTc=; b=NolyGB6XWkPswtiOZTks+flYfxsxZq/K3JJ99xEUnv5V7xcMRCSjKNTzOqAK13R65Lp4Up MgO8/XyNLQjWRWgdXgIHz/HDylI4jzNdjqXD8fo89IF6MreRf9KHJuY3/lOs7LysqI+ufi evTTk4hqFb46lui3CxI60fhyBINMwQ78zxYuk++jum1Dqg5aMa+L7W/O/ONyp8mwsftFbw VYW1sW96E0HtQwJ2kifNzZ8VruwBgPJmPyRIX9czQ0+PNhUX2+dKBPxHv8qoNLDpCXb+oy vLXn1AFU7QwWsTk3ZMrjKCTW7tRpdCafhRzS83O9E1ml6bmR7rp8Y7Ib+BD2PQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618250852; a=rsa-sha256; cv=none; b=CC/NFY1NPTRO5bKHvU+u7F7CQKtPHHfa2oCnC3aR6w+sATB41WGQ0X7Z2UZUbtqGZXU4lF ENFsnKRsPoExSNF7DaDDGEaQF34Uczn9kEEEKBsFYRffkh0bJ4gjtnE7A7BQsja0Yp4OET /hJ0pMIKKkih2WYOHRydTUE0zRt+YmNv70+dUQM7/rT0y6ZP6bxw9qfkWoBsRKFFI5kjiB Y7MMthpi/BQBa2v+AHB0MlJk2+rnngs0IMYYh4ctyUIyFld+Fd7zT593ko0xyfbtN71kf/ sJbP9hTK0rHXz3neCvRCkHIAC9BuIJcaWk5bfs2Nxi0OUvpy+Y3rcQrkw9Dx8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 59C4C28504 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: g0FdkQ9Av0YM 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" #) In ice-9/eval.scm: 626:19 2 (_ #) 293:34 1 (_ #(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?)) 159:9 0 (_ #(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?)) 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