From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iNXBEtasHGMXewEAbAwnHQ (envelope-from ) for ; Sat, 10 Sep 2022 17:27:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wJKaEtasHGP/wgAAauVa8A (envelope-from ) for ; Sat, 10 Sep 2022 17:27:18 +0200 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 E767E3E812 for ; Sat, 10 Sep 2022 17:27:16 +0200 (CEST) Received: from localhost ([::1]:36452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oX2O4-0000kw-6M for larch@yhetil.org; Sat, 10 Sep 2022 11:27:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2Nr-0000kV-4I for guix-patches@gnu.org; Sat, 10 Sep 2022 11:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oX2Nq-0006JS-SD; Sat, 10 Sep 2022 11:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oX2Nq-0002sn-NW; Sat, 10 Sep 2022 11:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57717] [DRAFT PATCH core-updates] build-systems: Pass #:allowed-references and #:disallowed-references to builders. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Sat, 10 Sep 2022 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57717 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57717@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by submit@debbugs.gnu.org id=B.166282357211023 (code B ref -1); Sat, 10 Sep 2022 15:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Sep 2022 15:26:12 +0000 Received: from localhost ([127.0.0.1]:40210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX2N2-0002rj-Ak for submit@debbugs.gnu.org; Sat, 10 Sep 2022 11:26:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:40254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX2Mz-0002rZ-8Z for submit@debbugs.gnu.org; Sat, 10 Sep 2022 11:26:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2Mz-0000H0-33 for guix-patches@gnu.org; Sat, 10 Sep 2022 11:26:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2My-00069U-Oq for guix-patches@gnu.org; Sat, 10 Sep 2022 11:26:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=ReO0TDOvcb5ioq6B4mcTOYq80LTlejtK2Mu18OOeOB4=; b=dlgcpYmxPZCWfo 7dny03OhiofL8upngwtcM5DcmVdZgUJHwiiiX9Aoi0iyYE0GSljvQiA3LpD13ObnWjqD+GZcrDbgq iQ8T8zAx4hGlBL9/YGLKbWPzZ2Tg2xbON9KqOrKHLzRqKHt7B+0LNHMB4a5EycDrACLFHybqG5pnl B9Fle3snrjYFFo4nYichh7choexZAIk4OSmuPPfa9hGTF0Jn9H2YwDbhnch7bqcGzxwYKc5rRZ+20 bXtcDj+wxr2pBjMzY247SWg6z+ri8TTdbbBn6sTFqwXTsut22pdqzaRbGbnQq9B3PwgB/jhAxSTGP gEA89ZonKX/+C8fEdCSg==; Received: from [84.214.173.6] (port=58818 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2My-0001f6-4w for guix-patches@gnu.org; Sat, 10 Sep 2022 11:26:08 -0400 From: Marius Bakke Date: Sat, 10 Sep 2022 17:26:04 +0200 Message-Id: <20220910152604.3459-1-marius@gnu.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662823637; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ReO0TDOvcb5ioq6B4mcTOYq80LTlejtK2Mu18OOeOB4=; b=cAKUcpW4p477uaRmW79gWvk+kr7kzpFAHrdeyMG5WODV0AP5P5xKzUW6LhZj+VaW9a0uQK DhH/VjOg2zgQZk9lyMZVGuZXohGGVbkrtwjG/VuWe4TcqhhTykA3hsRUnTMUOuy61/kOyZ LrHrfxoXkneBnIsqFBW78ut02gCiwGHwfzgHY7ChqtAhmFbjMhMhltFzLo5MWR/KyvtcX9 rRe7xUilR3tz1nuTGIiWMZWbxAYvxXdds8yyzgE7Yn55C/imXr0EakYFwvG2uwfCi5v8re D2VhW+5UfUtvtAD9g5J9cmF5UB60zZPelTNKd/ru/QIq7N8i6cYqpDpsXO+pNQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662823637; a=rsa-sha256; cv=none; b=TeC7ywFeVbQHF5ZZaQzQeWjw0p2JKtFbeYlQc2WYjJ5nZXoEa6ajFl6Alq8ccCZhKJjpS3 An15cWDzPTucajTtIKD5BggCPXcoT8acHnLJguHxNxMhiIcHRlxyQ0BMQzeddn8y+hnx/Z 2p71FXEwAxv9TRR1/yx788rTxiDkDsXhualRhqfW11KphOFVYbT9dmJ9y4ScseBliiEXo8 +OczwYs6bRAdaXgnp1wkZpr/mTJreqrGFq6GezG+37F1cuR4U5obDMpr0AuVufkUdn67S3 hVXjoQ+RFZuvdDpQ3gkAWffA5UAHZ+5oqClmogmhyIi+A7JA1gC0qVDrDjv7fQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=dlgcpYmx; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.99 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=dlgcpYmx; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E767E3E812 X-Spam-Score: -2.99 X-Migadu-Scanner: scn0.migadu.com X-TUID: XEIZiiU2g1YY * guix/build-system/gnu.scm (gnu-build, gnu-cross-build)[builder]: Pass along #:allowed-references and #:disallowed-references. * guix/build-system/meson.scm (meson-build, meson-cross-build)[builder]: Likewise. --- Hello Guix, This is an untested patch that makes #:allowed-references and #:disallowed-references available to build-side code. The intention is to make it easier to use these properties directly when e.g. wrapping. Consider the following: --8<---------------cut here---------------start------------->8--- (arguments (list #:disallowed-references (list (gexp-input glib "bin") (gexp-input inkscape/stable)) #:phases #~(modify-phases %standard-phases (replace 'glib-or-gtk-wrap (let ((wrap (assoc-ref %standard-phases 'glib-or-gtk-wrap))) (lambda* (#:key inputs outputs disallowed-references #:allow-other-keys) (wrap #:inputs (filter (match-lambda ((label . output) (not (member output disallowed-references)))) inputs) #:outputs outputs))))))) --8<---------------cut here---------------end--------------->8--- This way we don't have to build the list of disallowed references twice, which is difficult without labels in the case of e.g. `(,glib "bin"). Note: I implemented a variant of this approach using a let-binding in f0114656876dcf2e09874e4ea0c00cacf31f1bb2, perhaps that is "good enough" as this approach is unlikely to be much used. WDYT? I'll implement this for the remaining build systems if this is at all sane. --- diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 8eea1cd4c2..f85a172153 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -393,6 +393,8 @@ (define builder #:build #$build #:outputs %outputs #:inputs %build-inputs + #:allowed-references #$allowed-references + #:disallowed-references #$disallowed-references #:search-paths '#$(sexp->gexp (map search-path-specification->sexp search-paths)) @@ -531,6 +533,8 @@ (define %outputs #:target #$target #:outputs %outputs #:inputs %build-target-inputs + #:allowed-references #$allowed-references + #:disallowed-references #$disallowed-references #:native-inputs %build-host-inputs #:search-paths '#$(sexp->gexp (map search-path-specification->sexp diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index 9fee6c4570..1bef07230f 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -210,6 +210,8 @@ (define build-phases #$(with-build-variables inputs outputs #~(meson-build #:source #+source #:system #$system + #:allowed-references #$allowed-references + #:disallowed-references #$disallowed-references #:outputs %outputs #:inputs %build-inputs #:search-paths '#$(sexp->gexp @@ -318,6 +320,8 @@ (define build-phases #:system #$system #:build #$(nix-system->gnu-triplet system) #:target #$target + #:allowed-references #$allowed-references + #:disallowed-references #$disallowed-references #:outputs #$(outputs->gexp outputs) #:inputs #$inputs #:native-inputs #+(input-tuples->gexp build-inputs) -- 2.37.3