guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Circular dependency woes with gcc variables


From: Maxim Cournoyer
Subject: Circular dependency woes with gcc variables
Date: Thu, 01 Dec 2022 23:25:25 -0500

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]