Subject: [bug#48224] [PATCH 2/2] gnu: guix: Phases refer to #:system and #:target.

From: Maxime Devos <[email-masked]>
Date: Tue, 04 May 2021 21:21:24 +0200

> The second patch is stylistic: it avoids missing phases, which I
> find more readable.

I don't see any missing phases. (I read this as ‘The second patch is
stylistic: it avoids making the existence of a phase dependent on
%current-target-system.’)

> -                               (guile  ,@(if (%current-target-system)
> -                                             '((assoc-ref native-inputs "guile"))
> -                                             '((assoc-ref inputs "guile"))))
> +                               (guile  (if target
> +                                           (assoc-ref native-inputs "guile")
> +                                           (assoc-ref inputs "guile")))

Something I tend to do is
  (assoc-ref (or native-inputs inputs) "guile")

Do you have any particular preference?

>                                 (deps   (list gcrypt json sqlite gnutls git
>                                               bs ssh zlib lzlib zstd guile-lib))
> -                               (deps*  ,@(if (%current-target-system)
> -                                             '(deps)
> -                                             '((cons avahi deps))))
> +                               (deps*  (if target deps (cons avahi deps)))

Why not simply
  ;; avahi is #f (not in 'inputs') when cross-compiling.
  ;; Remove it.
  (deps* (delete #f avahi))
?  Then, when guile-avahi becomes cross-compilable at some point, we only
need to adjust 'propagated-inputs' and not anything else.

Also, was this code (deps* ,@(if (%current-target-system) '(deps) ...)) needed in
the first place?  guile2.2-guix inherits its phases from guix, and guile2.2-guix does
not have a guile-zlib or guile-lzlib input.

Greetings,
Maxime.