From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CJ/dG8ApeGIjxwAAbAwnHQ (envelope-from ) for ; Sun, 08 May 2022 22:36:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WAuuG8ApeGI6YAEAauVa8A (envelope-from ) for ; Sun, 08 May 2022 22:36:16 +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 E44E0142BF for ; Sun, 8 May 2022 22:36:15 +0200 (CEST) Received: from localhost ([::1]:47822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnndX-0004Yb-4s for larch@yhetil.org; Sun, 08 May 2022 16:36:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnnEE-0003pI-Qk for guix-patches@gnu.org; Sun, 08 May 2022 16:10:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnnEE-0000Fn-E9 for guix-patches@gnu.org; Sun, 08 May 2022 16:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnnEE-0002O1-9H for guix-patches@gnu.org; Sun, 08 May 2022 16:10:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55248] [PATCH v2 8/9] gnu: chez-scheme-for-racket: Fix supported systems. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 May 2022 20:10:06 +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.16520405989088 (code B ref 55248); Sun, 08 May 2022 20:10:06 +0000 Received: (at 55248) by debbugs.gnu.org; 8 May 2022 20:09:58 +0000 Received: from localhost ([127.0.0.1]:55281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnE5-0002MW-OU for submit@debbugs.gnu.org; Sun, 08 May 2022 16:09:58 -0400 Received: from mail-vs1-f54.google.com ([209.85.217.54]:35717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnDz-0002M2-Ok for 55248@debbugs.gnu.org; Sun, 08 May 2022 16:09:56 -0400 Received: by mail-vs1-f54.google.com with SMTP id d22so9301213vsf.2 for <55248@debbugs.gnu.org>; Sun, 08 May 2022 13:09:51 -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=rEN63InRpJFw9FWbXtZMsikdTxt1Wx/ik5ZLTy2nCfM=; b=Wen7H1uEaNb//uuEeOjsy3piVWr59M5uFlKpezdMKsWCAXAXeqlj5/j2kZfFk3uTlU 2oXMuRPvFP1XG5wpuzLdvAX0RPR/SRNICAIABArTv0s8dhnfTHiL7IEI4et01l2Skeak CQ1GwBKYQMDMKYGJaQI5ifbUYSIFWQy0CDXluPEehNguFretm21YwW/JQfgpVLRmlKhr 3QRYMeGlEVHrdKsROthp844qHouCk2ioId10nEDYd1KxOP4mYZvq7tlLi9QKvgxPhqSb rNqMoYQWOSqwjTcpkj1YB5X693Foibw3Xljmylub82n7TeIBF/+7znubguppcvrgtYt+ c/EQ== 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=rEN63InRpJFw9FWbXtZMsikdTxt1Wx/ik5ZLTy2nCfM=; b=q8CLJPijBPPd6GhfUIwFqqVK6zfZ59XK9sFa0nEb3lQOVuXqyTfNoV7QgU8YKcn2G8 Kx0gCrijj7KvPR1x/un9cdlQlbTrTSVP7Nw6K8DzCyC6882GKldxFFoKaegDJJtKdXhe ixbRKgHj1Wi/dqARw+E0Auorg6DxMFmBY0r8Qa4JJiTWg6Vkf08yDUJ32coPIvywEMla R5AoYKD6+sjS9uE9kE/+wavWQ/r/RS0L3gRo81E8gp1DP216ScnaAlP4OEbJiY1gmugA vZdT/usy78T4F03F1f534F+ntV6qBPkAaC4Twsys6N3uY8OR38VPDoJsQKUERV+i1fsS zXNg== X-Gm-Message-State: AOAM530aTo9gTCdzsn9JJ1Ax9zsbt8LsH/7XhiQcJfFCSxRaA1l6xF8v uI1qJh7oNbhjKJc/1u9c3ebQn9/pOO0LCZ2D X-Google-Smtp-Source: ABdhPJz2FMS1obvBQ6xJAS7fI7TyguGf7n9Q3AzsQWtIpfOMd8O142iJDgDD92Eq6u+U7/hV1o1mmw== X-Received: by 2002:a67:c816:0:b0:32c:f407:7d40 with SMTP id u22-20020a67c816000000b0032cf4077d40mr6350975vsk.75.1652040586253; Sun, 08 May 2022 13:09:46 -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 f19-20020a67ea93000000b0032d275e6904sm941802vso.4.2022.05.08.13.09.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 13:09:46 -0700 (PDT) From: Philip McGrath Date: Sun, 8 May 2022 16:07:51 -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=1652042176; 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=rEN63InRpJFw9FWbXtZMsikdTxt1Wx/ik5ZLTy2nCfM=; b=j97xdvb4kuQm7oUkFEFBp3QgLvalEtc5BRsvxJ4YlPOgTPG/1MkalXipPFnHXcDJO0i4XS FhJ344p1uVo9NKnZhm+qig+sIeIgKYKHPMoKyMbB/F3u5gNeLoxsXOehYVOXiVcO0GdK1W BoDFmuAexyd8w0hGuf2xqVopKYAeSfZcpuz26PVz1qrK16r2Gnoyq69tAe9FuKCMfRKv4N yXXRqykGvb5Otqmf4/8mhG3CPJdzrdLY0IyPp/Ipvy9K03ZKLfbzIdxu56uUFN834Kt1ie 3ZlubqdIpFckll1d80sPjU/Q+exKtnadYj590cU0rP7iL00aC+X9QMT6AQcIHA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652042176; a=rsa-sha256; cv=none; b=rm0BFJjRCt6jUO1zlE2ILSMP+Io2O4xTHd7ujRgSunLPdMwzTdBOpvBOuwSQgt2bRqGxH9 dj3jVh6i2TsV+CNeHQDsOmqCd7jtWuNM3WQTD010X6WYKp2Jw/cEt74aTgIX7XdBa3XhxJ wHkGNQw+QQ7aSDu8WopyAh+VByDaWk0lLZAtWoZXndJfYZzPkYA42+SRtArq294HK6ZOxZ DaonGIPJfSHaI7Vygv+mRT+Ef6CBBAErafBit9lKqG5NR1ci80dtw1MG2TWeGDgnVUcBrE 23vpsiqWuuu+PKvkmHaH+r9vC2e/+SJRGmCc8+I1+ZWUHVyYkn0KbARdOQZUEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=Wen7H1uE; 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.99 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=Wen7H1uE; 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: E44E0142BF X-Spam-Score: 3.99 X-Migadu-Scanner: scn1.migadu.com X-TUID: dXdcjAplJ7cg This commit fixes the treatment of systems like "powerpc-w64-mingw32", where the combination of architecture and kernel is not supported, even though both are supported in other combinations. The build failure fixed in b8fc9169515ef1a6d6037c84e30ad308e5418b6f highlighted this problem: see also . The correct support status is specified by '%chez-features-table', which was added to improve 'chez-upstream-features-for-system': this commit uses it to fix the repair. Once the issues in are resolved, 'chez-scheme-for-racket' and 'racket-vm-cs' will be able to run even on systems for which native code generation is not supported. It's not clear what behavior would be useful from 'nix-system->chez-machine': since the current implementation is flawed and easy to misuse, we remove it for now, replacing the remaining uses with 'racket-cs-native-supported-system?'. * gnu/packages/chez.scm (nix-system->chez-machine): Remove it. (racket-cs-native-supported-system?): New variable. (chez-scheme-for-racket)[supported-systems]: Use it. * gnu/packages/racket.scm (racket-vm-for-system): Likewise. --- gnu/packages/chez.scm | 32 +++++++++++++++++--------------- gnu/packages/racket.scm | 7 +++++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 41f083e0ac..cae17580f8 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system - nix-system->chez-machine + racket-cs-native-supported-system? unpack-nanopass+stex)) ;; Commentary: @@ -132,19 +132,6 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) (else #f))) -(define* (nix-system->chez-machine #:optional - (system (or (%current-target-system) - (%current-system)))) - "Return the Chez Scheme machine type corresponding to the Nix system -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme -machine type is undefined. - -It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type." - (let* ((chez-arch (target-chez-arch system)) - (chez-os (target-chez-os system))) - (and chez-arch chez-os (string-append chez-arch chez-os)))) - (define %chez-features-table ;; An alist of alists mapping: ;; os -> arch -> (or/c #f (listof symbol?)) @@ -233,6 +220,19 @@ (define* (chez-upstream-features-for-system #:optional (and=> (assoc-ref %chez-features-table chez-os) (cut assoc-ref <> chez-arch)))) +(define* (racket-cs-native-supported-system? #:optional + (system + (or (%current-target-system) + (%current-system)))) + "Can Racket's variant of Chez Scheme generate native code for SYSTEM? +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and (and=> (assoc-ref %chez-features-table chez-os) + ;; NOT assoc-ref: supported even if cdr is #f + (cut assoc chez-arch <>)) + #t))) + ;; ;; Chez Scheme: ;; @@ -459,7 +459,9 @@ (define-public chez-scheme-for-racket (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) - (supported-systems (filter nix-system->chez-machine + ;; TODO: How to build pbarch/pbchunks for other systems? + ;; See https://racket.discourse.group/t/950 + (supported-systems (filter racket-cs-native-supported-system? %supported-systems)) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 904dfe9bef..1f020f1276 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -190,8 +190,11 @@ (define-module (gnu packages racket) (define* (racket-vm-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." - (if (nix-system->chez-machine system) + "Return 'racket-vm-cs' if we are able to build it for SYSTEM; 'racket-vm-bc' +otherwise." + ;; Once we figure out the issues in https://racket.discourse.group/t/950, + ;; we can use 'racket-vm-cs' everywhere. + (if (racket-cs-native-supported-system? system) racket-vm-cs racket-vm-bc)) -- 2.32.0