all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Circular dependency woes with gcc variables
@ 2022-12-02  4:25 Maxim Cournoyer
  0 siblings, 0 replies; only message in thread
From: Maxim Cournoyer @ 2022-12-02  4:25 UTC (permalink / raw)
  To: guix-devel

Hi,

After struggling for a couple hours (!) with top level cycles when
attempting to use the procedures from (gnu packages cross-base), I've
decided to try to have top level pre-defined variables for these in a
new module.  The idea was that a new module could minimize the
inter-dependencies at the top level:

Put in : gnu/packages/cross-toolchains.scm
--8<---------------cut here---------------start------------->8---
(define-module (gnu packages cross-toolchains)
  #:use-module (gnu packages cross-base)
  #:autoload (gnu packages gcc) (gcc-9))

(define-public xgcc-armhf
  (let ((triplet "arm-linux-gnueabihf"))
    (cross-gcc triplet
               #:xbinutils (cross-binutils triplet)
               #:libc (cross-libc triplet))))

(define-public xgcc-armhf-9
  (let ((triplet "arm-linux-gnueabihf"))
    (cross-gcc triplet
               #:xgcc gcc-9
               #:xbinutils (cross-binutils triplet)
               #:libc (cross-libc triplet
                                  #:xgcc gcc-9))))
--8<---------------cut here---------------end--------------->8---

And register in gnu/local.mk like:

--8<---------------cut here---------------start------------->8---
modified   gnu/local.mk
@@ -185,6 +185,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/crates-graphics.scm		\
   %D%/packages/crates-gtk.scm			\
   %D%/packages/cross-base.scm			\
+  %D%/packages/cross-toolchains.scm		\
   %D%/packages/crypto.scm			\
   %D%/packages/cryptsetup.scm			\
   %D%/packages/cups.scm				\
--8<---------------cut here---------------end--------------->8---

When we try to build, we get:

--8<---------------cut here---------------start------------->8---
Compiling Scheme modules...
[ 78%] LOAD     gnu/packages/cross-toolchains.scm
error: failed to load 'gnu/packages/cross-toolchains.scm':
ice-9/eval.scm:293:34: No variable named gcc-9 in #<interface (gnu packages gcc) 7f0aac3f0d20>
--8<---------------cut here---------------end--------------->8---

Is there a way to get passed that?  Everything I've tried (lazily
resolving gcc-9, delaying via 'delay', etc. hasn't worked).  It'd be
nice to have the cross-compilers more readily available/usable.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-02  4:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02  4:25 Circular dependency woes with gcc variables Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.