mbox series

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

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

Message

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

Comments

Mathieu Othacehe Jan. 12, 2024, 4:03 p.m. UTC | #1
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