From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mD+pOqEpeGIjxwAAbAwnHQ (envelope-from ) for ; Sun, 08 May 2022 22:35:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eLNoOaEpeGLtWAEAauVa8A (envelope-from ) for ; Sun, 08 May 2022 22:35:45 +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 99D8A1589B for ; Sun, 8 May 2022 22:35:45 +0200 (CEST) Received: from localhost ([::1]:45758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnd2-00039M-Oe for larch@yhetil.org; Sun, 08 May 2022 16:35:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnnED-0003o0-Bn for guix-patches@gnu.org; Sun, 08 May 2022 16:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnnED-0000FQ-1d for guix-patches@gnu.org; Sun, 08 May 2022 16:10:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnnEC-0002Nd-Tm for guix-patches@gnu.org; Sun, 08 May 2022 16:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55248] [PATCH v2 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: Sun, 08 May 2022 20:10:04 +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.16520405829034 (code B ref 55248); Sun, 08 May 2022 20:10:04 +0000 Received: (at 55248) by debbugs.gnu.org; 8 May 2022 20:09:42 +0000 Received: from localhost ([127.0.0.1]:55271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnDq-0002Le-8w for submit@debbugs.gnu.org; Sun, 08 May 2022 16:09:42 -0400 Received: from mail-vk1-f179.google.com ([209.85.221.179]:37496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnDo-0002L0-Hn for 55248@debbugs.gnu.org; Sun, 08 May 2022 16:09:40 -0400 Received: by mail-vk1-f179.google.com with SMTP id j14so3302336vkp.4 for <55248@debbugs.gnu.org>; Sun, 08 May 2022 13:09:40 -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=AgnbKSnocBGjpwiWWvFgtfBy5OxAlMCQZHXNu7IVzIWjxVVT3uUSH/LD7IzhiqpTrY CDlaETUmbpggSJlK4t3D9fibxDRpcDv0tgQYd1qTo74Alik5ZhnrmQtkFlLhjKGE2D8q 4d6E+4LrEedIeTPxiH3HYIlaarErdZ7fBBOzVPILJZC9oJ0zRQAgXB8fr2ZNwN/nq/JM 5/56ZSm9yGns6MDHU87O2zw+P4QNLUbw6vqw1/2iuvoywK8h6bx00Md4TI7Fb19m8k44 3ThsRhWlFHE3qVf+z9VwiLfSPJtAJ9NORsTA8GSB12ofjJe0pRsdjNLtFmSnVpB+KKMt X7qA== 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=5W7E6HI0OGs+QFONLT0yJE9/8hBukk4W11YyZaO7VT5Y04HsgJCDof2cpUduG39918 Dgndx3GSBQfloGyotagjLYJ85NsERk1k3rcnpKliAQbebs+ujbEWbagMH7wMimJWwduS KT2MEXJEpQ+++0hVvJiJE1zAoQ8cBRcbd7YlhqH0HZGj4tkhuNAtWrs7oEw23zHvlgFc xiK7MW5zUUDPW2DEzriGD5vTLyzKvWKRwBWpPJtyzvlsqy480krHFIgYbhMU9bBwQfaF YI+x6omNlVpPLrdfG3C2VK//UbA7FLdrBdIqkkAX8ZKow2X6g/klMzor6kaYVtkukojC cxRw== X-Gm-Message-State: AOAM531LZGo8sUfNHgxXEWSmaLgxtcySySKobmS0NkotQ9ogmPwErP92 nusqeYe2+Txr42RNlUEbGVgcZlzyHZxbjBUj X-Google-Smtp-Source: ABdhPJyB2kxXyOjie5db4UbNs9LUij4L5uhQlLWRzXyTnFln0MalfLhd1o/tvYNSHeH3LN8tDv4DoA== X-Received: by 2002:a05:6122:98a:b0:34e:9a92:35fd with SMTP id g10-20020a056122098a00b0034e9a9235fdmr6890829vkd.29.1652040574031; Sun, 08 May 2022 13:09:34 -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 o46-20020ab05971000000b00365e024dc7bsm915209uad.8.2022.05.08.13.09.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 13:09:33 -0700 (PDT) From: Philip McGrath Date: Sun, 8 May 2022 16:07:48 -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=1652042145; 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=jX8aFRA9fUO78TWGp/0p66FE1u6d+SPSvJPm3FHXFsUIqzbSxuJbfFp9fhjPH0Zmi5SinN S4Ef/xJaMueqEpndg+NSs6eoFvxwGZ/kRnV96k5u14lVp0MUpyoWc47cujKzed3PI/OS1W rDRbWpwRegVnOgh/M6zKifoCJ49LWU2KGPm9376kciqJFlIOXjGbIuFduJ25J4sawktx/o By/hEqCYQ3Bn43Hy/vYOc8xb82JKZuG14EXuDCdRFcvYE1Iw/J7agIWFRKrxPx5NETvH3s EQ85aiMZHNvQRSmJd0CUDsl1BCJSLZBIrE3khwJcpAHrYU8mbWCtzzOP8B+IlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652042145; a=rsa-sha256; cv=none; b=WNM+YdJExXdamCqubv+YYP0KZOYEFTguuE8NvT3UNu75LrjWcEuBCOg4cFAhcdYiKjHpBZ HzSUPi38qmeIaTtXT78zQF/EGTF37JPn74aA1omMdlcfgHqIORycniaFeA9Y3SGWVwtdQC 9WipGwIkqnNelV40H2aclhHd3cGitK//+3Al2k6ofGCRG070g8ptx/ylwsXfV75r5vpp4K PSVGdY8vBkBCh1uz9lnWG+xfYOaUcl8bkaFl+yktMvExe8HWSV4Gqb1MY6bLWxvbZI0aeO sdwYXzuSR79noH1Kcm2pjy4hChxn0dzMhLfiEy4zAFKIFJfmFH5YSmjUOPhzgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=AgnbKSno; 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: 3.39 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=AgnbKSno; 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: 99D8A1589B X-Spam-Score: 3.39 X-Migadu-Scanner: scn0.migadu.com X-TUID: imZ/5JDFLlfL 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