From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id X+g/IAaYhWD9KQEAgWs5BA (envelope-from ) for ; Sun, 25 Apr 2021 18:25:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4B3JGgaYhWA2UgAA1q6Kng (envelope-from ) for ; Sun, 25 Apr 2021 16:25:42 +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 CA312170CB for ; Sun, 25 Apr 2021 18:25:41 +0200 (CEST) Received: from localhost ([::1]:55104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lahZk-0000Bn-UU for larch@yhetil.org; Sun, 25 Apr 2021 12:25:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lahZH-00008Y-AP for help-guix@gnu.org; Sun, 25 Apr 2021 12:25:11 -0400 Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]:44804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lahZE-0005LV-1O for help-guix@gnu.org; Sun, 25 Apr 2021 12:25:10 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by andre.telenet-ops.be with bizsmtp id x4R12400a0mfAB4014R2u9; Sun, 25 Apr 2021 18:25:02 +0200 Message-ID: Subject: Re: Bug? Importing (gnu rest ...) fails due to lack of patch files on build side. From: Maxime Devos To: David Dashyan , Guix Help Date: Sun, 25 Apr 2021 18:24:57 +0200 In-Reply-To: <87blajj0kh.fsf@davie.li> References: <87blajj0kh.fsf@davie.li> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-hp9eJURu/37+NanRQDyW" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1619367904; bh=ryBRq6eeDP616peGAc8z6AgoQgLjCtW2b+UIGbBxliE=; h=Subject:From:To:Date:In-Reply-To:References; b=F6YaKn0+dqYFRjProbGYU4S1TOWzNFp1UBN+vM1b/QHPd4/Au2K+bCVqKTOfCwC8J 1vQtQ44NRngSlqU6MgafU/fuzUI+w9UtT7tTaohgktX7RL9j/ciZjHKMYzC57MpMz2 p90P4aB5rTwXegFbtqFrFceAsF0Q518UUKv8DNvtn1Tdamdkkqu5oZTifeJkYPFUxR EKTxtQd03cvxbaBoXKkDY2gEjm36s5FXFzxjWHtslks5sFZtEIOavNxRTIVtHKv7X+ BilmMD9NCyM1JMjKz0Ct9v0+7DnPjWEqO+NgS/FHtXD87cUPsOEucjVnOyGTuAp76r unD30ffwAKtcQ== Received-SPF: pass client-ip=2a02:1800:120:4::f00:15; envelope-from=maximedevos@telenet.be; helo=andre.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1619367942; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ryBRq6eeDP616peGAc8z6AgoQgLjCtW2b+UIGbBxliE=; b=Cv0jGOhXwf76zdPfjk5YKyQxMjBikTfr6EriW3lcQv8G2/zZ4MhhepRoetqOaBtgYcud0G USjmeAvNBrSkUS91IzZq/dublQ+Dp9rnKMyV5T8GayXiEm1BU6mKZq+S0krZs5wE3MiLom K8MZsbaJayym+kE8wIqMyU6WdCELZ7uTdV7zTKom/moyJpxbvuiCG3FkyEa8MYhVd78/CF O19LiOaulDdZEr49haTCRWe/ZP/4260510Mh0ICnT9dXZmlF+O72w3pD8NiavrgHzvJHh+ Wbb2Om+ZmmsoQBhucgs+I4PlMlq/mgWf3JH7QFIrfe0Gw3NwJ8hYvY+deUVgAQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619367942; a=rsa-sha256; cv=none; b=E73X4N3wyqTNs3uZ9aDu/yzx1mVHh+JTewywqus09HN4XSSsWc2oNm4wR14Zdnw2IY4zLn CQuZFBCEETvcFR3yM61gRUQS8vr4SANzaoXFwDYdBFsJB1mvGGZE9XSIA1Cg2C9uCcGBRh e6punswPgtCOqu8/PtF1ecJXtYyelNO9KS7kucnGggDChNpDVbLqjkAoBLUBlDsti+PAL6 1WBaKsO7VKVhP7zkwkFQkuq339lm0Ep/7GckvDOIvilFOZddnweYqrvMmGdC2phxh6QFNn e5dECHFO3xdgGaayeMpHX/3AbbZr1qyNwuS5aemWbV7sWWvDeO4yubn/thojqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=F6YaKn0+; dmarc=pass (policy=none) header.from=telenet.be; 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: -5.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=F6YaKn0+; dmarc=pass (policy=none) header.from=telenet.be; 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: CA312170CB X-Spam-Score: -5.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: bVAiZZAn8Uuv --=-hp9eJURu/37+NanRQDyW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable David Dashyan schreef op ma 12-04-2021 om 12:48 [+0300]: > Hello Guix! >=20 > I've been having lots of fun with derivations and gexps lately :) >=20 > There are couple of quirks I stumbled upon and I'm not sure whether It's > a bug or I'm doing weird things. >=20 > Take a look at this snippet: >=20 > (define select? > (match-lambda > (('guix 'config) #f) > (('guix rest ...) #t) > (('gnu rest ...) #t) > (_ #f))) >=20 > (with-store store > (let* ((exp (with-extensions (list guile-gcrypt) > (with-imported-modules > `(((guix config) =3D> ,(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)))) >=20 > 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. >=20 > Here is the tail of error trace-back: >=20 > 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 (_ #(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?)) >=20 > 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-co= mpiled.drv' failed with exit code 1 > cannot build derivation `/gnu/store/ksjs8j167mgj1bpqvqnf0rci9pv7ib3k-erro= r.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-err= or.drv' failed" > status: 100 >=20 > 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. No, it is not supposed to work! Only guix/build/... and gnu/build/utils/..= . (and maybe others I forgot) are supposed to be imported, so source-module-c= losure excludes other modules. The reason is that gnu/packages/*.scm are supposed= to be changeable without causing any change in derivation hash (and therefore res= ulting in rebuilds). > Some context to why am I doing it in the first place. > I found this out while I was implementing "guix-cloud-init" service. Instead of importing (gnu packages ...), you could use (with-extensions (list guix) ...), where guix is the guix package. Then there's no need for with-imported-modules IIUC. That package isn't always the newest though (it is primarily used for the guix-daemon, for cuirass, emacs-guix and some others), so consider using an inferior or something. > 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". :) Do you know about "guix deploy"? > 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. Not sure what you're trying to do there. =E2=80=98query metadata import=E2= =80=99 and =E2=80=98run them with values from metadata=E2=80=99 is a bit vague. > 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. >=20 > Comments are much appreciated! >=20 > P.S. Side note to macrologysts out there... > If I embed select? into with-imported-modules form like so: >=20 > (with-imported-modules > `(((guix config) =3D> ,(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 wonder what would happen if you replace #t with (and (list rest ...) #t)? =20 > Any ideas why is that? There seems to be some kind of hygiene problem here. Perhaps take a look at the definition of with-imported-modules and match-lambda. Greetings, Maxime --=-hp9eJURu/37+NanRQDyW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIWX2RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jQFAP0bjeRZTYJGzQmPkvzi3gobRVpd x+P5mXRUgHbRT501TAEAhUlCnLhzCagV02F0zHmihVJS15FUJDLyKOsVNgZo+A4= =Vvi6 -----END PGP SIGNATURE----- --=-hp9eJURu/37+NanRQDyW--