Subject: Re: bug#66866: aarch64 system cross compilation + pinebook pro image broken?

From: dan <[email-masked]>
Date: Tue, 19 Mar 2024 01:30:31 +0800

Hi David,

Thanks for sharing your discovery.

David Elsing <[email-masked]> writes:

> Starting from alsa-lib, I narrowed it down further. I found that 
> the
> problem is actually when an input of the package uses 
> copy-build-system.

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:

--8<---------------cut here---------------start------------->8---
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))))
--8<---------------cut here---------------end--------------->8---

Can we put everything inside build-inputs?  From my understanding, 
copy-build-system shouldn't care about cross-compilation at all.

Any feedback on this would be really helpful.

Best,
-- 
dan