From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MEh7DGKveGIhjgAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 08:06:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uCSfC2KveGLUCgEAG6o9tA (envelope-from ) for ; Mon, 09 May 2022 08:06:26 +0200 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 BD93C899F for ; Mon, 9 May 2022 08:06:25 +0200 (CEST) Received: from localhost ([::1]:42844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnwXI-0001iJ-J6 for larch@yhetil.org; Mon, 09 May 2022 02:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnwVy-0001h2-Eu for guix-patches@gnu.org; Mon, 09 May 2022 02:05:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnwVy-0004no-5G for guix-patches@gnu.org; Mon, 09 May 2022 02:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnwVy-0000wy-01 for guix-patches@gnu.org; Mon, 09 May 2022 02:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55248] [PATCH v3 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads'. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 May 2022 06:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55248 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55248@debbugs.gnu.org Cc: Liliana Marie Prikler , Maxime Devos , Philip McGrath , Liliana Marie Prikler Received: via spool by 55248-submit@debbugs.gnu.org id=B55248.16520762473542 (code B ref 55248); Mon, 09 May 2022 06:05:01 +0000 Received: (at 55248) by debbugs.gnu.org; 9 May 2022 06:04:07 +0000 Received: from localhost ([127.0.0.1]:55703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnwUt-0000tk-7p for submit@debbugs.gnu.org; Mon, 09 May 2022 02:04:07 -0400 Received: from mail-vk1-f181.google.com ([209.85.221.181]:36453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnwUr-0000t1-Gw for 55248@debbugs.gnu.org; Mon, 09 May 2022 02:03:53 -0400 Received: by mail-vk1-f181.google.com with SMTP id h144so6417679vkh.3 for <55248@debbugs.gnu.org>; Sun, 08 May 2022 23:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6MUQea/akqiJw65v5UB+PXZnpK7I+lS4QjauOZJ1fUE=; b=QUsTizjfpSBDGkqlJmE4F2jUS9QRvCjw94er3zNkmLI//viJxi/oTbThnmMRLx7fvM 4rb3SrpqrkiQ6tFxLXIFAOdKK7NZnKp4dd1On43E7CRwX4WQxgVmARMw0wF/ND0F70NW 96Dujv4el2loGhxd5lqZ9bV6365HCXx7GldGASKrElC1BxPyuyhkQFpvE7YUY0cs9t26 vaK0GdvBWdD36E7iJhlzQNUOY2EkdUbv8aKu41CXs0h0sPKjkj6DFQ8XZ5y3eaTnsIFm 7c6+G4sktUHyA8bbGlMbj5kUyE4m9Wx5rxpIyM+4Y+Ivs2vE/1C4+wfY8B1fEcsr4o2k d3fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6MUQea/akqiJw65v5UB+PXZnpK7I+lS4QjauOZJ1fUE=; b=nUkd/I/JC8/IjJPXpGHpfZkXD7atTxypdQz0vxtYGp0xu7wDb5ciyWKcDJM/KIPQnQ 28dTtgDeBsM+/srxMAY9u1Ou+WoXjyghsGJXs3CWnRCpK611ahR7NjWOs21r3PHtnEju 03Uj6hhuDCjAXE5sJ0hrq62GCpK5W4+NCaNqdLxN0B/NOCdUmsFNorgrSu3yD+9JAS/2 a1IK3Y8rFG5DXHCbioydwsyid1cQpAxNegBLgKNaFUz3zEtKvCt/q0C/um82/86AjyVY MP0EaEWSAAdQ+UjsYhr/EyyvuN0VaY1XyyOLOsIdzqhnXjzfKYM3pbgrlzybOiopH/eQ fJIw== X-Gm-Message-State: AOAM531z0x6DWTffwRiWtXObtT8+P1aaJscZ361qEfaio30bc4lNExaP sPTN30Dc5DYxYm+aN3spR1FMzwvXNb9MpHcC X-Google-Smtp-Source: ABdhPJwPL6oSTt1FYZTnANhl/r2umRjcw/CxffrBRCs+4v0qF2L2HhE466S5RZc1IAWex4CJ2p2rvg== X-Received: by 2002:a05:6122:18af:b0:34e:7a97:709 with SMTP id bi47-20020a05612218af00b0034e7a970709mr7305019vkb.24.1652076227960; Sun, 08 May 2022 23:03:47 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id d9-20020ab03789000000b003626f894df8sm1460351uav.38.2022.05.08.23.03.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 23:03:47 -0700 (PDT) From: Philip McGrath Date: Mon, 9 May 2022 02:02:46 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652076385; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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=6MUQea/akqiJw65v5UB+PXZnpK7I+lS4QjauOZJ1fUE=; b=uSPngHu6coJAd9NmzLz0xODN1hMyojD75zcgP9dBHwdQYgzg9ejxy+MBmjaOjDOUIgDWFo YvbC2nFxJYZZIrZk5n8tbJHI7mTAk5wnaLVKY1VwUftF6dijgHcVX4wtvsCtfsEjE/EU5d m2QYLZpfzfH8sz5fQ0hlB1KTEe0AOWxPy+81DwyqrJfZ4fLwEzcK+JxfIY6EEcujydGvsc 8YjUhafRRjOhoDsShO/ZA4MK2nTs4b5YDAxkIv5ySEOtafNJ4AnkdaPfQgaIKsputFhm81 nPGJSAFd5eKV8uT0l1Sqxwx0SviOr6cncP6qVykZ7QGEBhyShFMrAP66tXI3XQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652076385; a=rsa-sha256; cv=none; b=SKl0n5E12E1D/hgdttK/fvHAIt3MJs02gNVuHz6RCpEn5mmonvrz63jBgEQUFc+t02P4SB NiWjl1QGID4+LRdzMw3xNuGCQsBUtww4W4RTY21tp78ynTOh+HVo0lLEgVHwOiT1h6Bj3V d9IrOfR1LTXrhniWOYBIz5KMARLG4V7CNB89HJSDIFFIRflCWWxuEvPPZqGNFISRRLxFsf VprErIr5nV8LRxOTdxe6+AcPszHkz0f40dfrDC9nEqGVHOX58z+y0rJ5Lu/FCq1pYpdNg8 WAH/AeF8Vl3LkdeD10JBVhL4txyW6RkEr/yw3vR17BU2mncNLf1J90Mf8MaQBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=QUsTizjf; dmarc=none; 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" X-Migadu-Spam-Score: 5.00 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=QUsTizjf; dmarc=none; 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" X-Migadu-Queue-Id: BD93C899F X-Spam-Score: 5.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: PI45w2OobMuY Move Chez-specific logic into '#:configure-flags' and a new 'configure-environment-variables' phase, leaving the 'configure' phase as just a variant of the one from 'gnu-build-system' (including support for '#:out-of-source?') that doesn't add implicit Autoconf-style flags. In the process, do the right thing for "--threads", rather than assuming the only nonthreaded platform is broken. * gnu/packages/chez.scm (chez-scheme)[arguments]: Set configure flags in '#:configure-flags' and separate 'configure-environment-variables' from the residual 'configure' phase. More closely follow 'gnu-build-system'. Use 'chez-upstream-features-for-system' for "--threads". (chez-scheme-for-racket)[arguments]<#:configure-flags>: Add "--threads" unconditionally. --- gnu/packages/chez.scm | 63 ++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 49051abd17..785b6837c1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -258,8 +258,18 @@ (define-public chez-scheme (ice-9 ftw) (ice-9 match)) #:test-target "test" - ;; TODO when we fix armhf, it may not support --threads - #:configure-flags #~'("--threads") + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex @@ -273,26 +283,35 @@ (define-public chez-scheme (search-input-directory (or native-inputs inputs) "lib/chez-scheme-bootfiles") "boot"))) - ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; NOTE: The custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. (replace 'configure - (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) - ;; add flags which are always required: - (let ((flags (cons* (string-append "--installprefix=" #$output) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do compress-man-pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke "./configure" flags)))) + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) ;; The binary file name is called "scheme" as is the one from ;; MIT/GNU Scheme. We add a symlink to use in case both are ;; installed. @@ -385,7 +404,9 @@ (define-public chez-scheme-for-racket (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:configure-flags cfg-flags #~'()) - #~(cons "--disable-x11" #$cfg-flags)) + #~(cons* "--disable-x11" + "--threads" ;; ok to potentially duplicate + #$cfg-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) (unpack (assoc-ref those-phases 'unpack))) -- 2.32.0