From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id eEWsDgqsm2WxlwAAkFu2QA (envelope-from ) for ; Mon, 08 Jan 2024 09:02:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id uBvrCQqsm2WlfgEA62LTzQ (envelope-from ) for ; Mon, 08 Jan 2024 09:02:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704700937; 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-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZXuImgH6k+6INEOcrKJI4RMhQp6fCgQZJjeCwG0v9js=; b=pC1Gk/xpy2PlfCKyURvyWv/RHipTIUwvOohwbeAcsbd20p8wbfcppTWIaH4SBXNZXJSuaH gdO9pEyp+xD96IjJrUOCWFzCaMjrMlfOxRs22OaonFkaE94uT3/rivKRz0FOYFi0MaT8Ru k1wE62823UgWCUMW/Gpb3738ptdRZ1H0M4fVrWepxFt6dJfQOhErtKxrdrC8gZAZYH5dXM QzRmWhVQ8bqYOx7WZe/UpdBTa3VNZwV5r06owA2MSv9WBaL9+1WE8gXNWJUJvkHZHsqabI mlhYjjXD+rQ2+5EOv0oZjfOLayJHJPd+QawgamHmfGHl6jPjUGQjMSEv1Db9Ug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704700937; a=rsa-sha256; cv=none; b=eFkiT3EM/unmjDjECZ8UhLzlSZDpu5HyhixgspLGXEENmn5E8UYvVFm+ITCLLwT61RAf6e 4RmMBrIgtGflMpdzwPnqiRTmL1IJmCRfdlsJGfqPIhmktG3Wvzwr2yT+ROjaW5xV4vUVbf vzXO3F2gqpe2gCF6Stueeqiy6pZyVa8Jq9JSi3TnepjZ6z9W3nrBw473zf14obPnrUzIkD KPF/4Y/SQf1knQFS+Kwn37vklOn9uKBywMCD1HLcvAOMKBlF1doMmWtm5NuBA4Sm7ORYCd e+4Escw96hA1qFDVyQkRUN8/knNCa+m1hthORai9IxMc5wR81QimqZ7p1jF0Kg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org 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 C0717762FF for ; Mon, 8 Jan 2024 09:02:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMkaE-0002kb-TF; Mon, 08 Jan 2024 03:02:09 -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 1rMka5-0002kB-6H for guix-patches@gnu.org; Mon, 08 Jan 2024 03:02:00 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMka4-0002AD-Cy for guix-patches@gnu.org; Mon, 08 Jan 2024 03:01:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMkaA-0007lb-10 for guix-patches@gnu.org; Mon, 08 Jan 2024 03:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68315] [PATCH 00/48] Extend bag-build to gexps. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Jan 2024 08:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68315 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68315@debbugs.gnu.org Cc: ngraves@ngraves.fr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170470087828974 (code B ref -1); Mon, 08 Jan 2024 08:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jan 2024 08:01:18 +0000 Received: from localhost ([127.0.0.1]:34892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkZR-0007Wq-KP for submit@debbugs.gnu.org; Mon, 08 Jan 2024 03:01:18 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMkZN-0007L9-QI for submit@debbugs.gnu.org; Mon, 08 Jan 2024 03:01:15 -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 1rMkZ9-0002h0-RH for guix-patches@gnu.org; Mon, 08 Jan 2024 03:00:59 -0500 Received: from 1.mo583.mail-out.ovh.net ([188.165.57.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMkZ7-0001yZ-4o for guix-patches@gnu.org; Mon, 08 Jan 2024 03:00:59 -0500 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.2.206]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 1A62129F11 for ; Mon, 8 Jan 2024 08:00:53 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5szj2 (unknown [10.110.168.56]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id BE5A11FEB0; Mon, 8 Jan 2024 08:00:52 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-5szj2 with ESMTPSA id Hs1uKrSrm2X4HAAAUmVnLQ (envelope-from ); Mon, 08 Jan 2024 08:00:52 +0000 X-OVh-ClientIp: 81.67.146.208 Date: Mon, 8 Jan 2024 09:00:48 +0100 Message-ID: <20240108080048.25026-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12372795552383951586 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehiedgheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrdduuddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht Received-SPF: pass client-ip=188.165.57.91; envelope-from=ngraves@ngraves.fr; helo=1.mo583.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: C0717762FF X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.81 X-Spam-Score: -5.81 X-TUID: Vcyxri+yJani Rationale: Almost all build-systems are defined with gexpressions in functions that return derivations. Derivations are not easily extensible while gexps are. An example usage is given below. This is a pretty big rewrite that should recompile almost all packages, but a lot of grafting happens such as I could rebuild my system quickly. I was trying to get the build-phases of an existing package to apply to a local repository, because guix as a development tool for heavy packages (emacs, ungoogled-chromium) is tedious, and there are precious info in build-phases that can be applied in a local repository. I'm not aware of prior work on this particular issue. These patches allow to do extensions such as: (build-system (name 'local-gnu) (description "GNU Build System applied in the current directory") (lower (lambda* args (let ((old-bag (apply (build-system-lower (package-build-system emacs-pgtk)) args))) (bag (inherit old-bag) (build (lambda* build-args (mlet %store-monad ((builder (apply (bag-build old-bag) build-args))) (return (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) (with-directory-excursion #$(getcwd) #$builder)))))))))))) Of course this type of build-system isn't directly applicable because of the chroot of the builder, but this other trick makes it happen : ;; We can't use package->derivation directly because we want the user rather ;; than the daemon to build the derivation. (with-store store (run-with-store store (mlet* %store-monad ((bag -> (package->bag pkg)) (drv (bag->derivation bag pkg))) ;; ensure inputs are in the store. (built-derivations (derivation-inputs drv)) (with-environment-excursion (apply invoke (derivation-builder (pk 'd drv)) (derivation-builder-arguments drv)))))) This isn't polished yet, but could serve as an handy way to develop heavy packages locally while taking advantage of the code that's already in guix build phases. Nicolas Graves (48): guix: packages: Extend bag-build to support gexp. build-system: gnu: Improve gnu-cross-build style. build-system: gnu: Redefine gnu-build and gnu-cross-build. build-system: agda: Redefine agda-build. build-system: android-ndk: Redefine gnu-build. build-system: ant: Redefine ant-build. build-system: asdf: Redefine asdf-build. build-system: cargo: Redefine cargo-build and cargo-cross-build. build-system: chicken: Redefine chicken-build. build-system: clojure: Redefine clojure-build. build-system: cmake: Redefine cmake-build and cmake-cross-build. build-system: composer: Redefine composer-build. build-system: copy: Redefine copy-build. build-system: dub: Redefine dub-build. build-system: dune: Redefine dune-build. build-system: elm: Redefine elm-build. build-system: emacs: Redefine emacs-build. build-system: font: Redefine font-build. build-system: glib-or-gtk: Improve glib-or-gtk-cross-build style. build-system: glib-or-gtk: Redefine glib-or-gtk-build functions. build-system: go: Redefine go-build and go-cross-build. build-system: guile: Redefine guile-build and guile-cross-build. build-system: haskell: Redefine haskell-build. build-system: julia: Redefine julia-build. build-system: linux-module: Redefine linux-module-build functions. build-system: maven: Redefine maven-build. build-system: meson: Redefine meson-build and meson-cross-build. build-system: minify: Redefine minify-build. build-system: mix: Redefine mix-build. build-system: node: Redefine node-build. build-system: ocaml: Redefine ocaml-build. build-system: perl: Redefine perl-build and perl-cross-build. build-system: pyproject: Redefine pyproject-build. build-system: python: Redefine python-build. build-system: qt: Redefine qt-build and qt-cross-build. build-system: r: Redefine r-build. build-system: rakudo: Redefine rakudo-build. build-system: rebar: Redefine rebar-build. build-system: renpy: Redefine renpy-build. build-system: ruby: Improve ruby-cross-build style. build-system: ruby: Redefine ruby-build. build-system: scons: Redefine scons-build. build-system: texlive: Redefine texlive-build. build-system: tree-sitter: Redefine tree-sitter-build functions. build-system: vim: Redefine vim-build. build-system: waf: Improve waf-build style. build-system: zig: Redefine zig-build. build-system: trivial: Redefine trivial-build functions. guix/build-system.scm | 2 +- guix/build-system/agda.scm | 8 +- guix/build-system/android-ndk.scm | 8 +- guix/build-system/ant.scm | 8 +- guix/build-system/asdf.scm | 8 +- guix/build-system/cargo.scm | 19 ++--- guix/build-system/chicken.scm | 8 +- guix/build-system/clojure.scm | 8 +- guix/build-system/cmake.scm | 24 ++---- guix/build-system/composer.scm | 9 +-- guix/build-system/copy.scm | 11 +-- guix/build-system/dub.scm | 8 +- guix/build-system/dune.scm | 9 +-- guix/build-system/elm.scm | 8 +- guix/build-system/emacs.scm | 8 +- guix/build-system/font.scm | 10 +-- guix/build-system/glib-or-gtk.scm | 115 ++++++++++++---------------- guix/build-system/gnu.scm | 119 +++++++++++++---------------- guix/build-system/go.scm | 20 ++--- guix/build-system/guile.scm | 21 ++--- guix/build-system/haskell.scm | 8 +- guix/build-system/julia.scm | 8 +- guix/build-system/linux-module.scm | 17 ++--- guix/build-system/maven.scm | 8 +- guix/build-system/meson.scm | 25 ++---- guix/build-system/minify.scm | 8 +- guix/build-system/mix.scm | 12 +-- guix/build-system/node.scm | 8 +- guix/build-system/ocaml.scm | 9 +-- guix/build-system/perl.scm | 22 ++---- guix/build-system/pyproject.scm | 13 +--- guix/build-system/python.scm | 12 +-- guix/build-system/qt.scm | 17 ++--- guix/build-system/r.scm | 9 +-- guix/build-system/rakudo.scm | 8 +- guix/build-system/rebar.scm | 12 +-- guix/build-system/renpy.scm | 8 +- guix/build-system/ruby.scm | 48 ++++++------ guix/build-system/scons.scm | 9 +-- guix/build-system/texlive.scm | 11 +-- guix/build-system/tree-sitter.scm | 16 ++-- guix/build-system/trivial.scm | 41 ++++------ guix/build-system/vim.scm | 15 +--- guix/build-system/waf.scm | 32 ++++---- guix/build-system/zig.scm | 8 +- guix/packages.scm | 53 ++++++++++--- 46 files changed, 348 insertions(+), 520 deletions(-) -- 2.41.0