mbox series

[bug#70985,0/4] Use specific errors for unsupported targets

Message ID 878r09ol8z.fsf@cbaines.net
Headers show
Series Use specific errors for unsupported targets | expand

Message

Christopher Baines May 16, 2024, 2:59 p.m. UTC
I think when computing derivations any errors except from a small list
should be treated as bugs.

This has become more of an issue with the avr, or1k-elf and
xtensa-ath9k-elf targets since these targets both seem to not support a
large number of packages, and lead to generic errors or crashes.

I'm seeing this because logs relating to errors computing package
derivations are now taking up most of the data service logs around
processing revisions.


Christopher Baines (4):
  guix: packages: Add new &package-unsupported-target-error.
  gnu: tls: Raise conditions from target->openssl-target.
  gnu: cross-libc*: Raise conditions rather than returning #f.
  guix: build-system: meson: Don't error on unsupported targets.

 gnu/packages/cross-base.scm |  12 +++-
 gnu/packages/tls.scm        |  17 ++++--
 guix/build-system/meson.scm | 115 +++++++++++++++++++-----------------
 guix/packages.scm           |   7 +++
 guix/ui.scm                 |   7 +++
 5 files changed, 98 insertions(+), 60 deletions(-)


base-commit: 5a624adfd7b14c3717237d137bd0766c77f0f570

Comments

Ludovic Courtès May 16, 2024, 3:16 p.m. UTC | #1
Christopher Baines <mail@cbaines.net> writes:

> I think when computing derivations any errors except from a small list
> should be treated as bugs.
>
> This has become more of an issue with the avr, or1k-elf and
> xtensa-ath9k-elf targets since these targets both seem to not support a
> large number of packages, and lead to generic errors or crashes.
>
> I'm seeing this because logs relating to errors computing package
> derivations are now taking up most of the data service logs around
> processing revisions.

Looks to me like a much welcome improvement, modulo the minor issues I
commented on.  Thanks!

Ludo'.
Jean-Pierre De Jesus DIAZ May 17, 2024, 9:53 a.m. UTC | #2
Hello,

>> Christopher Baines <mail@cbaines.net> writes:
>>
>>> As this means that the error will be clearer for targets which are
>>> unsupported.
>>>
>>> * gnu/packages/cross-base.scm (cross-libc*): Raise conditions rather than
>>> returning #f.
>>>
>>> Change-Id: I820780ad738d85a98950de5608f3019e961ff7c8
>>
>> [...]
>>
>>> -   (else #f)))
>>> +   (else
>>> +    (raise (condition
>>> +            (&package-unsupported-target-error
>>> +             (package libc)
>>> +             (target target)))))))
>>
>> What I'm unsure is whether this works with libc-less triplets such as
>> ‘avr’ or ‘or1k-elf’.
>
>Hmm, it seems like this is erroring in some cases where it didn't
>before, I'm not sure why though.
>
>I ended up here through rust-sysroot-for-... since it calls
>cross-libc. Handling cross-libc returning #f in the packages which use
>it seems error prone, hence adding the exception inside of cross-libc*.
>
>It looks liek cross-gcc-toolchain/implementation is expecting cross-libc
>to return #f in some cases though, so maybe I need to add a guard there
>somehow to handle the exception and ignore it, as happens when it
>returns #f.

This is because some targets as Ludovic mentioned don't have a proper
libc, like most *-elf targets.  Also, gnu-build-system also depends on
cross-libc returning #f to check for those targets that don't have a
libc in `cross-standard-packages'.

Thanks,

Jean-Pierre