all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Proposed (guix platforms) lookup procedures API change
@ 2023-01-14  3:23 Maxim Cournoyer
  2023-01-16 10:51 ` Simon Tournier
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2023-01-14  3:23 UTC (permalink / raw)
  To: info-guix@gnu.org mailing list; +Cc: guix-devel

Hello,

There is currently a proposed change [0] to modify the behavior of the
LOOKUP-PLATFORM-BY-SYSTEM, LOOKUP-PLATFORM-BY-TARGET and
LOOKUP-PLATFORM-BY-TARGET-OR-SYSTEM public procedures from (guix
platforms) that would have them return an exception instead of #f when
no platform could be found.

[0]  https://issues.guix.gnu.org/60802

This is motivated so that a clearer error can be produced when these
procedures are used deep in the following reproducer:

--8<---------------cut here---------------start------------->8---
(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)

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

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [1]> ,bt
In gnu/packages/cross-base.scm:
   388:33  1 (loop (#:phases (modify-phases %standard-phases (delete (quote configure)) (# (…) …) …) …) …)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)
--8<---------------cut here---------------end--------------->8---

With the change installed, the backtrace now reads as:

--8<---------------cut here---------------start------------->8---
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
ERROR:
  1. &platform-not-found-error

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [1]> ,bt
In gnu/packages/cross-base.scm:
   383:15  3 (arguments #<package linux-libre-headers-cross-mips64el-linux-gnuabi64@5.10.35 gnu/packag…>)
In gnu/packages/linux.scm:
   693:27  2 (arguments #<package linux-libre-headers@5.10.35 gnu/packages/linux.scm:672 7f409be93a50>)
In guix/platform.scm:
    130:6  1 (lookup-platform-by-target-or-system "x86_64-linux")
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)
--8<---------------cut here---------------end--------------->8---

which more directly communicates the source of the problem.

For more information, see the issue that motivated it:
https://issues.guix.gnu.org/60786

-- 
Thanks,
Maxim


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

* Re: Proposed (guix platforms) lookup procedures API change
  2023-01-14  3:23 Proposed (guix platforms) lookup procedures API change Maxim Cournoyer
@ 2023-01-16 10:51 ` Simon Tournier
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Tournier @ 2023-01-16 10:51 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: guix-devel

Hi Maxim,

On ven., 13 janv. 2023 at 22:23, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> There is currently a proposed change [0] to modify the behavior of the
> LOOKUP-PLATFORM-BY-SYSTEM, LOOKUP-PLATFORM-BY-TARGET and
> LOOKUP-PLATFORM-BY-TARGET-OR-SYSTEM public procedures from (guix
> platforms) that would have them return an exception instead of #f when
> no platform could be found.
>
> [0]  https://issues.guix.gnu.org/60802

Good idea.

Just to note that the only place using (ice-9 exceptions) is in the
module (guix build minetest-build-system).  Instead, the exceptions are
using SRFI-35 [1].

1: <https://www.gnu.org/software/guile/manual/html_node/SRFI_002d35.html>


Cheers,
simon







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

end of thread, other threads:[~2023-01-16 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-14  3:23 Proposed (guix platforms) lookup procedures API change Maxim Cournoyer
2023-01-16 10:51 ` Simon Tournier

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.