From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4LqzAZU8kGN6RQAAbAwnHQ (envelope-from ) for ; Wed, 07 Dec 2022 08:11:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qFfSAJU8kGMYJwAAG6o9tA (envelope-from ) for ; Wed, 07 Dec 2022 08:11:17 +0100 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 CA8DB7D58 for ; Wed, 7 Dec 2022 08:11:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2oZx-00021R-CE; Wed, 07 Dec 2022 02:10:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2oZn-0001zA-Vd for help-guix@gnu.org; Wed, 07 Dec 2022 02:10:44 -0500 Received: from koszko.org ([93.95.227.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2oZl-0003y9-Il for help-guix@gnu.org; Wed, 07 Dec 2022 02:10:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zC6Lk/6hfxttNW9/fzqmJKczu6U/wSnjMjGyWJAdTvk=; b=nzoo4vcBjgDZx+yKVyGbwa6Qfc In0BttDw3RHVdOW7BRRXMqnqpPy1g5gKa/L/MuUuOoCYNZby5zVHwPwYSCCAZiIazuComoxQqb7CD UFwrzoX7EHtrZnEODmEdD8y9BNrweYXsCVXjD5X/xc4xGnjVpnQlcwwgo5HCohOJVLs5iMlt6NVXX SSIkhdVW80oeR0v5MRuYcTq/j6LqTYHZwM483cQHSHFYz/WLyf5vF43dbPFP9uzdeuwb6oKXiGm2/ ZubFngxCxWZPGPgg/G/CrQIZirP6RbTn5f/39Qz0spwZr38wAvVsoiE6Q8l4mnEdiIfy1jwmpLtFK mmF6P8OjTVPY+CZSQVCmJo33kTLyNJ0gxlJuqB6N+2eHbZWY/MpgL4R4lWVwzHrHwMfxCCNKkJCHh nTcbNB/jI1V8SoB4FzcXgqJCMsCsmr/uhgRfPw+YZwCBypSlGRMXHGLIc2RULgrXF7VkJddEs5OHC 33/RhvJ4SiYpE5oWo0sO7HCuDJTHNDKq22knqM7v1GcLu2amhowxP4+CYtV8dPjfoLxiWZu1UxDrk C8RH8Tl49eMubPs+Ouf+Bt+1RNIWeSbhkTtfJ2YUHyiUOwNpyh48Lt4j7IC4t0l/JalCOfk84BmtJ fYS0OwEOmacdVXZbX/Ljnk8dTa7+3dDVR6Zf+eYew=; Received: from [77.252.47.239] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2oZf-0003l4-8C; Wed, 07 Dec 2022 08:10:35 +0100 Date: Wed, 7 Dec 2022 08:10:33 +0100 To: jgart Cc: Guix Help Subject: Re: doubly quoted list in gnu-build Message-ID: <20221207081033.5abcf461.koszko@koszko.org> In-Reply-To: <20221207001451.GB32178@dismail.de> References: <20221207001451.GB32178@dismail.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/oqfrE0VxKDBcM94wja3eAN7"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Wojtek Kosior From: Wojtek Kosior via Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670397076; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=zC6Lk/6hfxttNW9/fzqmJKczu6U/wSnjMjGyWJAdTvk=; b=oy7Ofuzy8/f9FwOovDQuiNm6VeLMWD6f+AQrRu93ResuOhpZMlzzDQkIL95a7lS4r2GAFE kUvobW/De3+Jt5mSoe65XhlCYhBYTXLjLEgthOwKYIre7XJ6KhALMD6FUDiqBA4O4OdZbN 83bdYbUWVRMEOkwXgynmU87fOJpHnAB2wAPsiHWPuBlbnmQZlH+AdoimnDMGPRTmAXCEvw ICocGIEp8iL49BY+SE6wTdlLIUbUzQwfgrJk7yDoNuqP2e9U9DwxUZ3LFCkKcf+9xijuqD FBU+lsXhs69LzH1LDEoqTNzyPzRe7dYsRnuKzgVpbC2Ql2eHQzJ92tYmqtYefw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670397076; a=rsa-sha256; cv=none; b=PN3gaHiP6CG/SzIHJ5Jl2vVKrMHN1SZfMDADhNGhVYcLk3bSluifffxWUK4MdiYIL9Mr9l 2xEYnlxg9950o8DkwQDQlsTXePFIDLJFW51uGYMNrysVkWnhfFN+xqAP+ypJhV/uPMVbht ht1oAVZCzF3qYzZ/1K6w8UEqskF3oJNesfKnPLPiPp7PX7+QJxAXiUdHgEGitbPjGpZ9nx 7BXuw39U/AclZ5qPNXcZn51LNuYElf7r0L3/8YlEPvUyGOaPAIUnQWFd0R0h79hvuFDWCy FCP7eaB+J+I+4yvbCuN3spt8yHgm8eO4trg2yDoVWuTl8nIA5ABg+0jQ0p25Tw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=nzoo4vcB; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.37 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=nzoo4vcB; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CA8DB7D58 X-Spam-Score: -5.37 X-Migadu-Scanner: scn1.migadu.com X-TUID: yYdcHZHDT2v+ --Sig_/oqfrE0VxKDBcM94wja3eAN7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > hi, >=20 > why do the configure-flags and make-flags need to be doubly quote in the = gnu-build procedure? Because later in that function they get unquoted inside a gexp using `#$` (i.e. `ungexp`). If you write a gexp like > (let ((somelist '("a" "b" "c"))) > #~(display #$somelist)) on the build side it will resolve to > (display ("a" "b" "c")) which will of course fail because `"a"` is not a proper function. You instead want to get this > (display '("a" "b" "c")) which can be achieved by e.g. double-quoting the value that gets ungexp'd, e.g. with > (let ((somelist ''("a" "b" "c"))) > #~(display #$somelist)) The following should also work for this list > (let ((somelist '("a" "b" "c"))) > #~(display '#$somelist)) In many places in Guix code a function `sexp->gexp` is also used together with `'#$`. I suspect it does some extra stuff. I don't know what exactly. The relevant part where those double-quoted lists are used is > #:locale #$locale > #:bootstrap-scripts #$bootstrap-scripts > #:configure-flags #$(if (pair? configure-flags) > (sexp->gexp configure-= flags) ; here > configure-flags) > #:make-flags #$(if (pair? make-flags) > (sexp->gexp make-flags) = ; here > make-flags) > #:out-of-source? #$out-of-source? > #:tests? #$tests? > #:test-target #$test-target When a double-quoted list is used, the "true" expression of each `if` clause is used :) Wojtek -- (sig_start) website: https://koszko.org/koszko.html PGP: https://koszko.org/key.gpg fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A Meet Krak=C3=B3w saints! #46: saint Stanis=C5=82aw Papczy=C5=84ski Poznaj =C5=9Bwi=C4=99tych krakowskich! #46: =C5=9Bwi=C4=99ty Stanis=C5=82a= w Papczy=C5=84ski https://pl.wikipedia.org/wiki/Stanis=C5=82aw_Papczy=C5=84ski -- (sig_end) On Wed, 7 Dec 2022 00:14:51 -0600 jgart wrote: > hi, >=20 > why do the configure-flags and make-flags need to be doubly quote in the = gnu-build procedure? >=20 > (define* (gnu-build name inputs > #:key > guile source > (outputs '("out")) > (search-paths '()) > (bootstrap-scripts %bootstrap-scripts) > (configure-flags ''()) ; here > (make-flags ''()) ; here > (out-of-source? #f) > (tests? #t) > (test-target "check") > (parallel-build? #t) > (parallel-tests? #t) > (patch-shebangs? #t) > (strip-binaries? #t) > (strip-flags %strip-flags) > (strip-directories %strip-directories) > (validate-runpath? #t) > (make-dynamic-linker-cache? #t) > (license-file-regexp %license-file-regexp) > (phases '%standard-phases) > (locale "en_US.utf8") > (system (%current-system)) > (build (nix-system->gnu-triplet system)) > (imported-modules %gnu-build-system-modules) > (modules %default-modules) > (substitutable? #t) > allowed-references > disallowed-references) >=20 >=20 --Sig_/oqfrE0VxKDBcM94wja3eAN7 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCY5A8aQAKCRBLxSIcWnn9 GuWkAQCIxjBX8EWAEcZju+lZoQ91oWevKg/OB8uGfobP+2E2GAD9F8uoLK3G4pD2 jxbM5wQPDcPvg+fHrmhaVnOaMcPlUAI= =97T+ -----END PGP SIGNATURE----- --Sig_/oqfrE0VxKDBcM94wja3eAN7--