GNU bug report logs - #77877
[PATCH] build-system: fix and future-proof Chicken build system.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Daniel Ziltener <dziltener@HIDDEN>; Keywords: patch; dated Thu, 17 Apr 2025 20:42:05 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 77877 <at> debbugs.gnu.org:


Received: (at 77877) by debbugs.gnu.org; 16 May 2025 10:39:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 06:39:57 2025
Received: from localhost ([127.0.0.1]:35391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFsTs-0006RC-0n
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 06:39:57 -0400
Received: from 195-15-242-23.dc3-a.pub1.etik-cloud.com ([195.15.242.23]:54581
 helo=lyrion.ch)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dziltener@HIDDEN>)
 id 1uFsTm-0006PV-Ut; Fri, 16 May 2025 06:39:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; 
 t=1747391986;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=873qTxzEoD+84htIZAst1wQL8RIGVie6yPS0IZgpo0Y=;
 b=cJPL3F9R6dxTOOj03waTx6bOLK09eRM2jwFXPE+h6hKJ9hI5me9BCY7NKHr4KtKOyQjWBi
 XvFvgZi9uhjfxOoiIYNMf0bmey6FlBpyNGxLfxizGpvjhKTiS64rLJIWbzp7RFgTRMuIdU
 c4bYsAkTJEpgQJOsqBmXl7JHQClbsvjxx43fDHZ0aZzaVQZJyPkac1jjKEl37hfQ4Y3th7
 8x4rSjC2WUx60+Caitd9aZEiDKWOhjeSZxa0FsIScUBgPhstw3X9x61PuogmuToIm7gjAd
 Ij8+p5JN7i03kZiJ6TvZoFGL747Yv97iCZVEuOXwjLhBfdpJMlX/oe+b6QzcnQ==
Received: from localhost (053d9243.dynamic.tele-ag.de [5.61.146.67])
 by lyrion.ch (OpenSMTPD) with ESMTPSA id 9bb49756
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Fri, 16 May 2025 10:39:46 +0000 (UTC)
From: Daniel Ziltener <dziltener@HIDDEN>
To: 77877 <at> debbugs.gnu.org, GNU bug tracker automated control server
 <control <at> debbugs.gnu.org>
Subject: Re: [PATCH] build-system: fix and future-proof Chicken build system.
User-Agent: mu4e 1.12.9; emacs 30.1
Date: Fri, 16 May 2025 12:39:42 +0200
Message-ID: <87h61kj0up.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 77877
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)


The actual commit message got somehow lost it seems... Well. The build
system did not set enough paths, so eggs with binaries would not work -
at least not as intended. Also, this fix removes the hardcoded binary
version. I will close this for now though; I think it is better to
release this alongside the upcoming Chicken 6 release that will happen
soon.

close 77877.
thanks.




Information forwarded to guix-patches@HIDDEN:
bug#77877; Package guix-patches. Full text available.

Message received at 77877 <at> debbugs.gnu.org:


Received: (at 77877) by debbugs.gnu.org; 14 May 2025 09:24:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 14 05:24:24 2025
Received: from localhost ([127.0.0.1]:39367 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uF8Lg-00014C-1o
	for submit <at> debbugs.gnu.org; Wed, 14 May 2025 05:24:24 -0400
Received: from 7.mo562.mail-out.ovh.net ([46.105.55.234]:32815)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>)
 id 1uF8Lb-00013I-NZ
 for 77877 <at> debbugs.gnu.org; Wed, 14 May 2025 05:24:21 -0400
Received: from director3.derp.mail-out.ovh.net
 (director3.derp.mail-out.ovh.net [152.228.215.222])
 by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zy7Fs3R31z1YXl
 for <77877 <at> debbugs.gnu.org>; Wed, 14 May 2025 09:24:17 +0000 (UTC)
Received: from director3.derp.mail-out.ovh.net
 (director3.derp.mail-out.ovh.net. [127.0.0.1])
 by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP
 for <77877 <at> debbugs.gnu.org>; Wed, 14 May 2025 09:24:17 +0000 (UTC)
Received: from mta11.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.109.176.8])
 by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id
 4Zy7Fs21mLz5xLl
 for <77877 <at> debbugs.gnu.org>; Wed, 14 May 2025 09:24:17 +0000 (UTC)
Received: from ngraves.fr (unknown [10.1.6.2])
 by mta11.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 16B9E263B1F
 for <77877 <at> debbugs.gnu.org>; Wed, 14 May 2025 09:24:17 +0000 (UTC)
Authentication-Results: garm.ovh; auth=pass
 (GARM-106R00668b17dfd-52ce-4098-89ac-7590d93566de,
 535A053C9A2C50C5AA54F3269335241C4C4E08D7) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 90.92.117.144
