all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
@ 2024-01-05 14:45 Simon South
  2024-01-05 14:50 ` [bug#68263] [PATCH 1/2] gnu: " Simon South
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Simon South @ 2024-01-05 14:45 UTC (permalink / raw)
  To: 68263; +Cc: Efraim Flashner, Vagrant Cascadian

Here are a couple patches that fix build failures of libsmbios, a library for
accessing System Management BIOS[0] data, by restricting its package to only
platforms the library supports (Linux on x86 and x86-64).

They also make libsmbios an optional input to fwupd (its only dependent),
allowing fwupd to build successfully on non-Intel/AMD platforms.

I've tested this on AArch64 and x86-64 and everything appears fine.  I've been
unable to test cross-building fwupd, though, as this fails with

  guix build: error: gnu/packages/gnome.scm:3504:2: librsvg@2.56.4: build
  system `cargo' does not support cross builds

By way of justification for these changes: libsmbios is intended for PCs and
expects[1] to find a sys/io.h header file on the host.  This is supplied by
glibc only for architectures that support peripheral I/O via ports: x86,
x86-64 and DEC Alpha using Linux; and i386 using the Hurd[2].

Of these Guix does not support Linux on Alpha, while libsmbios does not
support the Hurd at all[3].

--
Simon South
simon@simonsouth.net

[0] https://en.wikipedia.org/wiki/System_Management_BIOS

[1] https://github.com/dell/libsmbios/blob/v2.4.3/src/libsmbios_c/cmos/cmos_linux.c#L25

[2] "find -type f -name 'io.h'" at the top level of glibc's source tree makes
    this apparent.

[3] https://github.com/dell/libsmbios/blob/v2.4.3/src/libsmbios_c/common/select_platform_config.h


Simon South (2):
  gnu: libsmbios: Restrict to only supported systems.
  gnu: fwupd: Depend on libsmbios only on supported systems.

 gnu/packages/firmware.scm | 34 +++++++++++++++++++---------------
 gnu/packages/hardware.scm |  1 +
 2 files changed, 20 insertions(+), 15 deletions(-)


base-commit: ac69b423865f12310cef5662d9c303aa4b90c869
-- 
2.41.0





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

