From unknown Sat Jun 14 18:37:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#70005] [PATCH 0/1] guix: chicken-build-system: fix the build system Resent-From: Daniel Ziltener Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Mar 2024 15:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70005 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70005@debbugs.gnu.org Cc: dziltener@lyrion.ch X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17114664845997 (code B ref -1); Tue, 26 Mar 2024 15:22:03 +0000 Received: (at submit) by debbugs.gnu.org; 26 Mar 2024 15:21:24 +0000 Received: from localhost ([127.0.0.1]:34448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp8c7-0001Ye-Uz for submit@debbugs.gnu.org; Tue, 26 Mar 2024 11:21:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:49758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp8c1-0001X1-Ou for submit@debbugs.gnu.org; Tue, 26 Mar 2024 11:21:19 -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 ) id 1rp7Iy-0000eI-Sq for guix-patches@gnu.org; Tue, 26 Mar 2024 09:57:34 -0400 Received: from 195-15-241-199.dc3-a.pub1.etik-cloud.com ([195.15.241.199] helo=lyrion.ch) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rp7It-0002NT-OY for guix-patches@gnu.org; Tue, 26 Mar 2024 09:57:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; t=1711461439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=N8qLXqSpiojB0Wro5duAZkcC4gTPhrpN5ljOKiskYIc=; b=tk/Gg5GBtMwonsWEnCRyDM3swGCZFJCTw9WB/rkUjck577SMsRDneLIen00wuLyIyeU20T 1kxqv+I06HjNu8ei3IJOaEL117WRqBNAepuhzV0ZBaARowG3r2ftdqtY+gPXSV5JmdJtty E3Ki4MAwAE0l+8Im/iepav2YInYHSkg6F3Oc8sorgTWWUa92CUzgktqpw1K8MkR95G4vRl OQrDO7X+dIk+tK0Vtch1zZTAv2lXFhWWAFtJCMIi364XS/am+SvUfe/FD6nCpAFKy9C/Gr KnwEC/oKqQcoLezYutvm6ERXeQ8mkm3S3fTSH9Cd9yJihQnUjimFcGr41teFWg== Received: from localhost ( [2a00:1f:99c0:3c01:8fc9:e8ec:45e0:6cde]) by lyrion.ch (OpenSMTPD) with ESMTPSA id 246c1764 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 26 Mar 2024 13:57:19 +0000 (UTC) Message-ID: From: Daniel Ziltener Date: Tue, 26 Mar 2024 14:55:48 +0100 Received-SPF: pass client-ip=195.15.241.199; envelope-from=dziltener@lyrion.ch; 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, 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: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The build system for Chicken as-is works for basic eggs, but contains some assumptions that make it fail with more sophisticated ones. The main wrong assumption is that CHICKEN_INSTALL_REPOSITORY is enough to cover all cases; it is not. CHICKEN_INSTALL_PREFIX is needed, too, and CHICKEN_REPOSITORY_PATH has to be concatenated to the CHICKEN_INSTALL_REPOSITORY. I also took the liberty to move the env variable definitions all to one place to improve readability. Daniel Ziltener (1): guix: chicken-build-system: fix the build system guix/build-system/chicken.scm | 42 +++++++++++++++++++++-------- guix/build/chicken-build-system.scm | 24 +++++++---------- 2 files changed, 41 insertions(+), 25 deletions(-) -- 2.41.0 From unknown Sat Jun 14 18:37:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#70005] [PATCH 1/1] guix: chicken-build-system: fix the build system References: In-Reply-To: Resent-From: Daniel Ziltener Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Mar 2024 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70005 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70005@debbugs.gnu.org Cc: dziltener@lyrion.ch Received: via spool by 70005-submit@debbugs.gnu.org id=B70005.17114672688203 (code B ref 70005); Tue, 26 Mar 2024 15:35:02 +0000 Received: (at 70005) by debbugs.gnu.org; 26 Mar 2024 15:34:28 +0000 Received: from localhost ([127.0.0.1]:34484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp8ol-00028C-JI for submit@debbugs.gnu.org; Tue, 26 Mar 2024 11:34:28 -0400 Received: from 195-15-241-199.dc3-a.pub1.etik-cloud.com ([195.15.241.199]:60117 helo=lyrion.ch) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rp8oi-00027e-7B for 70005@debbugs.gnu.org; Tue, 26 Mar 2024 11:34:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; t=1711467260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=asoV4dQH/AdOlEorAoNTk2G7t/nnIycDXJiX6TfwMTg=; b=3nwvTbqXLzwG2dUibFy15+Gs8IC4Nm+/+3ICOPxhuWKf99QcuHHrLn6nX1mEXog7/zaq82 UgetYKYYDnTg5nuVmmu0gV3I/lbWFYiBBzh8lPFlzvBX2swv07UykLIQ1MU0Wy7Gv94M/o VI2/2vXZqZYe4EInq80535lhKyCdnigRdl5zosJqKCWNG7vZwzeMCEjMj5J+beBJDN9kPA I2va9lgddQGLHXrCD1k4Fjw/Ur0x6M5lYJOMqbpkof79NDNor/y4WzORQ1Fy6Prr699lgV 9Haovd1Ah96+IJQ8NqQr5buvVD2PJQbsVg3Ws3uN0nJkk2Dm7Mf4VZ3Oa2fc6A== Received: from localhost ( [2a00:1f:99c0:3c01:8fc9:e8ec:45e0:6cde]) by lyrion.ch (OpenSMTPD) with ESMTPSA id 521d0c9f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 26 Mar 2024 15:34:20 +0000 (UTC) Message-ID: <87a293d63099d7121384ebd12a1274c0@lyrion.ch> From: Daniel Ziltener Date: Tue, 26 Mar 2024 14:48:06 +0100 X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --- guix/build-system/chicken.scm | 42 +++++++++++++++++++++-------- guix/build/chicken-build-system.scm | 24 +++++++---------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm index 9f518e66e6..e2b512446a 100644 --- a/guix/build-system/chicken.scm +++ b/guix/build-system/chicken.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2020 raingloom ;;; Copyright © 2021 Ludovic Courtès ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2024 Daniel Ziltener ;;; ;;; 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 @@ -40,15 +44,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 +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,22 +81,35 @@ (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 @@ -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..0c250e9376 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 +;;; Copyright © 2024 Daniel Ziltener ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,13 +43,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" + (assoc-ref outputs "out")) + (setenv "CHICKEN_REPOSITORY_PATH" + (string-append (getenv "CHICKEN_REPOSITORY_PATH") + ":" (getenv "CHICKEN_INSTALL_REPOSITORY"))) (setenv "CHICKEN_EGG_CACHE" (getcwd)) #t) @@ -58,9 +58,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 +104,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