Message ID | 87r1v9itd0.fsf@gnu.org |
---|---|
State | Accepted |
Headers | show |
Series | None | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
Hi! Mathieu Othacehe <othacehe@gnu.org> skribis: >> guix system: error: gnu/packages/glib.scm:406:2: gobject-introspection@1.62.0: build system `meson' does not support cross builds >> >> Do you see that too? > > Yes, same issue. When grafting is enabled, we try to cross-built the > native extension "guile-rsvg" in (gnu bootloader grub). > > Taking inspiration from f52fbf709, I tried: > > diff --git a/guix/packages.scm b/guix/packages.scm > index 3d9988d836..e74ac882cb 100644 > --- a/guix/packages.scm > +++ b/guix/packages.scm > @@ -1276,13 +1276,14 @@ to (see 'graft-derivation'.)" > (define target (bag-target bag)) > > (define native-grafts > - (let ((->graft (input-graft store system))) > - (fold-bag-dependencies (lambda (package grafts) > - (match (->graft package) > - (#f grafts) > - (graft (cons graft grafts)))) > - '() > - bag))) > + (parameterize ((%current-target-system target)) > + (let ((->graft (input-graft store system))) > + (fold-bag-dependencies (lambda (package grafts) > + (match (->graft package) > + (#f grafts) > + (graft (cons graft grafts)))) > + '() > + bag)))) > > > which, by pure luck, fixes the issue for me. Maybe, I should also do > that for "target-grafts". Ludo, WDYT? Could you boil the problem down to a “guix build --target” command? I’d like to make sure we understand the issue so we can add a test when we fix it. Thanks, Ludo’.
Hey Ludo,
> Could you boil the problem down to a “guix build --target” command?
No, but I just found a small reproducer:
--8<---------------cut here---------------start------------->8---
(use-modules (gnu)
(gnu packages gtk)
(guix)
(guix store))
(run-with-store (open-connection)
(mlet* %store-monad ((target (set-current-target "aarch64-linux-gnu"))
(drv (lower-object
(computed-file "test"
#~(begin
(mkdir #$output)
#+guile-rsvg))))
(out -> (derivation->output-path drv)))
(mbegin %store-monad
(built-derivations (list drv))
(return out))))
--8<---------------cut here---------------end--------------->8---
This should fail with:
--8<---------------cut here---------------start------------->8---
In guix/packages.scm:
1072:16 5 (package-derivation _ #<package guile-rsvg@2.18.1-0.05…> …)
1393:16 4 (thunk)
1280:6 3 (bag-grafts #<store-connection 256.99 7f484d450780> #<<…>)
1260:45 2 (fold-bag-dependencies #<procedure 7f484b8bd5e0 at gui…> …)
1072:16 1 (package->bag _ _ _ #:graft? _)
1183:21 0 (thunk)
guix/packages.scm:1183:21: In procedure thunk:
ERROR:
1. &package-cross-build-system-error: #<package gobject-introspection@1.62.0 gnu/packages/glib.scm:406 7f48407ec460>
--8<---------------cut here---------------end--------------->8---
Thanks,
Mathieu
diff --git a/guix/packages.scm b/guix/packages.scm index 3d9988d836..e74ac882cb 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1276,13 +1276,14 @@ to (see 'graft-derivation'.)" (define target (bag-target bag)) (define native-grafts - (let ((->graft (input-graft store system))) - (fold-bag-dependencies (lambda (package grafts) - (match (->graft package) - (#f grafts) - (graft (cons graft grafts)))) - '() - bag))) + (parameterize ((%current-target-system target)) + (let ((->graft (input-graft store system))) + (fold-bag-dependencies (lambda (package grafts) + (match (->graft package) + (#f grafts) + (graft (cons graft grafts)))) + '() + bag)))) --8<---------------cut here---------------end--------------->8--- which, by pure luck, fixes the issue for me. Maybe, I should also do that for "target-grafts". Ludo, WDYT?