summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-05-01 23:39:32 +0200
committerGuix Patches Tester <>2024-05-01 23:59:07 +0200
commiteb948a9f6442b03bb58b50dbcb16e01ff884d2d3 (patch)
tree05567268eb0eea01da8f963c7c676e5911c822c6
parent8bf41c80ef13ea57e834f4e23d649bd99a3e08fc (diff)
downloadguix-patches-issue-70492.tar
guix-patches-issue-70492.tar.gz
bug#66866: Grafting breaks cross-compilationissue-70492
Hi, dan <i@dan.games> skribis: > I spent some time digging into the rabbit hole. After changing > the lower function of the copy-build-system to look more like the > lower function of the gnu-build-system, I'm able to cross compile > alsa-lib without the --no-grafts flag. The changes I made are > like: > > diff --git a/guix/build-system/copy.scm > b/guix/build-system/copy.scm > index d58931b33c..74304b4bfb 100644 > --- a/guix/build-system/copy.scm > +++ b/guix/build-system/copy.scm > @@ -66,13 +66,13 @@ (define* (lower name > (bag > (name name) > (system system) > - (host-inputs `(,@(if source > + (build-inputs `(,@(if source > `(("source" ,source)) > '()) > - ,@inputs > + ,@native-inputs > ;; Keep the standard inputs of > 'gnu-build-system'. > ,@(standard-packages))) > - (build-inputs native-inputs) > + (host-inputs inputs) > (outputs outputs) > (build copy-build) > (arguments (strip-keyword-arguments private-keywords > arguments)))) > > Can we put everything inside build-inputs? From my understanding, > copy-build-system shouldn't care about cross-compilation at all. Intuitively, if ‘copy-build-system’ is about copying architecture-independent files, then it should do the same thing whether or not we are cross-compiling. However, users can and do add phases whose result is architecture-dependent. Small sample: • ‘desec-certbot-hook’ captures a reference to curl, so it would get the wrong one when cross-compiling if we assumed build-inputs = host-inputs. • ‘chez-scheme-for-racket-bootstrap-bootfiles’ builds stuff when cross-compiling. Philip, could you explain the intent and what you expect here? So it would seem we can’t just assume everything is a native input like https://issues.guix.gnu.org/70492 does. Now, as David and you found out, the use of inputs in build-system/copy.scm:lower is bogus. It seems that it can be fixed by following the intended definition of build/host inputs, as David suggested: But wait! That’s all theoretical because the bag always has (target #f) and ‘copy-build’ bundles build and host inputs together, as if doing a native build. So it seems like https://issues.guix.gnu.org/70492 (putting everything in ‘build-inputs’) is OK, after all. But still, there seem to be some expectation that ‘copy-build-system’ can support cross-compilation for real, so maybe we should add a ‘copy-cross-build’ procedure in addition to the patch above. Thoughts? Ludo’.
-rw-r--r--guix/build-system/copy.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm
index d58931b33c..cf0214320b 100644
--- a/guix/build-system/copy.scm
+++ b/guix/build-system/copy.scm
@@ -66,13 +66,13 @@
(bag
(name name)
(system system)
- (host-inputs `(,@(if source
+ (build-inputs `(,@(if source
`(("source" ,source))
'())
- ,@inputs
- ;; Keep the standard inputs of 'gnu-build-system'.
- ,@(standard-packages)))
- (build-inputs native-inputs)
+ ,@native-inputs
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (host-inputs inputs)
(outputs outputs)
(build copy-build)
(arguments (strip-keyword-arguments private-keywords arguments))))