unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68564] [PATCH] build-system: fix the Chicken build system
@ 2024-01-18 10:09 Daniel Ziltener via Guix-patches via
  2024-02-05 21:35 ` Ludovic Courtès
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Daniel Ziltener via Guix-patches via @ 2024-01-18 10:09 UTC (permalink / raw)
  To: 68564; +Cc: dziltener

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7716 bytes --]

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

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 9f518e66e6..8c6b1f5e75 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,8 @@ (define-module (guix build-system chicken)
   #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
   #:use-module (guix packages)
   #:export (%chicken-build-system-modules
             chicken-build
@@ -40,15 +43,15 @@ (define* (egg-uri name version #:optional (extension ".tar.gz"))
 
 (define %chicken-build-system-modules
   ;; Build-side modules imported and used by default.
-  `((guix build chicken-build-system)
+  `((zilti build chicken-build-system)
     (guix build union)
     ,@%gnu-build-system-modules))
 
 (define (default-chicken)
+  "Return the default Chicken package."
   ;; Lazily resolve the binding to avoid a circular dependency.
-  ;; TODO is this actually needed in every build system?
   (let ((chicken (resolve-interface '(gnu packages chicken))))
-      (module-ref chicken 'chicken)))
+    (module-ref chicken 'chicken)))
 
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
@@ -57,7 +60,7 @@ (define* (lower name
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    '(#:target #:chicken #:inputs #:native-inputs))
+    '(#:target #:chicken #:inputs #:native-inputs #:outputs))
 
   ;; TODO: cross-compilation support
   (and (not target)
@@ -77,41 +80,58 @@ (define private-keywords
                          ,@native-inputs))
          (outputs outputs)
          (build chicken-build)
-         (arguments (strip-keyword-arguments private-keywords arguments)))))
+         (arguments
+          (substitute-keyword-arguments
+              (strip-keyword-arguments private-keywords arguments)
+            ((#:extra-directories extra-directories)
+             `(list ,@(append-map
+                       (lambda (name)
+                         (match (assoc name inputs)
+                           ((_ pkg)
+                            (match (package-transitive-propagated-inputs pkg)
+                              (((propagated-names . _) ...)
+                               (cons name propagated-names))))))
+                       extra-directories))))))))
 
 (define* (chicken-build name inputs
-                        #:key
-                        source
+                        #:key source
+                        (tests? #t)
+                        (parallel-build? #f)
+                        (build-flags ''())
+                        (configure-flags ''())
+                        (extra-directories ''())
                         (phases '%standard-phases)
-                        (outputs '("out"))
+                        (outputs '("out" "static"))
                         (search-paths '())
                         (egg-name "")
                         (unpack-path "")
-                        (build-flags ''())
-                        (tests? #t)
                         (system (%current-system))
                         (guile #f)
                         (imported-modules %chicken-build-system-modules)
-                        (modules '((guix build chicken-build-system)
+                        (modules '((zilti build chicken-build-system)
                                    (guix build union)
                                    (guix build utils))))
   (define builder
     (with-imported-modules imported-modules
       #~(begin
           (use-modules #$@(sexp->gexp modules))
-          (chicken-build #:name #$name
-                         #:source #+source
-                         #:system #$system
-                         #:phases #$phases
-                         #:outputs #$(outputs->gexp outputs)
-                         #:search-paths '#$(sexp->gexp
-                                            (map search-path-specification->sexp
-                                                 search-paths))
-                         #:egg-name #$egg-name
-                         #:unpack-path #$unpack-path
-                         #:build-flags #$build-flags
-                         #:tests? #$tests?
-                         #:inputs #$(input-tuples->gexp inputs)))))
+          #$(with-build-variables inputs outputs
+              #~(chicken-build #:name #$name
+                               #:source #+source
+                               #:system #$system
+                               #:phases #$phases
+                               #:configure-flags #$configure-flags
+                               #:extra-directories #$extra-directories
+                               #:parallel-build? #$parallel-build?
+                               #:outputs #$(outputs->gexp outputs)
+                               #:search-paths '#$(sexp->gexp
+                                                  (map search-path-specification->sexp
+                                                       search-paths))
+                               #:egg-name #$egg-name
+                               #:unpack-path #$unpack-path
+                               #:build-flags #$build-flags
+                               #:tests? #$tests?
+                               #:inputs #$(input-tuples->gexp inputs))))))
 
   (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                   system #:graft? #f)))
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 8f9f59cc25..6a4f0c43eb 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -42,13 +42,12 @@ (define (chicken-package? name)
 
 (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")))
   (when tests?
     (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
 
-- 
2.41.0





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

* [bug#68564] [PATCH] build-system: fix the Chicken build system
  2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
@ 2024-02-05 21:35 ` Ludovic Courtès
  2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2024-02-05 21:35 UTC (permalink / raw)
  To: Daniel Ziltener; +Cc: 68564

Hi Daniel,

Daniel Ziltener <dziltener@lyrion.ch> 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’.




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

* [bug#68564] [PATCH] build-system: fix the Chicken build system
  2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
  2024-02-05 21:35 ` Ludovic Courtès
@ 2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
  2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Ziltener via Guix-patches via @ 2024-03-07 21:45 UTC (permalink / raw)
  To: 68564; +Cc: dziltener

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7840 bytes --]

---
 guix/build-system/chicken.scm       | 38 ++++++++++++++++++++++-------
 guix/build/chicken-build-system.scm | 27 +++++++++-----------
 2 files changed, 41 insertions(+), 24 deletions(-)

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 9f518e66e6..e2b93391bf 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,9 +24,12 @@ (define-module (guix build-system chicken)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix monads)
+  #:use-module (guix download)
   #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
   #:use-module (guix packages)
   #:export (%chicken-build-system-modules
             chicken-build
@@ -45,10 +49,10 @@ (define %chicken-build-system-modules
     ,@%gnu-build-system-modules))
 
 (define (default-chicken)
+  "Return the default Chicken package."
   ;; Lazily resolve the binding to avoid a circular dependency.
-  ;; TODO is this actually needed in every build system?
   (let ((chicken (resolve-interface '(gnu packages chicken))))
-      (module-ref chicken 'chicken)))
+    (module-ref chicken 'chicken)))
 
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
@@ -57,7 +61,7 @@ (define* (lower name
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    '(#:target #:chicken #:inputs #:native-inputs))
+    '(#:target #:chicken #:inputs #:native-inputs #:outputs))
 
   ;; TODO: cross-compilation support
   (and (not target)
@@ -77,18 +81,31 @@ (define private-keywords
                          ,@native-inputs))
          (outputs outputs)
          (build chicken-build)
-         (arguments (strip-keyword-arguments private-keywords arguments)))))
+         (arguments
+          (substitute-keyword-arguments
+              (strip-keyword-arguments private-keywords arguments)
+            ((#:extra-directories extra-directories)
+             `(list ,@(append-map
+                       (lambda (name)
+                         (match (assoc name inputs)
+                           ((_ pkg)
+                            (match (package-transitive-propagated-inputs pkg)
+                              (((propagated-names . _) ...)
+                               (cons name propagated-names))))))
+                       extra-directories))))))))
 
 (define* (chicken-build name inputs
-                        #:key
-                        source
+                        #:key source
+                        (tests? #t)
+                        (parallel-build? #f)
+                        (build-flags ''())
+                        (configure-flags ''())
+                        (extra-directories ''())
                         (phases '%standard-phases)
-                        (outputs '("out"))
+                        (outputs '("out" "static"))
                         (search-paths '())
                         (egg-name "")
                         (unpack-path "")
-                        (build-flags ''())
-                        (tests? #t)
                         (system (%current-system))
                         (guile #f)
                         (imported-modules %chicken-build-system-modules)
@@ -103,6 +120,9 @@ (define builder
                          #:source #+source
                          #:system #$system
                          #:phases #$phases
+                         #:configure-flags #$configure-flags
+                         #:extra-directories #$extra-directories
+                         #:parallel-build? #$parallel-build?
                          #:outputs #$(outputs->gexp outputs)
                          #:search-paths '#$(sexp->gexp
                                             (map search-path-specification->sexp
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 8f9f59cc25..1b8a50621e 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,7 +33,6 @@ (define-module (guix build chicken-build-system)
 ;; CHICKEN_INSTALL_REPOSITORY is where dependencies are looked up
 ;; its first component is also where new eggs are installed.
 
-;; TODO: deduplicate with go-build-system.scm ?
 ;; TODO: the binary version should be defined in one of the relevant modules
 ;; instead of being hardcoded everywhere. Tried to do that but got undefined
 ;; variable errors.
@@ -42,13 +42,12 @@ (define (chicken-package? name)
 
 (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)
 
@@ -58,9 +57,9 @@ (define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
 (define* (unpack #:key source egg-name unpack-path #:allow-other-keys)
   "Relative to $CHICKEN_EGG_CACHE, unpack SOURCE in UNPACK-PATH, or EGG-NAME
 when UNPACK-PATH is unset.  If the SOURCE archive has a single top level
-directory, it is stripped so that the sources appear directly under UNPACK-PATH.
-When SOURCE is a directory, copy its content into UNPACK-PATH instead of
-unpacking."
+directory, it is stripped so that the sources appear directly under
+UNPACK-PATH.  When SOURCE is a directory, copy its content into UNPACK-PATH
+instead of unpacking."
   (define (unpack-maybe-strip source dest)
     (let* ((scratch-dir (string-append (or (getenv "TMPDIR") "/tmp")
                                        "/scratch-dir"))
@@ -93,6 +92,7 @@ (define (unpack-maybe-strip source dest)
 
 (define* (build #:key egg-name #:allow-other-keys)
   "Build the Chicken egg named by EGG-NAME"
+  (invoke "echo" (getenv "CHICKEN_REPOSITORY_PATH"))
   (invoke "chicken-install" "-cached" "-no-install" egg-name))
 
 (define* (install #:key egg-name #:allow-other-keys)
@@ -104,11 +104,8 @@ (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")))
   (when tests?
+    (invoke "echo" (getenv "CHICKEN_REPOSITORY_PATH"))
     (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
 
 (define* (stamp-egg-version #:key egg-name name #:allow-other-keys)
-- 
2.44.0





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

* [bug#68564] [PATCH] build-system: fix the Chicken build system
  2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
  2024-02-05 21:35 ` Ludovic Courtès
  2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
@ 2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
  2024-03-08  9:49 ` Daniel Ziltener via Guix-patches via
  2024-03-26 13:18 ` Daniel Ziltener via Guix-patches via
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Ziltener via Guix-patches via @ 2024-03-07 21:45 UTC (permalink / raw)
  To: 68564; +Cc: dziltener

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7382 bytes --]

---
 guix/build-system/chicken.scm       | 38 ++++++++++++++++++++++-------
 guix/build/chicken-build-system.scm | 25 ++++++++-----------
 2 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 9f518e66e6..e2b93391bf 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,9 +24,12 @@ (define-module (guix build-system chicken)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix monads)
+  #:use-module (guix download)
   #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
   #:use-module (guix packages)
   #:export (%chicken-build-system-modules
             chicken-build
@@ -45,10 +49,10 @@ (define %chicken-build-system-modules
     ,@%gnu-build-system-modules))
 
 (define (default-chicken)
+  "Return the default Chicken package."
   ;; Lazily resolve the binding to avoid a circular dependency.
-  ;; TODO is this actually needed in every build system?
   (let ((chicken (resolve-interface '(gnu packages chicken))))
-      (module-ref chicken 'chicken)))
+    (module-ref chicken 'chicken)))
 
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
@@ -57,7 +61,7 @@ (define* (lower name
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    '(#:target #:chicken #:inputs #:native-inputs))
+    '(#:target #:chicken #:inputs #:native-inputs #:outputs))
 
   ;; TODO: cross-compilation support
   (and (not target)
@@ -77,18 +81,31 @@ (define private-keywords
                          ,@native-inputs))
          (outputs outputs)
          (build chicken-build)
-         (arguments (strip-keyword-arguments private-keywords arguments)))))
+         (arguments
+          (substitute-keyword-arguments
+              (strip-keyword-arguments private-keywords arguments)
+            ((#:extra-directories extra-directories)
+             `(list ,@(append-map
+                       (lambda (name)
+                         (match (assoc name inputs)
+                           ((_ pkg)
+                            (match (package-transitive-propagated-inputs pkg)
+                              (((propagated-names . _) ...)
+                               (cons name propagated-names))))))
+                       extra-directories))))))))
 
 (define* (chicken-build name inputs
-                        #:key
-                        source
+                        #:key source
+                        (tests? #t)
+                        (parallel-build? #f)
+                        (build-flags ''())
+                        (configure-flags ''())
+                        (extra-directories ''())
                         (phases '%standard-phases)
-                        (outputs '("out"))
+                        (outputs '("out" "static"))
                         (search-paths '())
                         (egg-name "")
                         (unpack-path "")
-                        (build-flags ''())
-                        (tests? #t)
                         (system (%current-system))
                         (guile #f)
                         (imported-modules %chicken-build-system-modules)
@@ -103,6 +120,9 @@ (define builder
                          #:source #+source
                          #:system #$system
                          #:phases #$phases
+                         #:configure-flags #$configure-flags
+                         #:extra-directories #$extra-directories
+                         #:parallel-build? #$parallel-build?
                          #:outputs #$(outputs->gexp outputs)
                          #:search-paths '#$(sexp->gexp
                                             (map search-path-specification->sexp
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 8f9f59cc25..944f023987 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,7 +33,6 @@ (define-module (guix build chicken-build-system)
 ;; CHICKEN_INSTALL_REPOSITORY is where dependencies are looked up
 ;; its first component is also where new eggs are installed.
 
-;; TODO: deduplicate with go-build-system.scm ?
 ;; TODO: the binary version should be defined in one of the relevant modules
 ;; instead of being hardcoded everywhere. Tried to do that but got undefined
 ;; variable errors.
@@ -42,13 +42,12 @@ (define (chicken-package? name)
 
 (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)
 
@@ -58,9 +57,9 @@ (define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
 (define* (unpack #:key source egg-name unpack-path #:allow-other-keys)
   "Relative to $CHICKEN_EGG_CACHE, unpack SOURCE in UNPACK-PATH, or EGG-NAME
 when UNPACK-PATH is unset.  If the SOURCE archive has a single top level
-directory, it is stripped so that the sources appear directly under UNPACK-PATH.
-When SOURCE is a directory, copy its content into UNPACK-PATH instead of
-unpacking."
+directory, it is stripped so that the sources appear directly under
+UNPACK-PATH.  When SOURCE is a directory, copy its content into UNPACK-PATH
+instead of unpacking."
   (define (unpack-maybe-strip source dest)
     (let* ((scratch-dir (string-append (or (getenv "TMPDIR") "/tmp")
                                        "/scratch-dir"))
@@ -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")))
   (when tests?
     (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
 
-- 
2.44.0





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

* [bug#68564] [PATCH] build-system: fix the Chicken build system
  2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
                   ` (2 preceding siblings ...)
  2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
@ 2024-03-08  9:49 ` Daniel Ziltener via Guix-patches via
  2024-03-26 13:18 ` Daniel Ziltener via Guix-patches via
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Ziltener via Guix-patches via @ 2024-03-08  9:49 UTC (permalink / raw)
  To: 68564

Sorry for the late correction. I removed the `with-build-variables` again.

The reasons I moved the `setenv` are: I wanted to have them grouped 
together, and the CHICKEN_REPOSITORY_PATH is now used properly; before 
that, I assume that whoever wrote the build system mistakenly thought 
CHICKEN_INSTALL_REPOSITORY would be equivalent, which it is not. I also 
just noticed I've left "echo" statements now; I'll remove them in a next 
message.

Best regards,
Daniel Ziltener





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

* [bug#68564] [PATCH] build-system: fix the Chicken build system
  2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
                   ` (3 preceding siblings ...)
  2024-03-08  9:49 ` Daniel Ziltener via Guix-patches via
@ 2024-03-26 13:18 ` Daniel Ziltener via Guix-patches via
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Ziltener via Guix-patches via @ 2024-03-26 13:18 UTC (permalink / raw)
  To: 68564, control

close 68564

thanks





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

end of thread, other threads:[~2024-03-26 13:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 10:09 [bug#68564] [PATCH] build-system: fix the Chicken build system Daniel Ziltener via Guix-patches via
2024-02-05 21:35 ` Ludovic Courtès
2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
2024-03-07 21:45 ` Daniel Ziltener via Guix-patches via
2024-03-08  9:49 ` Daniel Ziltener via Guix-patches via
2024-03-26 13:18 ` Daniel Ziltener via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).