From: Nicolas Graves <ngraves@HIDDEN>
To: 77877 <at> debbugs.gnu.org
Subject: [PATCH] build-system: fix and future-proof Chicken build system.
Date: Wed, 14 May 2025 11:24:16 +0200
Message-ID: <87ldqzr1dr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Ovh-Tracer-Id: 7007882495737061915
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftdeiiedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueejleeileejfffhleetjedtleejheevudffleevgfdufeekhefgvddvveegveefnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejjeekjeejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedvmgdpmhhouggvpehsmhhtphhouhht
DKIM-Signature: a=rsa-sha256; bh=hGhOaZEuxhaHq0+hUwGObRY5gzkxUuvsr+9eiQEkU+U=; 
 c=relaxed/relaxed; d=ngraves.fr; h=From;
 s=ovhmo4487190-selector1; t=1747214657; v=1;
 b=bSENY1/KAwyDwQaVCEnbbjw0jnGJnowvF7wGRSXl1X07Gr0yYiDUkLCO7Xk314eFRpPKAdg8
 wEK/R6ych5LOx2Q2uBXuMfcYDMZO77x8sA+3vtIXFoMZJEolZzd+OM4AuktlPJSJeIJXpu+cCGP
 yCecQ88Dk5Xn2ufZ5+6T23BrcRIdQs132CTFqhlRsXuiw/jvWED8R+ayeOAaXpWWBoe9fAcZQI8
 FdWKTwCF9+4X8yzwQ3DvPbmZdzC3o9YtG7hDTNTM50trieLoKYb7eOpKaX+rRpZu97ptSopyuRf
 MSO3Q+Gfcjgtu6GUIrlj2a+HnHX9jgBQHP4M2L+yHKgAg==
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77877
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Daniel,

Could you be more precise about what is broken and fixed here?

The commit message could most likely be more precise, see other commit
messages.

I would be happy to review it.

-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches@HIDDEN:
bug#77877; Package guix-patches. Full text available.

Message received at 77877 <at> debbugs.gnu.org:


Received: (at 77877) by debbugs.gnu.org; 22 Apr 2025 16:54:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 22 12:54:45 2025
Received: from localhost ([127.0.0.1]:49667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u7GtQ-00059N-MS
	for submit <at> debbugs.gnu.org; Tue, 22 Apr 2025 12:54:45 -0400
Received: from 195-15-242-23.dc3-a.pub1.etik-cloud.com ([195.15.242.23]:62737
 helo=lyrion.ch)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dziltener@HIDDEN>)
 id 1u7GtN-000598-5z
 for 77877 <at> debbugs.gnu.org; Tue, 22 Apr 2025 12:54:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; 
 t=1745340876;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=eNUlOyq2ovqSowLA42cIluhduwbJkTL6OU7VjlhRZwQ=;
 b=IVFNgua6GtQw0bbWgY52ucX9RwPdx9v1Ct/xclWaWXTphW4IqR+vWmTKD9fa5dNoFb6EXq
 HdllF4R/i4lsos8rTUiIOP/vsezDf220K1WPncknXdQMOX38QHZt4osueX7NeoOdkwV9i6
 L5ir/iwkzVWxCFlkeKT4J0zNn4zNrbxF3eLIRaM+J4Ymd4IANmd/huQUV+tWJWy52AWaEi
 5cQkNCrZPlFe8V7Mt8Nv3Fry3h94A37oZmduJa60GivDneePjZ1YkTsKL9o26CHMwMtRDd
 zALsBE1GX7Ej40ANcfYgDxslJLMH8NG94Qlzzso7obsqX6HvRsHhLHGSdm4jFA==
