GNU bug report logs -
#68315
[PATCH 00/48] Extend bag-build to gexps.
Previous Next
Reported by: Nicolas Graves <ngraves <at> ngraves.fr>
Date: Mon, 8 Jan 2024 08:02:01 UTC
Severity: normal
Tags: moreinfo, patch
Done: Andreas Enge <andreas <at> enge.fr>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 25 Jun 2025 20:43:40 +0200
with message-id <aFxDXM70zackxH9t <at> jurong>
and subject line Re: [bug#68315] [PATCH v3 00/47] Extend bag-build to gexp.
has caused the debbugs.gnu.org bug report #68315,
regarding [PATCH 00/48] Extend bag-build to gexps.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
68315: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68315
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
Hello,
Am Wed, Jun 25, 2025 at 12:25:27PM +0200 schrieb Nicolas Graves:
> 1) The few patches improving the style of build-systems : has been
> merged already.
> 2) The implementation of build-system-modules field : now there :
> https://codeberg.org/guix/guix/pulls/361
> 3) The actual bag-build extension now there :
> https://codeberg.org/guix/guix/pulls/133
I am closing this issue to avoid duplication; let us continue the
discussions on Codeberg.
Thanks,
Andreas
This bug report was last modified 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.