From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SLDxHzpb62VEHgAAqHPOHw:P1 (envelope-from ) for ; Fri, 08 Mar 2024 19:38:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SLDxHzpb62VEHgAAqHPOHw (envelope-from ) for ; Fri, 08 Mar 2024 19:38:50 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lyrion.ch header.s=20230702 header.b=SbMKsgG8; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709923130; a=rsa-sha256; cv=none; b=O4tR90H02b6T+k4cICgPf3IrZIRJX7xzi+bQdvuUEfLTuEPf43joRXuiOtfjgM5aKuZbGP s+9k923qLN9Rc44RgXx3g8Ybx4h9FExXvoFTF01YUyn4WoI90XmZTJbQUoux8fEUkAUY/6 SpVz+gtbxphVVNsmG5mD6SmVPpq0BlAnSc+BcKh+FMoQzzD0eHE5XlG/VGI8W7dkZQ1PPH /m+Qz5MM8EfkN7kRBJ25f2hGvergGhclvHcvxdc0fybgNlWVICzIPm7YKvif/+D3yOq66B MMdFu/949z8sQa8+v2aC4pEG1AN+5iEcgfMADpoxJl0GdIczxaM48V7Pee76jQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lyrion.ch header.s=20230702 header.b=SbMKsgG8; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709923130; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=teDkg0sJH7JjJLwoJlesdw3k93o2+Tnk+ZmDmszHrVk=; b=VIpoaqkZThT45lJI79KQnfgclqjyC2tvxAVcT9KRcofjxHWWvFpj0dB/6fQnfBuBXQxn8i llaU01t55chkpKlxVQcTsXYL1S1LWvVYHG5fuv6tyYywCHsLzifX5KgfXMPDQAAncQ55C3 xrk2n+i+xxqpcrZgaefQwgAjfCICZXa9NeUDQAz4SlnTytbhGf54D4g7bKu8/rFwyeXitm shkQ2zXD54g2XKBkYsJxWPSEz9cEVXBUinW3kbXwfFQJzF7gQk8+eeG1jSn78YD+ag0C2X xcOQJTRLyMVYRGdIUNNlSgOtijbdTINKIEwBMTi3LYdrupAhzAuTNtOx9qqjmg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2ACFF77103 for ; Fri, 8 Mar 2024 19:38:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rif71-0000SV-Ut; Fri, 08 Mar 2024 13:38:31 -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 1rif70-0000SH-KO for guix-patches@gnu.org; Fri, 08 Mar 2024 13:38:30 -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 1rif70-0001J7-C1 for guix-patches@gnu.org; Fri, 08 Mar 2024 13:38:30 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rif7W-0008Op-Fn for guix-patches@gnu.org; Fri, 08 Mar 2024 13:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68564] [PATCH] build-system: fix the Chicken build system References: <5f79ce0097f1092706b65abd99940d06@lyrion.ch> In-Reply-To: <5f79ce0097f1092706b65abd99940d06@lyrion.ch> Resent-From: Daniel Ziltener Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Mar 2024 18:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68564 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68564@debbugs.gnu.org Cc: dziltener@lyrion.ch Received: via spool by 68564-submit@debbugs.gnu.org id=B68564.170992311632255 (code B ref 68564); Fri, 08 Mar 2024 18:39:02 +0000 Received: (at 68564) by debbugs.gnu.org; 8 Mar 2024 18:38:36 +0000 Received: from localhost ([127.0.0.1]:59564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rif75-0008OB-EZ for submit@debbugs.gnu.org; Fri, 08 Mar 2024 13:38:35 -0500 Received: from 195-15-241-199.dc3-a.pub1.etik-cloud.com ([195.15.241.199]:41417 helo=lyrion.ch) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rif6z-0008Nw-UZ for 68564@debbugs.gnu.org; Fri, 08 Mar 2024 13:38:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyrion.ch; s=20230702; t=1709923073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=teDkg0sJH7JjJLwoJlesdw3k93o2+Tnk+ZmDmszHrVk=; b=SbMKsgG8C+ydh+mN4urFaBO/wFQ2lugbibBf3V/yh0GYZ8utrWzsARtXftYjRLUtVyyAmG tTxDrE8uOAGLL0VknvwW6S7CRbjR5iLAhWyPE2hZeFjGiKKUqsjcVOw2nD5jNmVNo3LezC xvjKQYae6UAIy/wuOKaC0mQX/nbgIZmoNX2i/vNANoweASpV+UXAVgORGkb3P07oMoliCH Cfq/oZ1k2PtxBxkuY44C37r8joTdCOuVVtSuwcUsikTYb2XhjcZXIjRSERS+W1YLfOUE7Q 1339vgvgQJzV4+rzZvWJVbP+rrpw+DgxtVhzFjxzMRdCQtnbmcqDQSjUW5BIcw== Received: from localhost ( [2a06:6880:42c:1600:c3c9:f470:6a3a:68b6]) by lyrion.ch (OpenSMTPD) with ESMTPSA id 2844c324 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 8 Mar 2024 18:37:53 +0000 (UTC) Message-ID: <75af0d661d13dae3fcfac72b7a4f405b@lyrion.ch> Date: Thu, 7 Mar 2024 22:45:58 +0100 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 From: Daniel Ziltener via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -3.28 X-Spam-Score: -3.28 X-Migadu-Queue-Id: 2ACFF77103 X-TUID: VGpHtJEISh7g --- 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 ;;; 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 @@ -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 +;;; Copyright © 2024 Daniel Ziltener ;;; ;;; 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