gexp: Leave grafting as is when lowering allowed/disallowed references.
authorLudovic Courtès <ludo@gnu.org>
Fri, 24 Sep 2021 21:00:11 +0000 (23:00 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 24 Sep 2021 22:41:32 +0000 (00:41 +0200)
commitdf46bef48eaa43c502fa9193371692c039b460c1
treebe496d3a0e8ff150ff8fc48c53f29c73e8f23867
parent9fbe4b88c2369166733bc039fb261839846011d3
gexp: Leave grafting as is when lowering allowed/disallowed references.

Fixes <https://issues.guix.gnu.org/50676>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.

Commit a779363b6aa581e88eda21f9f35530962d54ac25 was partially incorrect:
references passed to #:allowed-references or #:references-graphs *can*
be lowered as references to grafted elements.  This is for example the
case when doing:

  (computed-file "partition.img" exp
                  #:options `(#:references-graphs ,inputs))

Here INPUTS must be lowered as a reference to suitably grafted elements.
Failing to do that, the reference graph will not match the actual
INPUTS.

However, when building a package, those references must indeed refer
only to ungrafted packages.  This commit preserves that by having build
systems pass #:graft? #f.

* guix/gexp.scm (lower-reference-graphs, lower-references): Remove uses
of 'without-grafting'.  This reverts
a779363b6aa581e88eda21f9f35530962d54ac25.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build):
Pass #:graft? #f.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build)
(glib-or-gtk-cross-build): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise.
* guix/build-system/trivial.scm (trivial-build, trivial-cross-build):
Likewise.
* tests/gexp.scm ("lower-object, computed-file + grafts"): New test.
* tests/packages.scm ("trivial with #:allowed-references + grafts"): New
test.
guix/build-system/cmake.scm
guix/build-system/glib-or-gtk.scm
guix/build-system/gnu.scm
guix/build-system/meson.scm
guix/build-system/trivial.scm
guix/gexp.scm
tests/gexp.scm
tests/packages.scm