mbox series

[bug#68263,0/2] libsmbios: Restrict to only supported systems.

Message ID cover.1704463873.git.simon@simonsouth.net
Headers show
Series libsmbios: Restrict to only supported systems. | expand

Message

Simon South Jan. 5, 2024, 2:45 p.m. UTC
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

Comments

Mathieu Othacehe Jan. 7, 2024, 7:50 p.m. UTC | #1
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
Efraim Flashner Jan. 7, 2024, 8 p.m. UTC | #2
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.