diff --git a/gnu/local.mk b/gnu/local.mk index b70eb0da12f..d0c998f313d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012-2025 Ludovic Courtès +# Copyright © 2012-2026 Ludovic Courtès # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023, 2024, 2025 Andreas Enge # Copyright © 2016 Mathieu Lirzin # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver @@ -1542,6 +1542,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-default-utf8.patch \ %D%/packages/patches/guile-2.2-default-utf8.patch \ %D%/packages/patches/guile-relocatable.patch \ + %D%/packages/patches/guile-3.0.11-cross-compilation.patch \ %D%/packages/patches/guile-3.0-relocatable.patch \ %D%/packages/patches/guile-linux-syscalls.patch \ %D%/packages/patches/guile-3.0-linux-syscalls.patch \ diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 8f138c24bd7..1659b484062 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2025 Ludovic Courtès +;;; Copyright © 2012-2026 Ludovic Courtès ;;; Copyright © 2014 Cyril Roelandt ;;; Copyright © 2014, 2016, 2018 David Thompson ;;; Copyright © 2014, 2017, 2018 Mark H Weaver @@ -477,7 +477,53 @@ without requiring the source code to be rewritten.") (variable "GUILE_EXTENSIONS_PATH") (files '("lib/guile/3.0/extensions"))))))) -(define-public guile-3.0-latest guile-3.0) +(define-public guile-3.0.11 + (package + (inherit guile-3.0) + (name "guile") + (version "3.0.11") + (source + (origin + (inherit (package-source guile-2.2)) + (uri (string-append "mirror://gnu/guile/guile-" version ".tar.xz")) + (sha256 + (base32 "0q4laxcraxh3r9s62p6nw3g3n6xlqxy16r5kdylpyyk56v97k341")) + (patches (search-patches "guile-3.0.11-cross-compilation.patch")) + ;; Replace the snippet because the oom-test still fails on some 32-bit + ;; architectures. + (snippet '(for-each delete-file + (find-files "prebuilt" "\\.go$"))))) + (arguments + (substitute-keyword-arguments (package-arguments guile-3.0) + ((#:phases phases) + #~(modify-phases #$phases + #$@(if (target-hurd?) + #~((delete 'patch-posix-spawn-usage)) + #~()) + #$@(if (system-hurd?) + #~((replace 'disable-tests + (lambda _ + (substitute* "test-suite/Makefile.in" + ;; AF_UNIX/SOCK_STREAM: bind abstract - arguments: bind ENOENT + (("tests/00-socket.test") + "") + ;; thread-sleep!: thread sleeps fractions of a second + (("tests/srfi-18.test") + "") + ;; flaky: server is listening - arguments: connect EINVAL + (("tests/web-server.test") + "")) + ;; failed to remove 't-guild-compile-7215.go.tdL7yC + (substitute* "test-suite/standalone/Makefile.in" + (("test-guild-compile ") + "")))) + (delete 'disable-threads.tests)) + #~()))))))) + +(define-public guile-3.0-latest + ;; At the moment 3.0.11 leads to test failures in the 'guix' package so we + ;; cannot switch just yet: see . + guile-3.0) ;;; The symbol guile-3.0/fixed should be used when guile-3.0 needs fixes ;;; (security or else) and this deprecation could be removed. diff --git a/gnu/packages/patches/guile-3.0.11-cross-compilation.patch b/gnu/packages/patches/guile-3.0.11-cross-compilation.patch new file mode 100644 index 00000000000..5464bdbaca4 --- /dev/null +++ b/gnu/packages/patches/guile-3.0.11-cross-compilation.patch @@ -0,0 +1,29 @@ +Fix cross-compilation of Guile 3.0.11: + + https://codeberg.org/guile/guile/issues/88 + +--- a/module/system/base/target.scm ++++ b/module/system/base/target.scm +@@ -45,15 +45,13 @@ + ;;; + + ;; Hacky way to get native pointer size without having to load (system +-;; foreign). +-(define-syntax %native-word-size +- (lambda (stx) +- (syntax-case stx () +- (id (identifier? #'id) +- (cond +- ((< most-positive-fixnum (ash 1 32)) 4) +- ((< most-positive-fixnum (ash 1 64)) 8) +- (else (error "unexpected!" most-positive-fixnum))))))) ++;; foreign). Note: Use the value of 'most-positive-fixnum' available at ++;; run time, not a macro-expansion time, to ensure the correct value is ++;; used when cross-compiling. ++(define %native-word-size ++ (cond ((< most-positive-fixnum (ash 1 32)) 4) ++ ((< most-positive-fixnum (ash 1 64)) 8) ++ (else (error "unexpected!" most-positive-fixnum)))) + + (define %target-type (make-fluid %host-type)) + (define %target-endianness (make-fluid (native-endianness)))