From patchwork Tue Jan 16 21:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Ziltener X-Patchwork-Id: 58953 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3691227BBEA; Tue, 16 Jan 2024 21:06:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS,SPF_HELO_PASS,URIBL_BLOCKED,URIBL_CSS_A autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 204D327BBE2 for ; Tue, 16 Jan 2024 21:06:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPqdJ-0006RQ-EY; Tue, 16 Jan 2024 16:06:05 -0500 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 1rPqdF-0006R6-Uh for guix-patches@gnu.org; Tue, 16 Jan 2024 16:06:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPqdF-0000ow-CO for guix-patches@gnu.org; Tue, 16 Jan 2024 16:06:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPqdF-0005Hs-Nu for guix-patches@gnu.org; Tue, 16 Jan 2024 16:06:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68517] [PATCH] guix: chicken-build-system: fixes to make it actually work Resent-From: Daniel Ziltener Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Jan 2024 21:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68517 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68517@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170543912820272 (code B ref -1); Tue, 16 Jan 2024 21:06:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2024 21:05:28 +0000 Received: from localhost ([127.0.0.1]:49874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPqci-0005Gu-A7 for submit@debbugs.gnu.org; Tue, 16 Jan 2024 16:05:28 -0500 Received: from lists.gnu.org ([2001:470:142::17]:39234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPqcf-0005Gh-IZ for submit@debbugs.gnu.org; Tue, 16 Jan 2024 16:05:26 -0500 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 1rPqcY-0006Fy-Cb for guix-patches@gnu.org; Tue, 16 Jan 2024 16:05:18 -0500 Received: from 195-15-241-199.dc3-a.pub1.etik-cloud.com ([195.15.241.199] helo=lyrion.dc3-a.pub1.infomaniak.cloud) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPqcV-0000f3-Cy for guix-patches@gnu.org; Tue, 16 Jan 2024 16:05:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; t=1705439105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uea6jnZ1AluB64eLTtsjBofNK+NFIUwiZ2Cs5/iwaVw=; b=cqd5y0yq9p0vUgLyJBBRxoVAsq2IOSWzsZ3EWX7K/EtUSUHD9pDrLmEr5ULUvMk2lvZkm+ Pg6ThoMK/pbrAQsVK1r6MXNwEGTY1WMQqhCXL1Sl11GZJcQ9lV4slBuYidRPgklgImxJUf +gXC1/SFiu6arkUhH9cs+dm2bQWGvXzFuaJaWk7OAhz54Bf/mbn3QLrTRRr++vd7cfu3Se MMe81Kaqvw9mgt4ZsnnvkvgzOo9rhjqrphz1TkucoCUJraICjcyNSjA7oEtlZMCGRwPzQt YvuGCmYNAmzdBP35UrvBJl78LUlEERFhUcdrp5bCftWdN9QcHUYnmUB2SQNuHQ== Received: from [192.168.178.38] ( [78.31.198.70]) by lyrion.dc3-a.pub1.infomaniak.cloud (OpenSMTPD) with ESMTPSA id e9eb5e5d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 16 Jan 2024 21:05:05 +0000 (UTC) Message-ID: <2d16444a-92b5-3474-3ab3-2ba4d2851766@lyrion.ch> Date: Tue, 16 Jan 2024 22:05:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Content-Language: en-US Received-SPF: pass client-ip=195.15.241.199; envelope-from=dziltener@lyrion.ch; helo=lyrion.dc3-a.pub1.infomaniak.cloud X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 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_SBL_CSS=3.335, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_CSS_A=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Daniel Ziltener X-ACL-Warn: , Daniel Ziltener via Guix-patches X-Patchwork-Original-From: Daniel Ziltener via Guix-patches via From: Daniel Ziltener Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches --- guix/build-system/chicken.scm | 50 ++++++++++++++++++++--------- guix/build/chicken-build-system.scm | 17 ++++------ 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm index 9f518e66e6..17c3b7b144 100644 --- a/guix/build-system/chicken.scm +++ b/guix/build-system/chicken.scm @@ -45,8 +45,8 @@ (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))) @@ -77,18 +77,32 @@ (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 (phases '%standard-phases) - (outputs '("out")) + (outputs '("out" "static")) (search-paths '()) (egg-name "") (unpack-path "") (build-flags ''()) + (configure-flags ''()) + (extra-directories ''()) (tests? #t) + (parallel-build? #f) (system (%current-system)) (guile #f) (imported-modules %chicken-build-system-modules) @@ -99,19 +113,23 @@ (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)))