Received: from localhost (cf597899.dynamic.tele-ag.de [207.89.120.153])
 by lyrion.ch (OpenSMTPD) with ESMTPSA id 309bc6a4
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Tue, 22 Apr 2025 16:54:36 +0000 (UTC)
From: Daniel Ziltener <dziltener@HIDDEN>
To: 77877 <at> debbugs.gnu.org
Subject: [PATCH] build-system: fix and future-proof Chicken build system.
Date: Tue, 22 Apr 2025 18:52:55 +0200
Message-ID: <20250422165430.11287-1-dziltener@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: This amendment removes the unused "chicken-package?"
 procedure.
 --- guix/build-system/chicken.scm | 87 +++++++++++++++++++
 guix/build/chicken-build-system.scm
 | 54 ++++++++++++------ 2 files changed, 94 insertions(+), 47 deletions(-)
 Content analysis details:   (2.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [195.15.242.23 listed in sa-trusted.bondedsender.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [195.15.242.23 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.4 RDNS_DYNAMIC           Delivered to internal network by host with
 dynamic-looking rDNS
X-Debbugs-Envelope-To: 77877
Cc: Daniel Ziltener <dziltener@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  This amendment removes the unused "chicken-package?" procedure.
    --- guix/build-system/chicken.scm | 87 +++++++++++++++++++ guix/build/chicken-build-system.scm
    | 54 ++++++++++++------ 2 files changed, 94 insertions(+), 47 deletions(-)
    
 
 Content analysis details:   (1.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [195.15.242.23 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [195.15.242.23 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.4 RDNS_DYNAMIC           Delivered to internal network by host with
                             dynamic-looking rDNS
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

This amendment removes the unused "chicken-package?" procedure.

---
 guix/build-system/chicken.scm       | 87 +++++++++++++++++++----------
 guix/build/chicken-build-system.scm | 54 ++++++++++++------
 2 files changed, 94 insertions(+), 47 deletions(-)

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index e6fcfa7ee3..c5705018d1 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@HIDDEN>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
+;;; Copyright © 2025 zilti <dziltener@HIDDEN>
 ;;;
 ;;; 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
     ,@%default-gnu-imported-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,38 +61,55 @@ (define* (lower name
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    '(#:target #:chicken #:inputs #:native-inputs))
+    '(#:target #:inputs #:native-inputs #:outputs))
 
   ;; TODO: cross-compilation support
   (and (not target)
        (bag
          (name name)
          (system system)
-         (host-inputs `(,@(if source
-                              `(("source" ,source))
-                              '())
-                        ,@inputs
+         (host-inputs
+          `(,@(if source
+                  `(("source" ,source))
+                  '())
+            ,@inputs
 
-                        ;; Keep the standard inputs of 'gnu-build-system', since
-                        ;; Chicken compiles Scheme by using C as an intermediate
-                        ;; language.
-                        ,@(standard-packages)))
+            ;; Keep the standard inputs of 'gnu-build-system', since
+            ;; Chicken compiles Scheme by using C as an intermediate
+            ;; language.
+            ,@(standard-packages)))
          (build-inputs `(("chicken" ,chicken)
                          ,@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
+                        (chicken (default-chicken))
                         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)
@@ -99,22 +120,28 @@ (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)))))
+          (chicken-build
+           #:name #$name
+           #:chicken #$chicken
+           #: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)))
+  (mlet %store-monad ((guile (package->derivation
+                              (or guile (default-guile))
+                              system #:graft? #f)))
     (gexp->derivation name builder
                       #:system system
                       #:guile-for-build guile)))
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index fd5a33fd22..6b1826ac5a 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@HIDDEN>
+;;; Copyright © 2025 zilti <dziltener@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,8 @@ (define-module (guix build chicken-build-system)
   #:use-module (guix build utils)
   #:use-module (ice-9 match)
   #:use-module (ice-9 ftw)
+  #:use-module (ice-9 rdelim)
+  #:use-module (ice-9 popen)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (rnrs io ports)
@@ -32,25 +35,42 @@ (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.
+(define (chicken-binary-version chicken)
+  (let* ((port (open-pipe*
+                OPEN_READ
+                (string-append chicken "/bin/csi")
+                "-p"
+                "(begin (import (chicken pathname) (chicken platform)) (pathname-file (car (repository-path))))"))
+         (str (read-line port)))
+    (close-pipe port)
+    str))
 
-(define (chicken-package? name)
-  (string-prefix? "chicken-" name))
+(define (chicken-lib-dir chicken)
+  (string-append
+   chicken "/var/lib/chicken/"
+   (chicken-binary-version chicken) "/"))
 
-(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)
-                         '())))))
-  (setenv "CHICKEN_EGG_CACHE" (getcwd))
-  #t)
+(define (egg-lib-dir chicken outputs)
+  (string-append
+   (assoc-ref outputs "out") "/var/lib/chicken/"
+   (chicken-binary-version chicken) "/"))
+
+(define* (setup-chicken-environment #:key inputs outputs chicken #:allow-other-keys)
+  (let ((chickenlibdir (chicken-lib-dir chicken))
+        (egglibdir (egg-lib-dir chicken outputs)))
+    (setenv "CHICKEN_INSTALL_REPOSITORY"
+            (string-concatenate
+             (append `(,egglibdir)
+                     (let ((oldenv (getenv "CHICKEN_INSTALL_REPOSITORY")))
+                       (if oldenv (list ":" oldenv) '())))))
+    (setenv "CHICKEN_INSTALL_PREFIX" (assoc-ref outputs "out"))
+    (setenv "CHICKEN_REPOSITORY_PATH"
+            (string-concatenate
+             (append `(,egglibdir ":" ,chickenlibdir)
+                     (let ((oldenv (getenv "CHICKEN_REPOSITORY_PATH")))
+                       (if oldenv (list ":" oldenv) '())))))
+    (setenv "CHICKEN_EGG_CACHE" (getcwd))
+    #t))
 
 ;; This is copied from go-build-system.scm so it could probably be simplified.
 ;; I used it because the source of the egg needs to be unpacked into a directory
-- 
2.49.0





Information forwarded to guix-patches@HIDDEN:
bug#77877; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Apr 2025 20:41:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 17 16:41:31 2025
Received: from localhost ([127.0.0.1]:48634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u5W35-0001kn-Nd
	for submit <at> debbugs.gnu.org; Thu, 17 Apr 2025 16:41:31 -0400
Received: from lists.gnu.org ([2001:470:142::17]:39680)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dziltener@HIDDEN>)
 id 1u5W2z-0001iu-Ca
 for submit <at> debbugs.gnu.org; Thu, 17 Apr 2025 16:41:25 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dziltener@HIDDEN>)
 id 1u5W2q-0000q8-1G
 for guix-patches@HIDDEN; Thu, 17 Apr 2025 16:41:12 -0400
Received: from 195-15-242-23.dc3-a.pub1.etik-cloud.com ([195.15.242.23]
 helo=lyrion.ch)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dziltener@HIDDEN>)
 id 1u5W2n-0005On-Mj
 for guix-patches@HIDDEN; Thu, 17 Apr 2025 16:41:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; 
 t=1744922059;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=x8jarDFs22g99j5s31Cr1YokBXxESmhRd3+UAXnBQPw=;
 b=Fmtwn1qCZjmHUhuGTgnHaHlatKyC9S6Gaps92GYfq6pFulYS3VlN+f/bVMc4vniflhsZt6
 IvFjS79XxKW2/wYDNSByQF9PG6kx8XqkoCjoValkGGRIUiwu7met/1+eLIlx/vi97ZSyJ7
 bKf/WTDkZhUaQIISMQh/rhVKhY4ocxXZzkC6jCwO/OtNvRJb5ezU/ZWJhRSqilWQXWVy28
 8I4cHfSEPy8pSyT66O86WATxfnLR0tvIgEfM/zN8lGfh6T62UQB1WHkGGbYButG+WJerzD
 v8ks8TDrFpTztg6F+57pdgdvJo74Or9bbc5Klf1HB/a5uwAoc/FXW0u/dK9wBw==
Received: from ziltis-machine.fritz.box (cf597899.dynamic.tele-ag.de
 [207.89.120.153]) by lyrion.ch (OpenSMTPD) with ESMTPSA id 642f9233
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Thu, 17 Apr 2025 20:34:19 +0000 (UTC)
From: Daniel Ziltener <dziltener@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] build-system: fix and future-proof Chicken build system.
Date: Thu, 17 Apr 2025 22:33:50 +0200
Message-ID: <20250417203400.29123-1-dziltener@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=195.15.242.23; envelope-from=dziltener@HIDDEN;
 helo=lyrion.ch
X-Spam_score_int: -10
X-Spam_score: -1.1
X-Spam_bar: -
X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  --- guix/build-system/chicken.scm | 87 +++++++++++++++++++
 guix/build/chicken-build-system.scm | 55 ++++++++++++------ 2 files changed,
 96 insertions(+), 46 deletions(-) diff --git a/guix/build-system/chicken.scm
 b/guix/build-system/chicken.scm index e6fcfa7ee3..c5705018d1 100644 ---
 a/guix/build-system/chicken.scm
 +++ b/guix/build-system/chicken.scm @@ -2,6 +2,7 @@ ; [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
 id=dziltener%40lyrion.ch; ip=2001%3A470%3A142%3A%3A17; r=debbugs.gnu.org]
X-Debbugs-Envelope-To: submit
Cc: Daniel Ziltener <dziltener@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  --- guix/build-system/chicken.scm | 87 +++++++++++++++++++
    guix/build/chicken-build-system.scm | 55 ++++++++++++------ 2 files changed,
    96 insertions(+), 46 deletions(-) diff --git a/guix/build-system/chicken.scm
    b/guix/build-system/chicken.scm index e6fcfa7ee3..c5705018d1 100644 --- a/guix/build-system/chicken.scm
    +++ b/guix/build-system/chicken.scm @@ -2,6 +2,7 @@ ; [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=dziltener%40lyrion.ch;ip=2001%3A470%3A142%3A%3A17;r=debbugs.gnu.org]
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

---
 guix/build-system/chicken.scm       | 87 +++++++++++++++++++----------
 guix/build/chicken-build-system.scm | 55 ++++++++++++------
 2 files changed, 96 insertions(+), 46 deletions(-)

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index e6fcfa7ee3..c5705018d1 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@HIDDEN>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
+;;; Copyright © 2025 zilti <dziltener@HIDDEN>
 ;;;
 ;;; 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
     ,@%default-gnu-imported-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,38 +61,55 @@ (define* (lower name
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    '(#:target #:chicken #:inputs #:native-inputs))
+    '(#:target #:inputs #:native-inputs #:outputs))
 
   ;; TODO: cross-compilation support
   (and (not target)
        (bag
          (name name)
          (system system)
-         (host-inputs `(,@(if source
-                              `(("source" ,source))
-                              '())
-                        ,@inputs
+         (host-inputs
+          `(,@(if source
+                  `(("source" ,source))
+                  '())
+            ,@inputs
 
-                        ;; Keep the standard inputs of 'gnu-build-system', since
-                        ;; Chicken compiles Scheme by using C as an intermediate
-                        ;; language.
-                        ,@(standard-packages)))
+            ;; Keep the standard inputs of 'gnu-build-system', since
+            ;; Chicken compiles Scheme by using C as an intermediate
+            ;; language.
+            ,@(standard-packages)))
          (build-inputs `(("chicken" ,chicken)
                          ,@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
+                        (chicken (default-chicken))
                         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)
@@ -99,22 +120,28 @@ (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)))))
+          (chicken-build
+           #:name #$name
+           #:chicken #$chicken
+           #: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)))
+  (mlet %store-monad ((guile (package->derivation
+                              (or guile (default-guile))
+                              system #:graft? #f)))
     (gexp->derivation name builder
                       #:system system
                       #:guile-for-build guile)))
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index fd5a33fd22..b7c5ae4acd 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@HIDDEN>
+;;; Copyright © 2025 zilti <dziltener@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,8 @@ (define-module (guix build chicken-build-system)
   #:use-module (guix build utils)
   #:use-module (ice-9 match)
   #:use-module (ice-9 ftw)
+  #:use-module (ice-9 rdelim)
+  #:use-module (ice-9 popen)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (rnrs io ports)
@@ -32,25 +35,45 @@ (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.
-
 (define (chicken-package? name)
   (string-prefix? "chicken-" 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)
-                         '())))))
-  (setenv "CHICKEN_EGG_CACHE" (getcwd))
-  #t)
+(define (chicken-binary-version chicken)
+  (let* ((port (open-pipe*
+                OPEN_READ
+                (string-append chicken "/bin/csi")
+                "-p"
+                "(begin (import (chicken pathname) (chicken platform)) (pathname-file (car (repository-path))))"))
+         (str (read-line port)))
+    (close-pipe port)
+    str))
+
+(define (chicken-lib-dir chicken)
+  (string-append
+   chicken "/var/lib/chicken/"
+   (chicken-binary-version chicken) "/"))
+
+(define (egg-lib-dir chicken outputs)
+  (string-append
+   (assoc-ref outputs "out") "/var/lib/chicken/"
+   (chicken-binary-version chicken) "/"))
+
+(define* (setup-chicken-environment #:key inputs outputs chicken #:allow-other-keys)
+  (let ((chickenlibdir (chicken-lib-dir chicken))
+        (egglibdir (egg-lib-dir chicken outputs)))
+    (setenv "CHICKEN_INSTALL_REPOSITORY"
+            (string-concatenate
+             (append `(,egglibdir)
+                     (let ((oldenv (getenv "CHICKEN_INSTALL_REPOSITORY")))
+                       (if oldenv (list ":" oldenv) '())))))
+    (setenv "CHICKEN_INSTALL_PREFIX" (assoc-ref outputs "out"))
+    (setenv "CHICKEN_REPOSITORY_PATH"
+            (string-concatenate
+             (append `(,egglibdir ":" ,chickenlibdir)
+                     (let ((oldenv (getenv "CHICKEN_REPOSITORY_PATH")))
+                       (if oldenv (list ":" oldenv) '())))))
+    (setenv "CHICKEN_EGG_CACHE" (getcwd))
+    #t))
 
 ;; This is copied from go-build-system.scm so it could probably be simplified.
 ;; I used it because the source of the egg needs to be unpacked into a directory
-- 
2.49.0





Acknowledgement sent to Daniel Ziltener <dziltener@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#77877; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 16 May 2025 10:45:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.