guix-mirrors/gnu
Maxim Cournoyer 10e51d6dde
platforms: Raise an exception when no suitable platform is found.
This was motivated by #60786, which produced a cryptic, hard to understand
backtrace.

Given the following reproducer:
    (use-modules (guix packages)
                 (gnu packages cross-base))

    (define linux-libre-headers-cross-mips64el-linux-gnuabi64
      (cross-kernel-headers "mips64el-linux-gnuabi64"))

    (package-arguments linux-libre-headers-cross-mips64el-linux-gnuabi64)

Before this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f

After this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    ERROR:
      1. &platform-not-found-error: "mips64el-linux-gnuabi64"

* guix/platform.scm (&platform-not-found-error): New condition.
(platform-not-found-error?): New predicate.
(false-if-platform-not-found): New syntax.
(lookup-platform-by-system): Raise an exception when no platform is found.
Update documentation.
(lookup-platform-by-target): Likewise.
(lookup-platform-by-target-or-system): Likewise, and guard lookup calls with
false-if-platform-not-found.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Handle
lookup-platform-by-system call to preserve existing behavior.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-18 20:53:15 -05:00
..
bootloader gnu: u-boot-am335x-boneblack: Revert to old name. 2022-12-28 22:14:16 -05:00
build hurd-boot: Fix list of devices with translators. 2022-12-24 00:45:47 +01:00
home home: environment-variables: Fix escaping. 2023-01-09 12:22:56 +04:00
installer installer: final: Delete SQLite WAL and shm files upon completion. 2022-12-18 01:17:17 +01:00
machine
packages platforms: Raise an exception when no suitable platform is found. 2023-01-18 20:53:15 -05:00
services services: connman: Add iwd backend support. 2023-01-16 20:59:30 +04:00
system system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc. 2023-01-05 15:00:27 +01:00
tests gnu: Remove linux-libre 4.9. 2023-01-08 15:15:09 -05:00
artwork.scm
bootloader.scm gnu: bootloader: Rework chaining, add grub-efi-netboot-removable-bootloader. 2022-12-01 14:31:28 -05:00
ci.scm
compression.scm
home.scm
image.scm
installer.scm installer: Log provenance data. 2022-12-05 14:57:15 +01:00
local.mk gnu: qtwayland: Fix crashes from excessive number of frame callbacks. 2023-01-18 17:48:01 +04:00
machine.scm
packages.scm
services.scm
system.scm system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc. 2023-01-05 15:00:27 +01:00
tests.scm