From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id EJHINuw0qmbMawEA62LTzQ:P1 (envelope-from ) for ; Wed, 31 Jul 2024 12:58:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id EJHINuw0qmbMawEA62LTzQ (envelope-from ) for ; Wed, 31 Jul 2024 14:58:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=key1 header.b=S1L4wAkt; dmarc=pass (policy=quarantine) header.from=trop.in; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1722430700; h=from:from:sender:sender: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=QBiuSy+iieylzaaacGJ88dPx+Nx0oCblXXXQsYFeSKI=; b=eqp7epyZvWXDfwXrjlk9gpJGXxj+IwiGMivYI1gLiPRReKOx78sJ0PwW1Vi0Ws4Fy1aHp2 G554EofYaD29IrtzGqWzTbK5fZEAtnCL63E30vbCqZS+E+fvGQ4Ae/CK48V+hBnatAXcO3 dUh2K2wv1UVWqqe0TECWqEwOKownQf45D2HTbsi+S0ujuFvkwbYLAKzjPUyh3IaGAYPlbR 6ZRBRFO6E3snt/jGqfWWVfv7AUMpw/pl6dK/AzUS7ZgGMmqFTBo1BckP+7asucScXcAjD2 wXMBxTdcDJYN4bT9Ydhb/HtY24RES5gKJQRtciLJpvn8B5/n925gHjfJLs6cSQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722430700; a=rsa-sha256; cv=none; b=VYg8OBxxivcbOIclvmWhkTliQdQVBmMNVRFc3SVVbuxuY0+LjHzVw3an256d2EGY2ZFvvC +HmCXRmMLhGDGdZgy1ByGu9TM/NRd32TNNZDTPG3PdW8nr1J4+OjVt6EdEqdPmhuQ49e5I E2txYcGpVy73tO5CF4IOPRnOffTDcsupYoRRMoXQicDvjxiWvBhyRTDvWPSELbpcJn/zqM fKUGt/THQQT3bFCP3wvEtX0hlMzYmAc9PsZnTMN2L14J3pcWJkbKvpK0h/qTk8JEr/lM1v PqV0tUFi00eWt/mr9IYBCMxfXjrQilXsUDqEYRqUpooahAXyzqh6d9CHZ7PiYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=key1 header.b=S1L4wAkt; dmarc=pass (policy=quarantine) header.from=trop.in; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@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 9B00C30D82 for ; Wed, 31 Jul 2024 14:58:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ8tc-0001xO-Aq; Wed, 31 Jul 2024 08:57:36 -0400 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 1sZ8tZ-0001mo-5R for guix-devel@gnu.org; Wed, 31 Jul 2024 08:57:33 -0400 Received: from out-180.mta0.migadu.com ([2001:41d0:1004:224b::b4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ8tU-0008Rg-5c for guix-devel@gnu.org; Wed, 31 Jul 2024 08:57:31 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1722430632; h=from:from: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; bh=QBiuSy+iieylzaaacGJ88dPx+Nx0oCblXXXQsYFeSKI=; b=S1L4wAktf+J6SSjuLFbiLRQTLknGPEk+WmYw0mqtbjdRkuKi+5SQlzRhOu1IHVvKyGr6mo t15ffML2K6gTtK1jUw2HV2NW9YIZx+zqJPXuF37mq6YhfW3Wq9GfBEBI6fndurg6snRE9+ lE5Jepa+C7Bd038yeEwMDbcBo92mtoZyEKl8+LyXCsXETw2gxzUEWbccw+/IvKDOrf04+j i/IfcwSh7mJOlNIzshNDJ4QVarBt4ndPFkWRh9ZfBgTgf+jJhymrkStyUH3I6xbvUEcwnE 4eF/IPiiQ1DZ+8dMsLOuiciGc1/PJJg4p1sG6pI3T1upa3fgQx8Ex1CwhJ1F+w== From: Andrew Tropin To: "Nicolas Graves via Development of GNU Guix and the GNU System distribution." , guix-devel@gnu.org Cc: ngraves@ngraves.fr Subject: Re: [PATCH 00/48] Extend bag-build to gexps. In-Reply-To: <20240108075153.14849-1-ngraves@ngraves.fr> References: <20240108075153.14849-1-ngraves@ngraves.fr> Date: Wed, 31 Jul 2024 16:57:07 +0400 Message-ID: <87ttg5bty4.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:41d0:1004:224b::b4; envelope-from=andrew@trop.in; helo=out-180.mta0.migadu.com 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: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 9B00C30D82 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -11.65 X-Spam-Score: -11.65 X-TUID: PLbYvpeNsK83 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2024-01-08 08:51, Nicolas Graves via "Development of GNU Guix and the GN= U System distribution." wrote: > 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 r= ather > ;; 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. > Looks really interesting and relevant, need to allocate resources to try it out someday. > > 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(-) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmaqNKMACgkQIgjSCVjB 3rDOaQ//Vp3merR6+SIMgzPevZmiu3A13/PrROv9iE/Et9CdjM6xhHBEBevY3Yo5 nIPjjk0Y5VufGQ0BdoCJKR4q2CRtQzxpILkz85U6MT3y18KDmTO5mpGBqh6uBVIZ gYaXa+Bh51xKhvG9DOLoSNjk6yODpOGhw/D1IT+IWFNf2nFaAPbft28FRgrrP4wJ MypWzXNYtN8LsEFBFq8uKT+wUJz0TSqvSjQbEkSeJJ1jOurftb5ACWzIN10+pKvL zuct2T8t1oDYQQbGKNvlKhM5CPPQDhhdl9mnKV45ssOGwF2VX4XIgFDF89zQ2yPc iCExzWuDzYBiLzxHik0PgIA7pUuOfTh+cLfjjyvxBYkHQIt5c9RN2EpoTDmQtmYz vLSeSvrQiZeXN45NWp9jS8+AavX1MePq7cclh8tZer+7TGLSfeMQ7SGpSyXAdBEC Q8cpfTrqhm8qOiKafklRlC/0xLvurMPYxlVIV7vvYnNVlEtR7ywF1i7lNp1RFYBL HZRzuaoTRvWEMEhYlpXa6NV5liw7HduqqQaHfHxuoZd6vnlfT3i/jPxBjUNxI+UX mlIzCxxCPwK7+C41+cr0X3HL00kKmAoEhlb1wVRB10ViV4BXL3YnrOSt2/reroRv vHvhQDmuScCnrYLdr+MXVxFIHxrJUCDwGYU60ZyMNEnZ5+xUMa4= =WbU2 -----END PGP SIGNATURE----- --=-=-=--