* [bug#68263] [PATCH 1/2] gnu: libsmbios: Restrict to only supported systems.
  2024-01-05 14:45 [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems Simon South
@ 2024-01-05 14:50 ` Simon South
  2024-01-05 14:50 ` [bug#68263] [PATCH 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Simon South @ 2024-01-05 14:50 UTC (permalink / raw)
  To: 68263

* gnu/packages/hardware.scm (libsmbios)[supported-systems]: New field.

Change-Id: I8d813f496b7d2ffa8b0af2a6c814d1b09d731387
---
 gnu/packages/hardware.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 59b95ab7c8..4765d1c55d 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -806,6 +806,7 @@ (define-public libsmbios
 also provides extensions for proprietary methods of interfacing with Dell
 specific SMBIOS tables.")
     (home-page "https://github.com/dell/libsmbios")
+    (supported-systems (list "i686-linux" "x86_64-linux"))
     (license
      (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))
 
-- 
2.41.0





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

* [bug#68263] [PATCH 2/2] gnu: fwupd: Depend on libsmbios only on supported systems.
  2024-01-05 14:45 [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems Simon South
  2024-01-05 14:50 ` [bug#68263] [PATCH 1/2] gnu: " Simon South
@ 2024-01-05 14:50 ` Simon South
  2024-01-07 19:50 ` [bug#68263] [PATCH 0/2] libsmbios: Restrict to only " Mathieu Othacehe
  2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
  3 siblings, 0 replies; 15+ messages in thread
From: Simon South @ 2024-01-05 14:50 UTC (permalink / raw)
  To: 68263; +Cc: Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (fwupd)[inputs]: Add libsmbios conditionally.

Change-Id: Id34135b180f5ee6e7abd2fd4eb10e0d3c6308e06
---
 gnu/packages/firmware.scm | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 5cebf515bf..c3e6d20987 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -283,21 +283,25 @@ (define-public fwupd
                          `(,glib "bin")
                          help2man
                          gettext-minimal))
-    (inputs (list bash-completion
-                  libgudev
-                  libxmlb
-                  sqlite
-                  polkit
-                  eudev
-                  libelf
-                  tpm2-tss
-                  cairo
-                  efivar
-                  pango
-                  protobuf-c
-                  mingw-w64-tools
-                  libsmbios
-                  gnu-efi))
+    (inputs (append (list bash-completion
+                          libgudev
+                          libxmlb
+                          sqlite
+                          polkit
+                          eudev
+                          libelf
+                          tpm2-tss
+                          cairo
+                          efivar
+                          pango
+                          protobuf-c
+                          mingw-w64-tools
+                          gnu-efi)
+                    (if (supported-package? libsmbios
+                                            (or (%current-target-system)
+                                                (%current-system)))
+                        (list libsmbios)
+                        '())))
     ;; In Requires of fwupd*.pc.
     (propagated-inputs (list curl
                              gcab
-- 
2.41.0





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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-05 14:45 [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems Simon South
  2024-01-05 14:50 ` [bug#68263] [PATCH 1/2] gnu: " Simon South
  2024-01-05 14:50 ` [bug#68263] [PATCH 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
@ 2024-01-07 19:50 ` Mathieu Othacehe
  2024-01-07 20:00   ` Efraim Flashner
  2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
  3 siblings, 1 reply; 15+ messages in thread
From: Mathieu Othacehe @ 2024-01-07 19:50 UTC (permalink / raw)
  To: Simon South; +Cc: Vagrant Cascadian, 68263, Efraim Flashner


Hello,

>   guix build: error: gnu/packages/gnome.scm:3504:2: librsvg@2.56.4: build
>   system `cargo' does not support cross builds

That is no longer the case, there is however a new error:

--8<---------------cut here---------------start------------->8---
In guix/packages.scm:
  1618:16 19 (package->bag _ _ _ #:graft? _)
  1719:48 18 (thunk)
  1512:25 17 (inputs _)
In srfi/srfi-1.scm:
   586:29 16 (map1 (("coreutils" #<package coreutils@9.1 guix/b…>) …))
   586:29 15 (map1 (("grep" #<package grep@3.8 gnu/packages/com…>) …))
   586:29 14 (map1 (("xz" #<package xz@5.2.8 gnu/packages/comme…>) …))
   586:29 13 (map1 (("locales" #<package glibc-utf8-locales@2.3…>) …))
   586:29 12 (map1 (("bash" #<package bash-minimal@5.1.16 gnu/p…>) …))
   586:17 11 (map1 (("gcc" #<package gcc@11.3.0 gnu/packages/co…>) …))
In guix/packages.scm:
  1469:20 10 (rewrite ("gcc" #<package gcc@11.3.0 gnu/packages/com…>))
In guix/memoization.scm:
    101:0  9 (_ #<hash-table 7f049b80cbc0 14/31> #<package gcc@11.3…> …)
In guix/packages.scm:
  1483:13  8 (_)
In guix/build-system/gnu.scm:
   158:33  7 (cut? _)
In gnu/packages/commencement.scm:
  3241:36  6 (arguments #<package gcc@11.3.0 gnu/packages/commenceme…>)
In gnu/packages/gcc.scm:
   748:34  5 (arguments #<package gcc@11.3.0 gnu/packages/gcc.scm:73…>)
   218:48  4 (arguments #<package gcc@4.8.5 gnu/packages/gcc.scm:398…>)
In gnu/packages/bootstrap.scm:
   338:11  3 (_)
In ice-9/boot-9.scm:
  1685:16  2 (raise-exception _ #:continuable? _)
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
dynamic linker name not known for this system "aarch64-linux-gnu"
--8<---------------cut here---------------end--------------->8---

preventing fwupd from cross-compiling.

Mathieu




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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-07 19:50 ` [bug#68263] [PATCH 0/2] libsmbios: Restrict to only " Mathieu Othacehe
@ 2024-01-07 20:00   ` Efraim Flashner
  2024-01-08  9:56     ` Mathieu Othacehe
  0 siblings, 1 reply; 15+ messages in thread
From: Efraim Flashner @ 2024-01-07 20:00 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Vagrant Cascadian, 68263, Simon South

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

On Sun, Jan 07, 2024 at 08:50:11PM +0100, Mathieu Othacehe wrote:
> 
> Hello,
> 
> >   guix build: error: gnu/packages/gnome.scm:3504:2: librsvg@2.56.4: build
> >   system `cargo' does not support cross builds
> 
> That is no longer the case, there is however a new error:
> 
> --8<---------------cut here---------------start------------->8---
> In guix/packages.scm:
>   1618:16 19 (package->bag _ _ _ #:graft? _)
>   1719:48 18 (thunk)
>   1512:25 17 (inputs _)
> In srfi/srfi-1.scm:
>    586:29 16 (map1 (("coreutils" #<package coreutils@9.1 guix/b…>) …))
>    586:29 15 (map1 (("grep" #<package grep@3.8 gnu/packages/com…>) …))
>    586:29 14 (map1 (("xz" #<package xz@5.2.8 gnu/packages/comme…>) …))
>    586:29 13 (map1 (("locales" #<package glibc-utf8-locales@2.3…>) …))
>    586:29 12 (map1 (("bash" #<package bash-minimal@5.1.16 gnu/p…>) …))
>    586:17 11 (map1 (("gcc" #<package gcc@11.3.0 gnu/packages/co…>) …))
> In guix/packages.scm:
>   1469:20 10 (rewrite ("gcc" #<package gcc@11.3.0 gnu/packages/com…>))
> In guix/memoization.scm:
>     101:0  9 (_ #<hash-table 7f049b80cbc0 14/31> #<package gcc@11.3…> …)
> In guix/packages.scm:
>   1483:13  8 (_)
> In guix/build-system/gnu.scm:
>    158:33  7 (cut? _)
> In gnu/packages/commencement.scm:
>   3241:36  6 (arguments #<package gcc@11.3.0 gnu/packages/commenceme…>)
> In gnu/packages/gcc.scm:
>    748:34  5 (arguments #<package gcc@11.3.0 gnu/packages/gcc.scm:73…>)
>    218:48  4 (arguments #<package gcc@4.8.5 gnu/packages/gcc.scm:398…>)
> In gnu/packages/bootstrap.scm:
>    338:11  3 (_)
> In ice-9/boot-9.scm:
>   1685:16  2 (raise-exception _ #:continuable? _)
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> dynamic linker name not known for this system "aarch64-linux-gnu"
> --8<---------------cut here---------------end--------------->8---
> 
> preventing fwupd from cross-compiling.

I'm not seeing that error, I'm getting json-glib failing to
cross-compile. Is it possible you have some stale .go files? (guix
platforms) changed recently.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-07 20:00   ` Efraim Flashner
@ 2024-01-08  9:56     ` Mathieu Othacehe
  2024-01-08 17:58       ` Simon South
  0 siblings, 1 reply; 15+ messages in thread
From: Mathieu Othacehe @ 2024-01-08  9:56 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: Vagrant Cascadian, 68263, Simon South

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


Hello,

> I'm not seeing that error, I'm getting json-glib failing to
> cross-compile. Is it possible you have some stale .go files? (guix
> platforms) changed recently.

That was the issue! I have a new error, but this this in gnupg:

--8<---------------cut here---------------start------------->8---
%exception #<&invoke-error program: "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" arguments: ("./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "--prefix=/gnu/store/0ksgybn4n10j0b3wcqfl1jpcjr79xq8l-gnupg-2.2.39" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=aarch64-linux-gnu" "--enable-gnupg-builddir-envvar" "--enable-all-tests") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `configure' failed after 9.4 seconds
command "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "--prefix=/gnu/store/0ksgybn4n10j0b3wcqfl1jpcjr79xq8l-gnupg-2.2.39" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=aarch64-linux-gnu" "--enable-gnupg-builddir-envvar" "--enable-all-tests" failed with status 1
note: keeping build directory `/tmp/guix-build-gnupg-2.2.39.drv-1'
builder for `/gnu/store/qac9bix1331g6f12dgyrk4wvn2dpgp3k-gnupg-2.2.39.drv' failed with exit code 1
build of /gnu/store/qac9bix1331g6f12dgyrk4wvn2dpgp3k-gnupg-2.2.39.drv failed
--8<---------------cut here---------------end--------------->8---

I fixed it with the attached patch. Now libsmbios itself fails to
cross-compile:

--8<---------------cut here---------------start------------->8---
src/libsmbios_c/cmos/cmos_linux.c:25:10: fatal error: sys/io.h: No such file or directory
   25 | #include <sys/io.h>
      |          ^~~~~~~~~~
compilation terminated.
--8<---------------cut here---------------end--------------->8---

Thanks,

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gnupg-Fix-cross-compilation.patch --]
[-- Type: text/x-patch, Size: 2429 bytes --]

From c9424c606e0cfcdb9bf10447bb655ab65a3a2056 Mon Sep 17 00:00:00 2001
Message-ID: <c9424c606e0cfcdb9bf10447bb655ab65a3a2056.1704707713.git.othacehe@gnu.org>
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 8 Jan 2024 10:54:27 +0100
Subject: [PATCH] gnu: gnupg: Fix cross-compilation.

* gnu/packages/gnupg.scm (gnupg)[arguments]: Pass libraries prefixes when
cross-crompiling.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Change-Id: I461ba02ddf5bb23277bd6685c2106e4ad37e2184
---
 gnu/packages/gnupg.scm | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index a6ba57d7f3..f1e171036b 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -345,11 +345,30 @@ (define-public gnupg
            zlib))
     (arguments
      (list
-      #:configure-flags #~'(;; Otherwise, the test suite looks for the `gpg`
-                            ;; executable in its installation directory in
-                            ;; /gnu/store before it has been installed.
-                            "--enable-gnupg-builddir-envvar"
-                            "--enable-all-tests")
+      #:configure-flags
+      #~'(#$@(if (%current-target-system)
+                 #~(list
+                    (string-append
+                     "--with-libgpg-error-prefix="
+                     #$(this-package-input "libgpg-error"))
+                    (string-append
+                     "--with-libgcrypt-prefix="
+                     #$(this-package-input "libgcrypt"))
+                    (string-append
+                     "--with-libassuan-prefix="
+                     #$(this-package-input "libassuan"))
+                    (string-append
+                     "--with-ksba-prefix="
+                     #$(this-package-input "libksba"))
+                    (string-append
+                     "--with-npth-prefix="
+                     #$(this-package-input "npth")))
+                 '())
+          ;; Otherwise, the test suite looks for the `gpg`
+          ;; executable in its installation directory in
+          ;; /gnu/store before it has been installed.
+          "--enable-gnupg-builddir-envvar"
+          "--enable-all-tests")
       #:phases
       #~(modify-phases %standard-phases
           (add-before 'configure 'patch-paths

base-commit: 728d471d73c3731b86cbf5f3dee22229d3a92d4b
-- 
2.41.0


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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-08  9:56     ` Mathieu Othacehe
@ 2024-01-08 17:58       ` Simon South
  2024-01-08 18:09         ` Efraim Flashner
  0 siblings, 1 reply; 15+ messages in thread
From: Simon South @ 2024-01-08 17:58 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Vagrant Cascadian, 68263, Efraim Flashner

Mathieu Othacehe <othacehe@gnu.org> writes:
>> I'm not seeing that error, I'm getting json-glib failing to
>> cross-compile. Is it possible you have some stale .go files? (guix
>> platforms) changed recently.
>
> That was the issue!

How exactly did you get past this?  I have the same issue myself now,
even after running "make distclean" and "git clean -fxd" and rebuilding:

[env]$ ./pre-inst-env guix build --dry-run --target=x86_64-linux-gnu --verbosity=2 fwupd
Backtrace:
In guix/packages.scm:
  1618:16 19 (package->bag _ _ _ #:graft? _)
  1719:48 18 (thunk)
  1512:25 17 (inputs _)
In srfi/srfi-1.scm:
   586:29 16 (map1 (("coreutils" #<package coreutils@9.1 guix/b?>) ?))
   586:29 15 (map1 (("grep" #<package grep@3.8 gnu/packages/com?>) ?))
   586:29 14 (map1 (("xz" #<package xz@5.2.8 gnu/packages/comme?>) ?))
   586:29 13 (map1 (("locales" #<package glibc-utf8-locales@2.3?>) ?))
   586:29 12 (map1 (("bash" #<package bash-minimal@5.1.16 gnu/p?>) ?))
   586:17 11 (map1 (("gcc" #<package gcc@11.3.0 gnu/packages/co?>) ?))
In guix/packages.scm:
  1469:20 10 (rewrite ("gcc" #<package gcc@11.3.0 gnu/packages/com?>))
In guix/memoization.scm:
    101:0  9 (_ #<hash-table ffffa8b4ba80 14/31> #<package gcc@11.3?> ?)
In guix/packages.scm:
  1483:13  8 (_)
In guix/build-system/gnu.scm:
   158:33  7 (cut? _)
In gnu/packages/commencement.scm:
  3241:36  6 (arguments #<package gcc@11.3.0 gnu/packages/commenceme?>)
In gnu/packages/gcc.scm:
   748:34  5 (arguments #<package gcc@11.3.0 gnu/packages/gcc.scm:73?>)
   218:48  4 (arguments #<package gcc@4.8.5 gnu/packages/gcc.scm:398?>)
In gnu/packages/bootstrap.scm:
   338:11  3 (_)
In ice-9/boot-9.scm:
  1685:16  2 (raise-exception _ #:continuable? _)
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
dynamic linker name not known for this system "x86_64-linux-gnu"

-- 
Simon South
simon@simonsouth.net




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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-08 17:58       ` Simon South
@ 2024-01-08 18:09         ` Efraim Flashner
  2024-01-08 18:29           ` Simon South
  0 siblings, 1 reply; 15+ messages in thread
From: Efraim Flashner @ 2024-01-08 18:09 UTC (permalink / raw)
  To: Simon South; +Cc: Vagrant Cascadian, Mathieu Othacehe, 68263

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

On Mon, Jan 08, 2024 at 12:58:52PM -0500, Simon South wrote:
> Mathieu Othacehe <othacehe@gnu.org> writes:
> >> I'm not seeing that error, I'm getting json-glib failing to
> >> cross-compile. Is it possible you have some stale .go files? (guix
> >> platforms) changed recently.
> >
> > That was the issue!
> 
> How exactly did you get past this?  I have the same issue myself now,
> even after running "make distclean" and "git clean -fxd" and rebuilding:
> 
> [env]$ ./pre-inst-env guix build --dry-run --target=x86_64-linux-gnu --verbosity=2 fwupd
> Backtrace:
> In guix/packages.scm:
>   1618:16 19 (package->bag _ _ _ #:graft? _)
>   1719:48 18 (thunk)
>   1512:25 17 (inputs _)
> In srfi/srfi-1.scm:
>    586:29 16 (map1 (("coreutils" #<package coreutils@9.1 guix/b?>) ?))
>    586:29 15 (map1 (("grep" #<package grep@3.8 gnu/packages/com?>) ?))
>    586:29 14 (map1 (("xz" #<package xz@5.2.8 gnu/packages/comme?>) ?))
>    586:29 13 (map1 (("locales" #<package glibc-utf8-locales@2.3?>) ?))
>    586:29 12 (map1 (("bash" #<package bash-minimal@5.1.16 gnu/p?>) ?))
>    586:17 11 (map1 (("gcc" #<package gcc@11.3.0 gnu/packages/co?>) ?))
> In guix/packages.scm:
>   1469:20 10 (rewrite ("gcc" #<package gcc@11.3.0 gnu/packages/com?>))
> In guix/memoization.scm:
>     101:0  9 (_ #<hash-table ffffa8b4ba80 14/31> #<package gcc@11.3?> ?)
> In guix/packages.scm:
>   1483:13  8 (_)
> In guix/build-system/gnu.scm:
>    158:33  7 (cut? _)
> In gnu/packages/commencement.scm:
>   3241:36  6 (arguments #<package gcc@11.3.0 gnu/packages/commenceme?>)
> In gnu/packages/gcc.scm:
>    748:34  5 (arguments #<package gcc@11.3.0 gnu/packages/gcc.scm:73?>)
>    218:48  4 (arguments #<package gcc@4.8.5 gnu/packages/gcc.scm:398?>)
> In gnu/packages/bootstrap.scm:
>    338:11  3 (_)
> In ice-9/boot-9.scm:
>   1685:16  2 (raise-exception _ #:continuable? _)
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> dynamic linker name not known for this system "x86_64-linux-gnu"

Taking what you've written exactly for the moment, did you rerun
bootstrap and configure and make first? the pre-inst-env script needs to
get regenerated after cleaning the repo.

I always do my building with --no-grafts.  Also, are you building
x86_64-linux -> x86_64-linux-gnu? I often get weird errors when I try to
do things like that.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-08 18:09         ` Efraim Flashner
@ 2024-01-08 18:29           ` Simon South
  2024-01-08 20:14             ` Mathieu Othacehe
  0 siblings, 1 reply; 15+ messages in thread
From: Simon South @ 2024-01-08 18:29 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: Vagrant Cascadian, Mathieu Othacehe, 68263

Efraim Flashner <efraim@flashner.co.il> writes:
> Taking what you've written exactly for the moment, did you rerun
> bootstrap and configure and make first?

I did, yes:

./bootstrap && ./configure --localstatedir=/var --sysconfdir=/etc && make -j6

after cleaning out the source tree.

I get the same result also whether I run "./pre-inst-env guix build
--target=..."  outside of a "guix shell --pure --development guix"
environment, inside of one using the system instance of Guix, or inside
of one invoked from the built source tree (i.e. "./pre-inst-env guix
shell...") before rebuilding with "./bootstrap..." again.

I'm really at a loss.  What else could cause this error?  I seem to
recall this working a short while ago so I may try bisecting the source
tree if nothing else comes to mind.

> Also, are you building x86_64-linux -> x86_64-linux-gnu?

No, I'm on AArch64, but trying to cross-build from my x86-64 machine to
aarch64-linux-gnu produces the same (well, equivalent) error, even after
the same steps above.

-- 
Simon South
simon@simonsouth.net




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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-08 18:29           ` Simon South
@ 2024-01-08 20:14             ` Mathieu Othacehe
  2024-01-08 20:20               ` Simon South
  0 siblings, 1 reply; 15+ messages in thread
From: Mathieu Othacehe @ 2024-01-08 20:14 UTC (permalink / raw)
  To: Simon South; +Cc: Vagrant Cascadian, 68263, Efraim Flashner


Hello,

So, here is what happens:

You are adding 
--8<---------------cut here---------------start------------->8---
    (supported-systems (list "i686-linux" "x86_64-linux"))
--8<---------------cut here---------------end--------------->8---

to libsmbios. That is fine, it prints:

--8<---------------cut here---------------start------------->8---
package libsmbios@2.4.3 does not support aarch64-linux
--8<---------------cut here---------------end--------------->8---

when running `guix build -s aarch64-linux libsmbios`. It doesn't print
anything when cross-compiling this way: `guix build
--target=aarch64-linux-gnu libsmbios`, tries to cross-compile and fails
because of the <sys/io.h> header as you noticed.

It makes me think that we should turn `supported-systems` into
`supported-platforms` so that we get the same kind of warning when
trying to cross-compile. But that's another topic.

Now regarding your second patch, this part:

--8<---------------cut here---------------start------------->8---
(if (supported-package? libsmbios
                        (or (%current-target-system)
                            (%current-system)))
--8<---------------cut here---------------end--------------->8---

will actually call (supported-package? libsmbios "aarch64-linux-gnu")
when cross-compiling, which prints this error message:

--8<---------------cut here---------------start------------->8---
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
dynamic linker name not known for this system "aarch64-linux-gnu"
--8<---------------cut here---------------end--------------->8---

It has nothing to do with ABI break and .go files. It is just that
supported-package? is expecting a system not a target.

What you could do is rewriting this part as:

--8<---------------cut here---------------start------------->8---
(if (supported-package? libsmbios
                        (if (%current-target-system)
                            (platform-target->system
                             (%current-target-system))
                            (%current-system)))
--8<---------------cut here---------------end--------------->8---

which works as expected because the target is translated into a
system. A better fix would be to have supported-package? deal with
both systems and targets internally.

Then fwupd cross-compilation fails because other dependencies such as
gts fail to cross-compile, but that irrelevant here.

Thanks,

Mathieu




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

* [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems.
  2024-01-08 20:14             ` Mathieu Othacehe
@ 2024-01-08 20:20               ` Simon South
  0 siblings, 0 replies; 15+ messages in thread
From: Simon South @ 2024-01-08 20:20 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Vagrant Cascadian, 68263, Efraim Flashner

Mathieu Othacehe <othacehe@gnu.org> writes:
> It has nothing to do with ABI break and .go files. It is just that
> supported-package? is expecting a system not a target.

Ah, that makes perfect sense.  Thank you for the explanation.  It never
occurred to me (%current-system) and (%current-target-system) would be
returning different types.

I'll submit an updated patchset shortly.

-- 
Simon South
simon@simonsouth.net




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

* [bug#68263] [PATCH v2 0/2] libsmbios: Restrict to only supported systems.
  2024-01-05 14:45 [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems Simon South
                   ` (2 preceding siblings ...)
  2024-01-07 19:50 ` [bug#68263] [PATCH 0/2] libsmbios: Restrict to only " Mathieu Othacehe
@ 2024-01-10 17:16 ` Simon South
  2024-01-10 17:16   ` [bug#68263] [PATCH v2 1/2] gnu: " Simon South
                     ` (2 more replies)
  3 siblings, 3 replies; 15+ messages in thread
From: Simon South @ 2024-01-10 17:16 UTC (permalink / raw)
  To: 68263; +Cc: Vagrant Cascadian, Mathieu Othacehe, Efraim Flashner

Here's a revised version of this patchset, incorporating Mathieu Othacehe's
advice regarding the use of %current-target-system with supported-package?
(but using and=> for compactness and efficiency).

I've tested cross-building fwupd from AArch64 to x86-64 and vice-versa and
things now work as expected, apart from the nspr package failing to build due
to what appears to be a limitation of its own build script.

The original cover letter follows.

--------------------

Here are a couple patches that fix build failures of libsmbios, a library for
accessing System Management BIOS[0] data, by restricting its package to only
platforms the library supports (Linux on x86 and x86-64).

They also make libsmbios an optional input to fwupd (its only dependent),
allowing fwupd to build successfully on non-Intel/AMD platforms.

I've tested this on AArch64 and x86-64 and everything appears fine.  I've been
unable to test cross-building fwupd, though, as this fails with

  guix build: error: gnu/packages/gnome.scm:3504:2: librsvg@2.56.4: build
  system `cargo' does not support cross builds

By way of justification for these changes: libsmbios is intended for PCs and
expects[1] to find a sys/io.h header file on the host.  This is supplied by
glibc only for architectures that support peripheral I/O via ports: x86,
x86-64 and DEC Alpha using Linux; and i386 using the Hurd[2].

Of these Guix does not support Linux on Alpha, while libsmbios does not
support the Hurd at all[3].

--
Simon South
simon@simonsouth.net

[0] https://en.wikipedia.org/wiki/System_Management_BIOS

[1] https://github.com/dell/libsmbios/blob/v2.4.3/src/libsmbios_c/cmos/cmos_linux.c#L25

[2] "find -type f -name 'io.h'" at the top level of glibc's source tree makes
    this apparent.

[3] https://github.com/dell/libsmbios/blob/v2.4.3/src/libsmbios_c/common/select_platform_config.h


Simon South (2):
  gnu: libsmbios: Restrict to only supported systems.
  gnu: fwupd: Depend on libsmbios only on supported systems.

 gnu/packages/firmware.scm | 37 ++++++++++++++++++++++---------------
 gnu/packages/hardware.scm |  1 +
 2 files changed, 23 insertions(+), 15 deletions(-)


base-commit: 5c0f77f4241c9beac0c82deae946bfdc70b49ff0
-- 
2.41.0





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

* [bug#68263] [PATCH v2 1/2] gnu: libsmbios: Restrict to only supported systems.
  2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
@ 2024-01-10 17:16   ` Simon South
  2024-01-10 17:16   ` [bug#68263] [PATCH v2 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
  2024-01-12 16:03   ` bug#68263: [PATCH v2 0/2] libsmbios: Restrict to only " Mathieu Othacehe
  2 siblings, 0 replies; 15+ messages in thread
From: Simon South @ 2024-01-10 17:16 UTC (permalink / raw)
  To: 68263; +Cc: Vagrant Cascadian, Mathieu Othacehe, Efraim Flashner

* gnu/packages/hardware.scm (libsmbios)[supported-systems]: New field.

Change-Id: I8d813f496b7d2ffa8b0af2a6c814d1b09d731387
---
 gnu/packages/hardware.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 59b95ab7c8..4765d1c55d 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -806,6 +806,7 @@ (define-public libsmbios
 also provides extensions for proprietary methods of interfacing with Dell
 specific SMBIOS tables.")
     (home-page "https://github.com/dell/libsmbios")
+    (supported-systems (list "i686-linux" "x86_64-linux"))
     (license
      (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))
 
-- 
2.41.0





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

* [bug#68263] [PATCH v2 2/2] gnu: fwupd: Depend on libsmbios only on supported systems.
  2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
  2024-01-10 17:16   ` [bug#68263] [PATCH v2 1/2] gnu: " Simon South
@ 2024-01-10 17:16   ` Simon South
  2024-01-12 16:03   ` bug#68263: [PATCH v2 0/2] libsmbios: Restrict to only " Mathieu Othacehe
  2 siblings, 0 replies; 15+ messages in thread
From: Simon South @ 2024-01-10 17:16 UTC (permalink / raw)
  To: 68263; +Cc: Vagrant Cascadian, Mathieu Othacehe, Efraim Flashner

* gnu/packages/firmware.scm (fwupd)[inputs]: Add libsmbios conditionally.

Change-Id: Id34135b180f5ee6e7abd2fd4eb10e0d3c6308e06
---
 gnu/packages/firmware.scm | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index e691bf33da..75294fadf4 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -31,6 +31,7 @@ (define-module (gnu packages firmware)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix memoization)
   #:use-module (guix packages)
+  #:use-module (guix platform)
   #:use-module (guix download)
   #:use-module (guix gexp)
   #:use-module (guix utils)
@@ -283,21 +284,27 @@ (define-public fwupd
                          `(,glib "bin")
                          help2man
                          gettext-minimal))
-    (inputs (list bash-completion
-                  libgudev
-                  libxmlb
-                  sqlite
-                  polkit
-                  eudev
-                  libelf
-                  tpm2-tss
-                  cairo
-                  efivar
-                  pango
-                  protobuf-c
-                  mingw-w64-tools
-                  libsmbios
-                  gnu-efi))
+    (inputs (append
+             (list bash-completion
+                   libgudev
+                   libxmlb
+                   sqlite
+                   polkit
+                   eudev
+                   libelf
+                   tpm2-tss
+                   cairo
+                   efivar
+                   pango
+                   protobuf-c
+                   mingw-w64-tools
+                   gnu-efi)
+             (if (supported-package? libsmbios
+                                     (or (and=> (%current-target-system)
+                                                platform-target->system)
+                                         (%current-system)))
+                 (list libsmbios)
+                 '())))
     ;; In Requires of fwupd*.pc.
     (propagated-inputs (list curl
                              gcab
-- 
2.41.0





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

* bug#68263: [PATCH v2 0/2] libsmbios: Restrict to only supported systems.
  2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
  2024-01-10 17:16   ` [bug#68263] [PATCH v2 1/2] gnu: " Simon South
  2024-01-10 17:16   ` [bug#68263] [PATCH v2 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
@ 2024-01-12 16:03   ` Mathieu Othacehe
  2 siblings, 0 replies; 15+ messages in thread
From: Mathieu Othacehe @ 2024-01-12 16:03 UTC (permalink / raw)
  To: Simon South; +Cc: Vagrant Cascadian, 68263-done, Efraim Flashner


Hello,

> Here's a revised version of this patchset, incorporating Mathieu Othacehe's
> advice regarding the use of %current-target-system with supported-package?
> (but using and=> for compactness and efficiency).
>
> I've tested cross-building fwupd from AArch64 to x86-64 and vice-versa and
> things now work as expected, apart from the nspr package failing to build due
> to what appears to be a limitation of its own build script.

Thanks for the v2. Applied!

Mathieu




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

end of thread, other threads:[~2024-01-12 16:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-05 14:45 [bug#68263] [PATCH 0/2] libsmbios: Restrict to only supported systems Simon South
2024-01-05 14:50 ` [bug#68263] [PATCH 1/2] gnu: " Simon South
2024-01-05 14:50 ` [bug#68263] [PATCH 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
2024-01-07 19:50 ` [bug#68263] [PATCH 0/2] libsmbios: Restrict to only " Mathieu Othacehe
2024-01-07 20:00   ` Efraim Flashner
2024-01-08  9:56     ` Mathieu Othacehe
2024-01-08 17:58       ` Simon South
2024-01-08 18:09         ` Efraim Flashner
2024-01-08 18:29           ` Simon South
2024-01-08 20:14             ` Mathieu Othacehe
2024-01-08 20:20               ` Simon South
2024-01-10 17:16 ` [bug#68263] [PATCH v2 " Simon South
2024-01-10 17:16   ` [bug#68263] [PATCH v2 1/2] gnu: " Simon South
2024-01-10 17:16   ` [bug#68263] [PATCH v2 2/2] gnu: fwupd: Depend on libsmbios only on " Simon South
2024-01-12 16:03   ` bug#68263: [PATCH v2 0/2] libsmbios: Restrict to only " Mathieu Othacehe

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.