all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Cross compilation status
@ 2023-09-10  9:14 Mathieu Othacehe
  2023-09-10  9:20 ` Efraim Flashner
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Mathieu Othacehe @ 2023-09-10  9:14 UTC (permalink / raw)
  To: guix-devel
  Cc: andrew, bjoern.hoefling, guix, efraim, julien,
	cox.katherine.e+guix, lars, liliana.prikler, rekado, jgart

[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]


Hello,

In order for Guix to become an alternative to tools such as Yocto and
Buildroot, having most or all our packages cross-compiling is a
prerequisite.

Here is a status of cross-compilation in Guix. For cross-compilation to
work, the build-system needs to support cross-compilation.

The following build-systems explicitly refuse cross-compiling packages:

haskell, agda, waf, chicken, rakudo, julia, python, emacs, rebar, cargo, ruby, renpy, dub, android-ndk, scons, dune, ant, pyproject, maven, asdf, r, ocaml, node

while the rest of the build-systems do accept cross-compiling packages:

clojure, qt, copy, minetest-mod, tree-sitter, raw, linux-module, glib-or-gtk, asdf/source, go, cmake, minify, perl, trivial, guile, elm, font, gnu, asdf/ecl, asdf/sbcl, meson, mozilla, texlive

It does not mean that all the packages relying on those build-systems
will cross-compile OK. It just means that we will at least try to build
those.

In term of numbers, the attached script produces the following output:

--8<---------------cut here---------------start------------->8---
Total packages: 28076

clojure: 13
qt: 317
copy: 134
minetest-mod: 22
tree-sitter: 35
raw: 2
linux-module: 17
glib-or-gtk: 139
asdf/source: 794
go: 632
cmake: 1278
minify: 12
perl: 839
trivial: 250
guile: 49
elm: 30
font: 101
gnu: 4178
asdf/ecl: 753
asdf/sbcl: 814
meson: 504
mozilla: 2
texlive: 4150
Cross-compilation OK: 15065

ocaml: 61
haskell: 812
maven: 2
chicken: 12
node: 57
emacs: 1370
dune: 289
android-ndk: 12
waf: 21
julia: 300
pyproject: 433
r: 2441
cargo: 3535
ruby: 597
rebar: 22
scons: 15
rakudo: 22
agda: 6
ant: 559
python: 2488
Cross-compilation KO: 13054
--8<---------------cut here---------------end--------------->8---

Over the 28076 packages in Guix, 15065 are part of build-systems with
cross-compilation support and 13054 are part of build-systems without
cross-compilation support.

Overall 46.5% of our packages will refuse to cross-compile with errors
such as:

--8<---------------cut here---------------start------------->8---
mathieu@meije ~$ guix build --target=aarch64-linux-gnu librsvg
guix build: error: gnu/packages/gnome.scm:3500:2: librsvg@2.54.5: build system `cargo' does not support cross builds
--8<---------------cut here---------------end--------------->8---

I'd like to help converge towards the situation where all build-systems
support cross-compilation.

I have CC'ed members of the python, java, ruby, rust, r, haskell and
emacs teams. Any plans adding cross-compilation support to your
build-system, barriers to overcome?

Thanks,

Mathieu

[-- Attachment #2: cross.scm --]
[-- Type: application/octet-stream, Size: 1560 bytes --]

(use-modules (guix) (gnu))

(define bs-cross-ko
  '(haskell
    agda
    waf
    chicken
    rakudo
    julia
    python
    emacs
    rebar
    cargo
    ruby
    renpy
    dub
    android-ndk
    scons
    dune
    ant
    pyproject
    maven
    asdf
    r
    ocaml
    node))

(define all-packages
  (fold-packages (lambda (package result)
                   ;; Ignore deprecated packages.
                   (if (package-superseded package)
                       result
                       (cons package result)))
                 '()
                 #:select? (const #t)))           ;include hidden packages

(define %bs (make-hash-table))

(define cross-ok 0)
(define cross-ko 0)
(define total-packages 0)

(for-each (lambda (p)
            (let* ((s (build-system-name
                      (package-build-system p)))
                   (ref (or (hash-ref %bs s) 1)))
              (hash-set! %bs s (1+ ref))
              (set! total-packages (1+ total-packages))))
          all-packages)

(format #t "Total packages: ~a~%~%~%" total-packages)

(hash-for-each (lambda (k v)
                 (unless (memq k bs-cross-ko)
                     (set! cross-ok (+ cross-ok v))
                     (format #t "~a: ~a~%" k v)))
               %bs)
(format #t "Cross-compilation OK: ~a~%~%~%~%~%" cross-ok)


(hash-for-each (lambda (k v)
                 (when (memq k bs-cross-ko)
                   (set! cross-ko (+ cross-ko v))
                   (format #t "~a: ~a~%" k v)))
               %bs)

(format #t "Cross-compilation KO: ~a~%" cross-ko)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-18 17:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-10  9:14 Cross compilation status Mathieu Othacehe
2023-09-10  9:20 ` Efraim Flashner
2023-09-10  9:27 ` Efraim Flashner
2023-09-10 12:55 ` Maxim Cournoyer
2023-09-10 14:59 ` Liliana Marie Prikler
2023-09-18 14:17   ` Efraim Flashner
2023-09-18 17:01     ` Liliana Marie Prikler
2023-09-11 16:19 ` Simon Tournier
2023-09-11 17:10   ` Liliana Marie Prikler
2023-09-12 15:05 ` Guillaume Le Vaillant

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.