diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-09-24 23:00:11 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-09-25 00:41:32 +0200 |
commit | df46bef48eaa43c502fa9193371692c039b460c1 (patch) | |
tree | be496d3a0e8ff150ff8fc48c53f29c73e8f23867 /guix/build-system | |
parent | 9fbe4b88c2369166733bc039fb261839846011d3 (diff) |
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.
Diffstat (limited to 'guix/build-system')
-rw-r--r-- | guix/build-system/cmake.scm | 2 | ||||
-rw-r--r-- | guix/build-system/glib-or-gtk.scm | 2 | ||||
-rw-r--r-- | guix/build-system/gnu.scm | 4 | ||||
-rw-r--r-- | guix/build-system/meson.scm | 2 | ||||
-rw-r--r-- | guix/build-system/trivial.scm | 2 |
5 files changed, 12 insertions, 0 deletions
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index d500eccfde..2056c04153 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -158,6 +158,7 @@ provides a 'CMakeLists.txt' file as its build system." (gexp->derivation name build #:system system #:target #f + #:graft? #f #:substitutable? substitutable? #:guile-for-build guile))) @@ -248,6 +249,7 @@ build system." (gexp->derivation name builder #:system system #:target target + #:graft? #f #:substitutable? substitutable? #:guile-for-build guile))) diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index ec491ff0bd..0c88f039d2 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm @@ -186,6 +186,7 @@ (gexp->derivation name build #:system system #:target #f + #:graft? #f #:allowed-references allowed-references #:disallowed-references disallowed-references #:guile-for-build guile))) @@ -279,6 +280,7 @@ (gexp->derivation name builder #:system system #:target target + #:graft? #f #:modules imported-modules #:allowed-references allowed-references #:disallowed-references disallowed-references diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index ea91be5bcd..651415098e 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -423,9 +423,12 @@ are allowed to refer to." (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) + ;; Note: Always pass #:graft? #f. Without it, ALLOWED-REFERENCES & + ;; co. would be interpreted as referring to grafted packages. (gexp->derivation name builder #:system system #:target #f + #:graft? #f #:substitutable? substitutable? #:allowed-references allowed-references #:disallowed-references disallowed-references @@ -560,6 +563,7 @@ platform." (gexp->derivation name builder #:system system #:target target + #:graft? #f #:modules imported-modules #:substitutable? substitutable? #:allowed-references allowed-references diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index dcad3f322d..198aa08729 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -233,6 +233,7 @@ has a 'meson.build' file." (gexp->derivation name builder #:system system #:target #f + #:graft? #f #:substitutable? substitutable? #:allowed-references allowed-references #:disallowed-references disallowed-references @@ -332,6 +333,7 @@ SOURCE has a 'meson.build' file." (gexp->derivation name builder #:system system #:target target + #:graft? #f #:substitutable? substitutable? #:allowed-references allowed-references #:disallowed-references disallowed-references diff --git a/guix/build-system/trivial.scm b/guix/build-system/trivial.scm index cd35c846ce..378ae481b9 100644 --- a/guix/build-system/trivial.scm +++ b/guix/build-system/trivial.scm @@ -61,6 +61,7 @@ ignored." (gexp->derivation name (with-build-variables inputs outputs builder) #:system system #:target #f + #:graft? #f #:modules modules #:allowed-references allowed-references #:guile-for-build guile))) @@ -85,6 +86,7 @@ ignored." builder) #:system system #:target target + #:graft? #f #:modules modules #:allowed-references allowed-references #:guile-for-build guile))) |