Subject: [bug#68564] [PATCH] build-system: fix the Chicken build system

From: Ludovic Courtès <[email-masked]>
Date: Mon, 05 Feb 2024 22:35:31 +0100

Hi Daniel,

Daniel Ziltener <[email-masked]> skribis:

> ---
>  guix/build-system/chicken.scm       | 68 +++++++++++++++++++----------
>  guix/build/chicken-build-system.scm | 17 +++-----
>  2 files changed, 50 insertions(+), 35 deletions(-)

This change contains several seemingly unrelated changes, some
cosmetic/stylistic and others that have a functional impact, but it’s
not clear to me what the fix is.

Could you clarify what problem you’re trying to fix?

It’s also important to separate unrelated changes to help reviewers and
to help our future selves should we need to bisect the Git history.

>  (define %chicken-build-system-modules
>    ;; Build-side modules imported and used by default.
> -  `((guix build chicken-build-system)
> +  `((zilti build chicken-build-system)

Leftover change?

> +                        (modules '((zilti build chicken-build-system)

Ditto.

> +          #$(with-build-variables inputs outputs
> +              #~(chicken-build #:name #$name
> +                               #:source #+source

It’s best if we can avoid ‘with-build-variables’: ‘%build-inputs’ and
‘%outputs’, which this form adds, are now considered deprecated.

>  (define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
>    (setenv "CHICKEN_INSTALL_REPOSITORY"
> -          (string-concatenate
> -           ;; see TODO item about binary version above
> -           (append (list (assoc-ref outputs "out") "/var/lib/chicken/11/")
> -                   (let ((oldenv (getenv "CHICKEN_INSTALL_REPOSITORY")))
> -                     (if oldenv
> -                         (list  ":" oldenv)
> -                         '())))))
> +          (string-append (assoc-ref outputs "out") "/var/lib/chicken/11/"))
> +  (setenv "CHICKEN_INSTALL_PREFIX"
> +          (string-append (assoc-ref outputs "out") "/bin/"))
> +  (setenv "CHICKEN_REPOSITORY_PATH"
> +          (string-append (getenv "CHICKEN_REPOSITORY_PATH")
> +                         ":" (getenv "CHICKEN_INSTALL_REPOSITORY")))
>    (setenv "CHICKEN_EGG_CACHE" (getcwd))
>    #t)
>  
> @@ -104,10 +103,6 @@ (define* (check #:key egg-name tests? #:allow-other-keys)
>    ;; there is no "-test-only" option, but we've already run install
>    ;; so this just runs tests.
>    ;; i think it's a fair assumption that phases won't be reordered.
> -  (setenv "CHICKEN_REPOSITORY_PATH"
> -          (string-append (getenv "CHICKEN_INSTALL_REPOSITORY")
> -                         ":"
> -                         (getenv "CHICKEN_REPOSITORY_PATH")))

Could you explain why this statement is moved from one phase to the
other?

Thanks,
Ludo’.