From patchwork Thu Aug 11 11:08:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41551 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 2037027BBE9; Thu, 11 Aug 2022 12:09:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 C691727BBEC for ; Thu, 11 Aug 2022 12:09:17 +0100 (BST) Received: from localhost ([::1]:56004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM63w-0008TM-Ub for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:09:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM63i-0008RF-9O for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM63i-00056i-0x for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM63h-0006UX-T5 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 01/13] gnu: stex: Update to 1.2.2-2.afa6075. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021613424912 (code B ref 57050); Thu, 11 Aug 2022 11:09:01 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:08:54 +0000 Received: from localhost ([127.0.0.1]:51816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63a-0006Tj-9A for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:08:54 -0400 Received: from mail-qv1-f46.google.com ([209.85.219.46]:43529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63X-0006TI-6i for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:08:51 -0400 Received: by mail-qv1-f46.google.com with SMTP id j11so13005947qvt.10 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=T6gG0upqRvGYsYUd7HyRCudJf0QW/TkeNmZoflcoPII=; b=KF9AOL2R+98OnOU4U4LfUbiro+PAzQSGwMatDigpHGjiJFYjT22vaA2GLDj7aZaB46 4k2ypjjEKBZPK1CBioH8mzuPhKq3PeOInZH91FA+IgD0gYGxP4DQFKRJ6JxrDPur1upI eo5xEOUUsREqG58iOnWYlMgKsQkmCmLebcjasinqIr8/t4PuXqamkfLXe+Q0hyxGmF+u sUww2Ztin1wjQQV2belYMW8dNZHOPyYWJa8cO9F62pJ+0RBUYV6N61HHUAbow/R7Ypz3 htLVG0V+2FuOdHENMWinKvI+HEn0Ppf4Qwuq0PyBCmJCkgxnVeKPn8NcEW02cd4QxGdT W20A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=T6gG0upqRvGYsYUd7HyRCudJf0QW/TkeNmZoflcoPII=; b=p10ZlET+HekLXqaMRPHlWb7lHUo2UkwKzhVEH8sigoj23rJnLEnTGEOqF2J9HJKTtb VBlE2p8o7GTZ+hezpr3G4NkE+nvW1/vQfH+ovbeS3R1ptUWHq3JGIMlef0p+/KtdJYj+ mT+bzDLiBPiOvM+EBMk6/k6aKB/d6rZtJgsaSAwQ76u2RKjc/YrnlVLuxBdufZfl5KAz Vbz3Hyp5i2uu0k7dxWjOonT41tZwt65lD7Y676lXMpEd+my5WiC3Vvy/XOtt2jhPgHdd dWlmlt6uQ9j0/Om4ff5Em0Qsj9bZbfDz+TAWzA/JS8KkQCA6EurA2N8dKf/74fXdRb0r 73OA== X-Gm-Message-State: ACgBeo23HJMb2oVMKCXmi4JOmxV1/ZdV4DG1+ENYtMnkJFHjIm/0cosR HYL1sJerAiwPgm+Tgm7iTxQH5T0ieslHuB/w X-Google-Smtp-Source: AA6agR4Uu1On4iDm3vBUem8Q0McMDVSkU3EaWWTIpTg+UQM3i2HSBd8Aof9Wk23QYurio1KSlkSmcA== X-Received: by 2002:ad4:5be2:0:b0:476:7e0d:815f with SMTP id k2-20020ad45be2000000b004767e0d815fmr26840450qvc.57.1660216125707; Thu, 11 Aug 2022 04:08:45 -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 x12-20020a05620a258c00b006b942110644sm1792786qko.102.2022.08.11.04.08.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:08:45 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:11 -0400 Message-Id: <672555b265c88be3e84db33a5744ffc7e302c6ad.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/chez.scm (stex-bootstrap): Update to 1.2.2-2.afa6075. --- gnu/packages/chez.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index b037efe8d4..043f2ae47a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -594,8 +594,8 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (define-public stex-bootstrap ;; This commit includes a fix which we would otherwise want to use as ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (revision "1")) + (let ((commit "afa607564a5662ffd748e824801277a6b5a3d11c") + (revision "2")) (hidden-package (package (name "stex") @@ -611,7 +611,7 @@ (define-public stex-bootstrap (url "https://github.com/dybvig/stex") (commit commit))) (sha256 - (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (base32 "0n6dryv5j7cw2qmsj55wqb0ph901h83a2hl4j891ppxp0xx18nkp")) (file-name (git-file-name name version)) (snippet #~(for-each delete-file From patchwork Thu Aug 11 11:08:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41552 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 7486D27BBEA; Thu, 11 Aug 2022 12:09:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 C7FB427BBE9 for ; Thu, 11 Aug 2022 12:09:22 +0100 (BST) Received: from localhost ([::1]:56022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM641-0008U2-Vt for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:09:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM63i-0008RG-KZ for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM63i-00056o-CQ for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM63i-0006Uf-8J for guix-patches@gnu.org; Thu, 11 Aug 2022 07:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 02/13] gnu: stex: Fix read-only gifs and math directories. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021613724927 (code B ref 57050); Thu, 11 Aug 2022 11:09:02 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:08:57 +0000 Received: from localhost ([127.0.0.1]:51819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63c-0006Ty-KZ for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:08:57 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:34393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63b-0006TT-49 for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:08:55 -0400 Received: by mail-qt1-f180.google.com with SMTP id e28so5152433qts.1 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=mZtilo21zyXTOq4oexMEWqjGZ0JRbIL705SOoM9uDjQ=; b=WAApdAKkS9wmqD8jX+BOaeYgmdaUPBQjhvplnrsdXKNAt++RdYQPB3wYrLpbvjcJHO 9IigLWLna3sduGsYheI2akIqGCCyWDfS91kR361J3i0SRS2yzuXL9doKFu/5Woh5fEaQ 1KMxJyTNJ4MlL7P6S4ld7RvNHUhEH5ozpW0YBo0QIhj7Eln5eWeQbOpK6+6cMiYyhQAS IH9ybox75cfoUy+K4Vmcf5zXxPhArJ5kImSGWg4z4S1D71KNCSvo1HPhukR8nygQD1Dw aXxTM0DOTqwwO4eqWavegLwb7vjdsLngjk1DmNxclSMCmAcpmjdI6vS2NSvkeDEUOPNh vZiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=mZtilo21zyXTOq4oexMEWqjGZ0JRbIL705SOoM9uDjQ=; b=hrVu4MJ0NvHdcmJF8YWJR3z+SsZYTwPgDFtJ0SDN0GmV2lKi7i3xJU0iUrSQ9ZPPYR C1dzSTrHLnLsNJcSlEgEFKL+Qr51D39KTWnVALQHUv6iik5+JEEurdEDRad/2t91MDm/ 6medrjyh3pmEi1CEBBEIX1ju5v2blu9gcph7+sD7K6wIKhYg5KEThx5b0Om6zEwag5ur jL7g6pxQuCXc+j2JoryfEq/Ba0qQU6oIO/QWtIA8b2lHtZ4ynjAh8X4Hzjn/EyvsYlD0 wHhuhdpBYryekrApcYnCPEqTXPVHb1XzyNxEI2m0Oqvwg8EmXd5Zne+8cT7c+3izCPHR h2nA== X-Gm-Message-State: ACgBeo07wss6nq+QRoZu6w1d0UTuxkZiAWBJpG8xGP63PVJr3hfRAlXu blGTK+stciArq4yvswm0ws+CDvZBZenz+JDj X-Google-Smtp-Source: AA6agR6jpfSg930+/YYeIJavURIyF3xrgX+7Gcq4jVMQziPzFQrYNhjdySgVSpxGW/IzoouZMGjLVg== X-Received: by 2002:ac8:7ec1:0:b0:343:6789:1939 with SMTP id x1-20020ac87ec1000000b0034367891939mr1296838qtj.419.1660216129614; Thu, 11 Aug 2022 04:08:49 -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 br26-20020a05622a1e1a00b003435f947d9fsm1483757qtb.74.2022.08.11.04.08.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:08:49 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:12 -0400 Message-Id: <3cbb1636a31c0896f85e3a6f04ddef096a6be29a.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Excplicitly set the user write bit when initializing the gifs or math directories from the skeletons installed in the store. See also upstream discussion at . This problem would be exposed by the upcoming changes to Racket's build system. * gnu/packages/patches/stex-copy-from-immutable-store.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez.scm (stex-bootstrap)[patches]: Use it. [version]: Increment revision to 1.2.2-3.afa6075. --- gnu/local.mk | 1 + gnu/packages/chez.scm | 5 ++- .../stex-copy-from-immutable-store.patch | 41 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/stex-copy-from-immutable-store.patch diff --git a/gnu/local.mk b/gnu/local.mk index 1bd791fb0c..d35c6748c9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1826,6 +1826,7 @@ dist_patch_DATA = \ %D%/packages/patches/slim-reset.patch \ %D%/packages/patches/slim-login.patch \ %D%/packages/patches/slim-display.patch \ + %D%/packages/patches/stex-copy-from-immutable-store.patch \ %D%/packages/patches/syslinux-gcc10.patch \ %D%/packages/patches/syslinux-strip-gnu-property.patch \ %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 043f2ae47a..4c253effa0 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -595,7 +595,7 @@ (define-public stex-bootstrap ;; This commit includes a fix which we would otherwise want to use as ;; patch. Let's revert to tagged releases as soon as one becomes available. (let ((commit "afa607564a5662ffd748e824801277a6b5a3d11c") - (revision "2")) + (revision "3")) (hidden-package (package (name "stex") @@ -613,6 +613,9 @@ (define-public stex-bootstrap (sha256 (base32 "0n6dryv5j7cw2qmsj55wqb0ph901h83a2hl4j891ppxp0xx18nkp")) (file-name (git-file-name name version)) + (patches + ;; submitted upstream in https://github.com/dybvig/stex/pull/6 + (search-patches "stex-copy-from-immutable-store.patch")) (snippet #~(for-each delete-file '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) diff --git a/gnu/packages/patches/stex-copy-from-immutable-store.patch b/gnu/packages/patches/stex-copy-from-immutable-store.patch new file mode 100644 index 0000000000..4562e431c1 --- /dev/null +++ b/gnu/packages/patches/stex-copy-from-immutable-store.patch @@ -0,0 +1,41 @@ +From 9434b4a36646c036db8de326158056aa3293fb82 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Thu, 28 Apr 2022 22:56:20 -0400 +Subject: [PATCH] fix read-only gifs and math directories + +An installed copy of stex might have all write permission bits removed, +even for the owner of the installed files: this is the case with Guix +package of stex, for example. If such an installation is used to +initialize the gifs or math directories (e.g. for an out-of-source +build), tar likewise creates them without write permissions, preventing +subdirectories from being created later. Set the user write bit +explicitly to avoid this problem. + Mf-stex + +Related to https://github.com/racket/racket/pull/4203 +--- + +Submitted upstream in https://github.com/dybvig/stex/pull/6 + + Mf-stex | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Mf-stex b/Mf-stex +index 09ec6f3..11fb214 100644 +--- a/Mf-stex ++++ b/Mf-stex +@@ -112,9 +112,11 @@ $(x).mathrun: gifs $(mathfiles) + + gifs: + (cd $(STEXLIB); tar -cf - gifs) | tar -xpf - ++ chmod u+w gifs + + math: + (cd $(STEXLIB); tar -cf - math) | tar -xpf - ++ chmod u+w math + + $(mathfiles): $(x).hthirdrun $(figps) + echo -n gifs= > $(mathfiles) +-- +2.32.0 + From patchwork Thu Aug 11 11:08:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41553 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 3862327BBE9; Thu, 11 Aug 2022 12:10:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 0C43B27BBEB for ; Thu, 11 Aug 2022 12:10:18 +0100 (BST) Received: from localhost ([::1]:56692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM64v-0000fq-5V for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64g-0000et-Vi for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64g-0005MB-Lz for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64g-0006YM-I8 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 03/13] gnu: chez-scheme: Fix use of "/bin/sh". Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021614424988 (code B ref 57050); Thu, 11 Aug 2022 11:10:02 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:04 +0000 Received: from localhost ([127.0.0.1]:51825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63j-0006Ux-2W for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:03 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:38401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63g-0006Tx-Th for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:01 -0400 Received: by mail-qt1-f174.google.com with SMTP id y18so3119087qtv.5 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=WZi0to89y3NPvYFIgIMj+l4Yp+huzp884wWv9GqSlr0=; b=fD4aGNxXeNbvn6Db79V6/xoKFjjmwQ1N0wF+gLyv6FgerWF6+ILFdvsq3t0ujmZOq3 F21QaEoo4CdkJhVJFkLeBKnUOKRqg3kp8wOpdE2uVmioD3D03r2VbLZ/tWmhmpP1mf7h Z7dpjWpKP555IlEQCxNIp4bMtGPaxfYL9rmHKvtHSh0EOK+cfsJwBxNAtKmntwvlkAJ1 f55ptSbYiC/Q2M5Tw5Jp7mavZurk2xhTc4dReZg/wMhxHvWPFyBexOts6/1eXquniFz3 5oNGB919SJTJ0CO7+q8j6ctX0Vqac6rZoPZu8m0JV26dmqFa5q6d/WQsNpai/+Qo5U9K dzXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=WZi0to89y3NPvYFIgIMj+l4Yp+huzp884wWv9GqSlr0=; b=0cq6X1XjaGo0CWibpK0kvGiyLwzbjkUnzmiX21EpBO1Om0wc8Nr37eWR5APnqhEcLq NjDmUdiMuFbDXL+wemhZbxtuCZM2LLHsxGNTxC++vIwv6rTwobAL8BRwyAC9q5cJJyj9 J6gOeyyWFAIkejZJz7bBD8yjcgiSgmaLsmBqq/s+fvrk0dmqKNY5fbcuvtcUY+lWHu+9 eez5AOC/P2UCuJEe2N/IJWeqlYqNDRMkHv/pTrQkeHUAo++W5Brh2Ijm4om4l1s/vPEM KNs/neOpZzbESTWRpdW1rqe3R71B3gcYIZE3wRYikvzNE8+ESrdXEp5EyYH1fuemqF7s NZQg== X-Gm-Message-State: ACgBeo3E64LASYQpySQ5NH/HJKPTeGB0r/K4Yo5oBOlJ3rwNRN6TAQiu jA3gOW9w2Z1tx1Q/xIu6bfl+RDUgSYIrruT2 X-Google-Smtp-Source: AA6agR6MSD10L6vFTO6sbCYJ+K2bz9hWPAPvJaHAPRETEo4ko2UMyhc2zWBd2A6g0vl0GUimzOqA9A== X-Received: by 2002:a05:622a:4d1:b0:343:6be3:add with SMTP id q17-20020a05622a04d100b003436be30addmr609171qtx.561.1660216133838; Thu, 11 Aug 2022 04:08:53 -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 cr23-20020a05622a429700b00342f960d26esm1424875qtb.15.2022.08.11.04.08.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:08:53 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:13 -0400 Message-Id: <86c1205b1144c03620cce866e7d22c67d1e9c47d.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The unsuccessful attempt to execute "/bin/sh" by Chez Scheme's 'process' function seems to have caused parts of the Chez Scheme test suite to have been silently skipped. The issue was exposed by the upcoming changes to Racket's build system. * gnu/packages/patches/chez-scheme-bin-sh.patch, gnu/packages/patches/racket-chez-scheme-bin-sh.patch: New patches. * gnu/packages/patches/racket-minimal-sh-via-rktio.patch: Rename to ... * gnu/packages/patches/racket-rktio-bin-sh.patch: ... this, refresh with upstream, and shorten the macro name. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/racket.scm (%racket-origin)[patches]: Likewise. (racket-vm-common-configure-flags): Likewise. * gnu/packages/chez.scm (chez-scheme)[origin]: Likewise. [inputs]: Add bash-minimal. [arguments]<#:configure-flags>: Set CPPFLAGS to enable new patches. --- gnu/local.mk | 4 +- gnu/packages/chez.scm | 5 ++ gnu/packages/patches/chez-scheme-bin-sh.patch | 66 +++++++++++++++++++ .../patches/racket-chez-scheme-bin-sh.patch | 66 +++++++++++++++++++ ...-rktio.patch => racket-rktio-bin-sh.patch} | 28 ++++---- gnu/packages/racket.scm | 5 +- 6 files changed, 158 insertions(+), 16 deletions(-) create mode 100644 gnu/packages/patches/chez-scheme-bin-sh.patch create mode 100644 gnu/packages/patches/racket-chez-scheme-bin-sh.patch rename gnu/packages/patches/{racket-minimal-sh-via-rktio.patch => racket-rktio-bin-sh.patch} (79%) diff --git a/gnu/local.mk b/gnu/local.mk index d35c6748c9..076fa341e9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -941,6 +941,7 @@ dist_patch_DATA = \ %D%/packages/patches/ceph-boost-compat.patch \ %D%/packages/patches/ceph-rocksdb-compat.patch \ %D%/packages/patches/cheese-vala-update.patch \ + %D%/packages/patches/chez-scheme-bin-sh.patch \ %D%/packages/patches/chmlib-inttypes.patch \ %D%/packages/patches/cl-asdf-config-directories.patch \ %D%/packages/patches/clamav-config-llvm-libs.patch \ @@ -1773,7 +1774,8 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ - %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ + %D%/packages/patches/racket-chez-scheme-bin-sh.patch \ + %D%/packages/patches/racket-rktio-bin-sh.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 4c253effa0..66098c7a24 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -34,6 +34,7 @@ (define-module (gnu packages chez) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system copy) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) @@ -269,6 +270,7 @@ (define-public chez-scheme (base32 "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) (file-name (git-file-name name version)) + (patches (search-patches "chez-scheme-bin-sh.patch")) (snippet #~(begin (use-modules (guix build utils)) ;; TODO: consider putting this in a (guix ...) or @@ -287,6 +289,7 @@ (define-public chez-scheme `(,util-linux "lib") ;<-- libuuid zlib lz4 + bash-minimal ;<-- for process ncurses ;<-- for expeditor ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 @@ -313,6 +316,8 @@ (define-public chez-scheme (cut memq 'threads <>)) #~("--threads") #~()) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" diff --git a/gnu/packages/patches/chez-scheme-bin-sh.patch b/gnu/packages/patches/chez-scheme-bin-sh.patch new file mode 100644 index 0000000000..e6228e3264 --- /dev/null +++ b/gnu/packages/patches/chez-scheme-bin-sh.patch @@ -0,0 +1,66 @@ +From c170f0f3a326f293ee1f460a70303382966ca41b Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Thu, 19 May 2022 13:41:56 -0400 +Subject: [PATCH] patch s_process for "/bin/sh" on Guix + +This patch reuses the C preprocessor macro `GUIX_RKTIO_BIN_SH` +from a previous patch. + +If: + + 1. The `GUIX_RKTIO_BIN_SH` macro is defined; and + + 2. The path specified by `GUIX_RKTIO_BIN_SH` exists; + +then `s_process` will call `execl` with the file specified by +`GUIX_RKTIO_BIN_SH` instead of "/bin/sh". + +This patch does not change the behavior of `s_system`, which relies +on `system` from the C library. +--- + c/prim5.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/c/prim5.c b/c/prim5.c +index 5a07893..926d68d 100644 +--- a/c/prim5.c ++++ b/c/prim5.c +@@ -746,6 +746,22 @@ static ptr s_process(char *s, IBOOL stderrp) { + + INT tofds[2], fromfds[2], errfds[2]; + struct sigaction act, oint_act; ++ /* BEGIN PATCH for Guix */ ++#if defined(GUIX_RKTIO_BIN_SH) ++# define GUIX_AS_a_STR_HELPER(x) #x ++# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x) ++ /* A level of indirection makes `#` work as needed: */ ++ struct stat guix_stat_buf; ++ char *guix_sh = ++ (0 == stat(GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH), &guix_stat_buf)) ++ ? GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH) ++ : "/bin/sh"; ++# undef GUIX_AS_a_STR ++# undef GUIX_AS_a_STR_HELPER ++#else /* GUIX_RKTIO_BIN_SH */ ++ char *guix_sh = "/bin/sh"; ++#endif ++ /* END PATCH for Guix */ + + if (pipe(tofds)) S_error("process","cannot open pipes"); + if (pipe(fromfds)) { +@@ -771,7 +787,9 @@ static ptr s_process(char *s, IBOOL stderrp) { + CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1); + CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1); + {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);} +- execl("/bin/sh", "/bin/sh", "-c", s, NULL); ++ /* BEGIN PATCH for Guix */ ++ execl(guix_sh, guix_sh, "-c", s, NULL); ++ /* END PATCH for Guix */ + _exit(1) /* only if execl fails */; + /*NOTREACHED*/ + } else { + +base-commit: 9df56e7b25bc523663eac3da24be33afc5f76c84 +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-chez-scheme-bin-sh.patch b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch new file mode 100644 index 0000000000..df2eb671b3 --- /dev/null +++ b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch @@ -0,0 +1,66 @@ +From 5f3fc12bf123f30485800960b0493f5dd538d107 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Thu, 19 May 2022 13:41:56 -0400 +Subject: [PATCH] Chez Scheme: patch s_process for "/bin/sh" on Guix + +This patch reuses the C preprocessor macro `GUIX_RKTIO_BIN_SH` +from a previous patch. + +If: + + 1. The `GUIX_RKTIO_BIN_SH` macro is defined; and + + 2. The path specified by `GUIX_RKTIO_BIN_SH` exists; + +then `s_process` will call `execl` with the file specified by +`GUIX_RKTIO_BIN_SH` instead of "/bin/sh". + +This patch does not change the behavior of `s_system`, which relies +on `system` from the C library. +--- + racket/src/ChezScheme/c/prim5.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c +index f5e3e345be..9db2989138 100644 +--- a/racket/src/ChezScheme/c/prim5.c ++++ b/racket/src/ChezScheme/c/prim5.c +@@ -856,6 +856,22 @@ static ptr s_process(s, stderrp) char *s; IBOOL stderrp; { + + INT tofds[2], fromfds[2], errfds[2]; + struct sigaction act, oint_act; ++ /* BEGIN PATCH for Guix */ ++#if defined(GUIX_RKTIO_BIN_SH) ++# define GUIX_AS_a_STR_HELPER(x) #x ++# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x) ++ /* A level of indirection makes `#` work as needed: */ ++ struct stat guix_stat_buf; ++ char *guix_sh = ++ (0 == stat(GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH), &guix_stat_buf)) ++ ? GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH) ++ : "/bin/sh"; ++# undef GUIX_AS_a_STR ++# undef GUIX_AS_a_STR_HELPER ++#else /* GUIX_RKTIO_BIN_SH */ ++ char *guix_sh = "/bin/sh"; ++#endif ++ /* END PATCH for Guix */ + + if (pipe(tofds)) S_error("process","cannot open pipes"); + if (pipe(fromfds)) { +@@ -881,7 +897,9 @@ static ptr s_process(s, stderrp) char *s; IBOOL stderrp; { + CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1); + CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1); + {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);} +- execl("/bin/sh", "/bin/sh", "-c", s, NULL); ++ /* BEGIN PATCH for Guix */ ++ execl(guix_sh, guix_sh, "-c", s, NULL); ++ /* END PATCH for Guix */ + _exit(1) /* only if execl fails */; + /*NOTREACHED*/ + } else { + +base-commit: 9d228d16fb99c274c964e5bef93e97333888769f +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-minimal-sh-via-rktio.patch b/gnu/packages/patches/racket-rktio-bin-sh.patch similarity index 79% rename from gnu/packages/patches/racket-minimal-sh-via-rktio.patch rename to gnu/packages/patches/racket-rktio-bin-sh.patch index 6bc2ee8331..4f7f2da083 100644 --- a/gnu/packages/patches/racket-minimal-sh-via-rktio.patch +++ b/gnu/packages/patches/racket-rktio-bin-sh.patch @@ -1,7 +1,7 @@ -From 3574b567c486d264d680a37586436c3b5a8cb978 Mon Sep 17 00:00:00 2001 +From 070abbcc0d880ca4f97f997e096ac66650ccaaa0 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Thu, 4 Mar 2021 04:11:50 -0500 -Subject: [PATCH] patch rktio_process for "/bin/sh" on Guix +Subject: [PATCH] rktio: patch rktio_process for "/bin/sh" on Guix Racket provides the functions `system` and `process`, which execute shell commands using `sh` (or `cmd` on Windows). @@ -13,17 +13,17 @@ the C function that implements the core of `system`, `process`, and related Racket functions. Guix should enable the special case by defining the C preprocessor -macro `GUIX_RKTIO_PATCH_BIN_SH` with the path to `sh` in the store. +macro `GUIX_RKTIO_BIN_SH` with the path to `sh` in the store. If: - 1. The `GUIX_RKTIO_PATCH_BIN_SH` macro is defined; and + 1. The `GUIX_RKTIO_BIN_SH` macro is defined; and 2. `rktio_process` is called with the exact path "/bin/sh"; and - 3. The path specified by `GUIX_RKTIO_PATCH_BIN_SH` does exists; + 3. The file specified by `GUIX_RKTIO_BIN_SH` exists; then `rktio_process` will execute the file specified -by `GUIX_RKTIO_PATCH_BIN_SH` instead of "/bin/sh". +by `GUIX_RKTIO_BIN_SH` instead of "/bin/sh". Compared to previous attempts to patch the Racket sources, making this change at the C level is both: @@ -39,10 +39,10 @@ making this change at the C level is both: 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/racket/src/rktio/rktio_process.c b/racket/src/rktio/rktio_process.c -index 89202436c0..465ebdd5c5 100644 +index fafaf728c1..0a319b381a 100644 --- a/racket/src/rktio/rktio_process.c +++ b/racket/src/rktio/rktio_process.c -@@ -1224,12 +1224,14 @@ int rktio_process_allowed_flags(rktio_t *rktio) +@@ -1301,12 +1301,14 @@ int rktio_process_allowed_flags(rktio_t *rktio) /*========================================================================*/ rktio_process_result_t *rktio_process(rktio_t *rktio, @@ -58,19 +58,19 @@ index 89202436c0..465ebdd5c5 100644 rktio_process_result_t *result; intptr_t to_subprocess[2], from_subprocess[2], err_subprocess[2]; int pid; -@@ -1255,6 +1257,23 @@ rktio_process_result_t *rktio_process(rktio_t *rktio, +@@ -1333,6 +1335,23 @@ rktio_process_result_t *rktio_process(rktio_t *rktio, int i; #endif +/* BEGIN PATCH for Guix */ -+#if defined(GUIX_RKTIO_PATCH_BIN_SH) ++#if defined(GUIX_RKTIO_BIN_SH) +# define GUIX_AS_a_STR_HELPER(x) #x +# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x) + /* A level of indirection makes `#` work as needed: */ + command = + ((0 == strcmp(_guix_orig_command, "/bin/sh")) -+ && rktio_file_exists(rktio, GUIX_AS_a_STR(GUIX_RKTIO_PATCH_BIN_SH))) -+ ? GUIX_AS_a_STR(GUIX_RKTIO_PATCH_BIN_SH) ++ && rktio_file_exists(rktio, GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH))) ++ ? GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH) + : _guix_orig_command; +# undef GUIX_AS_a_STR +# undef GUIX_AS_a_STR_HELPER @@ -82,6 +82,8 @@ index 89202436c0..465ebdd5c5 100644 /* avoid compiler warnings: */ to_subprocess[0] = -1; to_subprocess[1] = -1; + +base-commit: 9d228d16fb99c274c964e5bef93e97333888769f -- -2.21.1 (Apple Git-122.3) +2.32.0 diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3399bcc3fe..cddb617232 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -212,7 +212,8 @@ (define %racket-origin (sha256 (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) + (patches (search-patches "racket-chez-scheme-bin-sh.patch" + "racket-rktio-bin-sh.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -248,7 +249,7 @@ (define (racket-vm-common-configure-flags) (list (string-append "--enable-racket=" racket)))) (else '())) - ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) "--disable-strip" ;; Using --enable-origtree lets us distinguish the VM from subsequent From patchwork Thu Aug 11 11:08:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41555 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 001B427BBEA; Thu, 11 Aug 2022 12:10:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 52A5627BBEC for ; Thu, 11 Aug 2022 12:10:18 +0100 (BST) Received: from localhost ([::1]:56714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM64v-0000hB-E5 for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64i-0000fN-3Y for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64h-0005My-Qq for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64h-0006Yf-Lv for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 04/13] gnu: Add Zuo. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021615325032 (code B ref 57050); Thu, 11 Aug 2022 11:10:03 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:13 +0000 Received: from localhost ([127.0.0.1]:51832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63r-0006VU-LY for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:13 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:45983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63k-0006UA-1S for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:08 -0400 Received: by mail-qk1-f170.google.com with SMTP id b2so455404qkh.12 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=89ugusxRb+YJzfP0tV0/+ntHX5gkqDx7zwX3JNmJsuw=; b=MNZLfzmtv3T1OjZSZJn4TCUUdJzNoCk7P0Ig/aHAbGoQK8MCzEHn+lTLuKjtG7r3Uk 38DbYkhjogVuPJqS3iMxLe7qMP0djtqC/wYz77HSltDE9b9p9SjyAitbquApjzAkBl1i hHnyZJgPwi8DvOSAAOwu/aje3D0EoZ8np4k5bnjhu39ge2ZVBTCo3ENV7lcEH/UP7S3g 7kl6vW15AUskisDaFy+SVP5UO5jHzBzKwQaTplWk7TiwlduKWKbSIxzatRTOiynmQeJ7 qw7pqw82BeLw3XKAV8mXT+FInThKF8fm1PG8cbOCfIh1m2w9NNWM5EWk+0PNTWZwBIsr 9hAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=89ugusxRb+YJzfP0tV0/+ntHX5gkqDx7zwX3JNmJsuw=; b=ZIIsQdE8zIC4pIrZxD/swErUJu6wdutZB/EQhhyVgUp90H2m5TWd4cnfjgXgHpaLY+ 8VdNvmvBwMllORwh4QKWGWRosWtK5+B5CCnzV5JG3WVA5XeAl09Hl8o7LX6S6ZtqBkje AoK4aXG6T5ZFIRBnAO3G0x625xC2qtUD2y7bDmgNVHXQCMjZI8C8+BvHvNvFTVGAJ6Q2 GWSJ5b0SRIaypzjftA5sf02BoDHeoLcPw69Au8Bf9UtcoHHD1v3cFIJIJtM7bZrT37cj wGfyzWN0+XKTGW74fOJLzORrq9wrHKAvW6FxGk0Psz5Ssu4B1VmTjwY//s4wjd67CiL9 W6OQ== X-Gm-Message-State: ACgBeo11jxXp+SWtLjnXaS3iOESpdnRpHKML94laoFgGN2cXEjAefkDn 10y+sS4Repe1/HbOjqmA8CTUYMRoMp1HUjOx X-Google-Smtp-Source: AA6agR4KwZR8IAaSZtU89Edh88lQPndUkUWCZFo3G7U/9cs++FcRXo7fnmP1sIxNmO93gbUDc8Z+uw== X-Received: by 2002:a05:620a:4454:b0:6b9:6ee4:2267 with SMTP id w20-20020a05620a445400b006b96ee42267mr10958480qkp.451.1660216137992; Thu, 11 Aug 2022 04:08:57 -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 ga25-20020a05622a591900b0034361fb2f75sm1507854qtb.22.2022.08.11.04.08.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:08:57 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:14 -0400 Message-Id: <285372112d70bcb4011d6c085592787df4f57d44.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/racket-backport-8.6-zuo.patch, gnu/packages/patches/racket-zuo-bin-sh.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/racket.scm (%zuo-version): New variable. (zuo): New variable. --- gnu/local.mk | 2 + .../patches/racket-backport-8.6-zuo.patch | 481 ++++++++++++++++++ gnu/packages/patches/racket-zuo-bin-sh.patch | 72 +++ gnu/packages/racket.scm | 64 +++ 4 files changed, 619 insertions(+) create mode 100644 gnu/packages/patches/racket-backport-8.6-zuo.patch create mode 100644 gnu/packages/patches/racket-zuo-bin-sh.patch diff --git a/gnu/local.mk b/gnu/local.mk index 076fa341e9..4a87380350 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1774,8 +1774,10 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-backport-8.6-zuo.patch \ %D%/packages/patches/racket-chez-scheme-bin-sh.patch \ %D%/packages/patches/racket-rktio-bin-sh.patch \ + %D%/packages/patches/racket-zuo-bin-sh.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \ diff --git a/gnu/packages/patches/racket-backport-8.6-zuo.patch b/gnu/packages/patches/racket-backport-8.6-zuo.patch new file mode 100644 index 0000000000..b86679b7ec --- /dev/null +++ b/gnu/packages/patches/racket-backport-8.6-zuo.patch @@ -0,0 +1,481 @@ +From 8761fc06b188b9ca2f4b7f2b7d1235075c44a321 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 23 Jul 2022 17:10:58 -0600 +Subject: [PATCH 1/4] Zuo: support cross compilation via `configure` and + `CC_FOR_BUILD` + +(cherry picked from commit 798a989ba6d1a30c491a3120b2c2f1570ecab911) +--- + racket/src/zuo/Makefile.in | 7 ++++++- + racket/src/zuo/README.md | 10 ++++++++++ + racket/src/zuo/configure | 15 +++++++++++++++ + racket/src/zuo/configure.ac | 11 +++++++++++ + 4 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/racket/src/zuo/Makefile.in b/racket/src/zuo/Makefile.in +index 5d16e145bf..747b584c5c 100644 +--- a/racket/src/zuo/Makefile.in ++++ b/racket/src/zuo/Makefile.in +@@ -17,6 +17,11 @@ CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + ++CC_FOR_BUILD = @CC_FOR_BUILD@ ++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ ++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ ++LIBS_FOR_BUILD = @LIBS_FOR_BUILD@ ++ + EMBED_LIBS = @EMBED_LIBS@ + + .PHONY: zuos-to-run-and-install +@@ -24,7 +29,7 @@ zuos-to-run-and-install: zuo + ./zuo . zuos-to-run-and-install + + zuo: $(srcdir)/zuo.c +- $(CC) $(CPPFLAGS) $(CFLAGS) -DZUO_LIB_PATH='"'"$(srcdir)/lib"'"' -o zuo $(srcdir)/zuo.c $(LDFLAGS) $(LIBS) ++ $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -DZUO_LIB_PATH='"'"$(srcdir)/lib"'"' -o zuo $(srcdir)/zuo.c $(LDFLAGS_FOR_BUILD) $(LIBS_FOR_BUILD) + + .PHONY: check + check: zuo +diff --git a/racket/src/zuo/README.md b/racket/src/zuo/README.md +index 17c88ee9ec..3aad504b7e 100644 +--- a/racket/src/zuo/README.md ++++ b/racket/src/zuo/README.md +@@ -84,6 +84,16 @@ A boot image is machine-independent, whether in a stand-alone file or + embedded in `.c` source. + + ++Cross Compiling ++--------------- ++ ++If you use `./configure --host=...` to cross compile, then you will ++also need to add something like `CC_FOR_BUILD=cc` as a `./configure` ++argument to specify the compiler for a `zuo` to use on the build ++machine. If necessary, you can also specify `CFLAGS_FOR_BUILD`, ++`LDFLAGS_FOR_BUILD`, and/or `LIBS_FOR_BUILD`. ++ ++ + Embedding Zuo in Another Application + ------------------------------------ + +diff --git a/racket/src/zuo/configure b/racket/src/zuo/configure +index 1fa34a3fe8..575ce07d96 100755 +--- a/racket/src/zuo/configure ++++ b/racket/src/zuo/configure +@@ -589,6 +589,10 @@ enable_embed="zuo" + ac_subst_vars='LTLIBOBJS + LIBOBJS + EMBED_LIBS ++LIBS_FOR_BUILD ++LDFLAGS_FOR_BUILD ++CFLAGS_FOR_BUILD ++CC_FOR_BUILD + OBJEXT + EXEEXT + ac_ct_CC +@@ -2584,6 +2588,17 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ++if test "${CC_FOR_BUILD}" = ""; then ++ CC_FOR_BUILD='$(CC) -O2' ++ CFLAGS_FOR_BUILD='$(CPPFLAGS) $(CFLAGS)' ++ LDFLAGS_FOR_BUILD='$(LDFLAGS)' ++ LIBS_FOR_BUILD='$(LIBS)' ++fi ++ ++ ++ ++ ++ + + { $as_echo "$as_me:${as_lineno-$LINENO}: zuo libraries to embed: \"${EMBED_LIBS}\"" >&5 + $as_echo "$as_me: zuo libraries to embed: \"${EMBED_LIBS}\"" >&6;} +diff --git a/racket/src/zuo/configure.ac b/racket/src/zuo/configure.ac +index 89b3c6391d..598ff79629 100644 +--- a/racket/src/zuo/configure.ac ++++ b/racket/src/zuo/configure.ac +@@ -25,6 +25,17 @@ AS_IF([test "x$enable_embed" = xno], + AC_PROG_MAKE_SET() + AC_PROG_CC + ++if test "${CC_FOR_BUILD}" = ""; then ++ CC_FOR_BUILD='$(CC) -O2' ++ CFLAGS_FOR_BUILD='$(CPPFLAGS) $(CFLAGS)' ++ LDFLAGS_FOR_BUILD='$(LDFLAGS)' ++ LIBS_FOR_BUILD='$(LIBS)' ++fi ++AC_SUBST(CC_FOR_BUILD) ++AC_SUBST(CFLAGS_FOR_BUILD) ++AC_SUBST(LDFLAGS_FOR_BUILD) ++AC_SUBST(LIBS_FOR_BUILD) ++ + AC_SUBST(EMBED_LIBS) + AC_MSG_NOTICE([zuo libraries to embed: "${EMBED_LIBS}"]) + +-- +2.32.0 + + +From f65194ea41eb472fbdd45d5f6c13eabe5e681704 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 23 Jul 2022 17:47:03 -0600 +Subject: [PATCH 2/4] Zuo: sort hash keys + +Printing in a sorted order is helpful to make things more +deterministic independent of symbol inputs. Making `hash-keys` +produce a sorted list generalizes that determinism. + +(cherry picked from commit 4e7ffd3b365d01c5d0993c0b3fd24c9623962edf) +--- + racket/src/zuo/build.zuo | 5 ++- + racket/src/zuo/tests/hash.zuo | 8 ++-- + racket/src/zuo/zuo-doc/lang-zuo.scrbl | 18 +++++++-- + racket/src/zuo/zuo.c | 57 ++++++++++++++++++++++++++- + 4 files changed, 78 insertions(+), 10 deletions(-) + +diff --git a/racket/src/zuo/build.zuo b/racket/src/zuo/build.zuo +index c1b5e8ce66..129240120a 100644 +--- a/racket/src/zuo/build.zuo ++++ b/racket/src/zuo/build.zuo +@@ -47,7 +47,10 @@ + (target (at-dir (add-exe name)) + (lambda (path token) + (rule (list image_zuo.c +- (input-data-target 'config config) ++ (input-data-target 'config (cons ++ lib-path ++ (map (lambda (key) (hash-ref config key)) ++ '(CC CPPFLAGS CFLAGS LDFLAGS LIBS)))) + (quote-module-path)) + (lambda () + (define l (split-path path)) +diff --git a/racket/src/zuo/tests/hash.zuo b/racket/src/zuo/tests/hash.zuo +index a35741c730..0d3d7f3af6 100644 +--- a/racket/src/zuo/tests/hash.zuo ++++ b/racket/src/zuo/tests/hash.zuo +@@ -35,9 +35,7 @@ + + (check (hash-keys (hash)) '()) + (check (hash-keys (hash 'a 1)) '(a)) +-(check (let ([keys (hash-keys (hash 'a 1 'b 2))]) +- (or (equal? keys '(a b)) +- (equal? keys '(b a))))) ++(check (hash-keys (hash 'a 1 'b 2)) '(a b)) ; always in order + (check (length (hash-keys (hash 'a 1 'b 2 'c 3))) 3) + (check (length (hash-keys (hash 'a 1 'b 2 'a 3))) 2) + (check-arg-fail (hash-keys 0) "not a hash table") +@@ -50,3 +48,7 @@ + (check (hash-keys-subset? (hash 'a 1 'b 2) (hash 'b 1)) #f) + (check-arg-fail (hash-keys-subset? 0 (hash)) "not a hash table") + (check-arg-fail (hash-keys-subset? (hash) 0) "not a hash table") ++ ++;; print sorts keys alphabetically: ++(check (~a (hash 'a 1 'b 2)) "#hash((a . 1) (b . 2))") ++(check (~a (hash 'b 2 'a 1)) "#hash((a . 1) (b . 2))") +diff --git a/racket/src/zuo/zuo-doc/lang-zuo.scrbl b/racket/src/zuo/zuo-doc/lang-zuo.scrbl +index 94641d041e..4605e47471 100644 +--- a/racket/src/zuo/zuo-doc/lang-zuo.scrbl ++++ b/racket/src/zuo/zuo-doc/lang-zuo.scrbl +@@ -538,10 +538,20 @@ support to convert the textual form back into a hash table value. + + Analogous to @realracket*[hash? hash hash-ref hash-set hash-remove + hash-keys hash-count hash-keys-subset?] from @racketmodname[racket]. +-Besides being constrained to symbol keys, there is one additional +-difference: the third argument to @racket[hash-ref], when supplied, +-is always used as a value to return if a key is missing, as +-opposed to a failure thunk.} ++ ++Besides being constrained to symbol keys, there are two additional ++differences: ++ ++@itemlist[ ++ ++ @item{the third argument to @racket[hash-ref], when supplied, is ++ always used as a value to return if a key is missing, as ++ opposed to a failure thunk; and} ++ ++ @item{the @racket[hash-keys] function returns interned keys sorted ++ alphabetically.} ++ ++]} + + + @section{Procedures} +diff --git a/racket/src/zuo/zuo.c b/racket/src/zuo/zuo.c +index 2957d478af..88d5747326 100644 +--- a/racket/src/zuo/zuo.c ++++ b/racket/src/zuo/zuo.c +@@ -1298,6 +1298,59 @@ static zuo_t *zuo_trie_keys(zuo_t *trie_in, zuo_t *accum) { + return accum; + } + ++/*======================================================================*/ ++/* symbol-list sorting */ ++/*======================================================================*/ ++ ++/* merge sort used to make hash printing deterministic */ ++static zuo_t *zuo_symbol_list_sort(zuo_t *l_in) { ++ zuo_t *l, *left, *right, *first, *last; ++ zuo_uint_t len = 0, i; ++ ++ for (l = l_in, len = 0; l != z.o_null; l = _zuo_cdr(l)) ++ len++; ++ ++ if (len < 2) ++ return l_in; ++ ++ left = z.o_null; ++ for (l = l_in, i = len >> 1; i > 0; l = _zuo_cdr(l), i--) ++ left = zuo_cons(_zuo_car(l), left); ++ right = l; ++ ++ left = zuo_symbol_list_sort(left); ++ right = zuo_symbol_list_sort(right); ++ ++ first = last = z.o_null; ++ while ((left != z.o_null) && (right != z.o_null)) { ++ zuo_t *p; ++ ++ if (strcmp(ZUO_STRING_PTR(((zuo_symbol_t *)_zuo_car(left))->str), ++ ZUO_STRING_PTR(((zuo_symbol_t *)_zuo_car(right))->str)) ++ < 1) { ++ p = zuo_cons(_zuo_car(left), z.o_null); ++ left = _zuo_cdr(left); ++ } else { ++ p = zuo_cons(_zuo_car(right), z.o_null); ++ right = _zuo_cdr(right); ++ } ++ ++ if (first == z.o_null) ++ first = p; ++ else ++ ((zuo_pair_t *)last)->cdr = p; ++ last = p; ++ } ++ ++ ((zuo_pair_t *)last)->cdr = ((left != z.o_null) ? left : right); ++ ++ return first; ++} ++ ++static zuo_t *zuo_trie_sorted_keys(zuo_t *trie_in, zuo_t *accum) { ++ return zuo_symbol_list_sort(zuo_trie_keys(trie_in, accum)); ++} ++ + /*======================================================================*/ + /* terminal support */ + /*======================================================================*/ +@@ -1571,7 +1624,7 @@ static void zuo_out(zuo_out_t *out, zuo_t *obj, zuo_print_mode_t mode) { + out_string(out, "opaque"); + out_string(out, ">"); + } else if (obj->tag == zuo_trie_node_tag) { +- zuo_t *keys = zuo_trie_keys(obj, z.o_null); ++ zuo_t *keys = zuo_trie_sorted_keys(obj, z.o_null); + if (mode == zuo_print_mode) { + out_string(out, "(hash"); + if (keys != z.o_null) +@@ -2587,7 +2640,7 @@ static zuo_t *zuo_hash_remove(zuo_t *ht, zuo_t *sym) { + + static zuo_t *zuo_hash_keys(zuo_t *ht) { + check_hash("hash-keys", ht); +- return zuo_trie_keys(ht, z.o_null); ++ return zuo_trie_sorted_keys(ht, z.o_null); + } + + static zuo_t *zuo_hash_keys_subset_p(zuo_t *ht, zuo_t *ht2) { +-- +2.32.0 + + +From f2eecaa1dd875479d2cf51566223b3d0d7b9f738 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 23 Jul 2022 18:06:41 -0600 +Subject: [PATCH 3/4] Zuo: check for nul characters in `string->symbol` + +(cherry picked from commit e20022ccfad40d0ba2e77aa75bc4f775018c781f) +--- + racket/src/zuo/tests/symbol.zuo | 3 +++ + racket/src/zuo/zuo-doc/lang-zuo.scrbl | 4 ++- + racket/src/zuo/zuo.c | 37 +++++++++++++++++---------- + 3 files changed, 29 insertions(+), 15 deletions(-) + +diff --git a/racket/src/zuo/tests/symbol.zuo b/racket/src/zuo/tests/symbol.zuo +index 7775aeeb04..5600a89755 100644 +--- a/racket/src/zuo/tests/symbol.zuo ++++ b/racket/src/zuo/tests/symbol.zuo +@@ -19,3 +19,6 @@ + (check (not (equal? 'apple (string->uninterned-symbol "apple")))) + (check-arg-fail (string->symbol 'apple) not-string) + (check-arg-fail (string->uninterned-symbol 'apple) not-string) ++ ++(check-arg-fail (string->symbol "apple\0spice") "without a nul character") ++(check (symbol? (string->uninterned-symbol "apple\0spice"))) +diff --git a/racket/src/zuo/zuo-doc/lang-zuo.scrbl b/racket/src/zuo/zuo-doc/lang-zuo.scrbl +index 4605e47471..07dd5815b0 100644 +--- a/racket/src/zuo/zuo-doc/lang-zuo.scrbl ++++ b/racket/src/zuo/zuo-doc/lang-zuo.scrbl +@@ -500,7 +500,9 @@ back into Zuo. + )]{ + + Analogous to @realracket*[symbol? symbol->string string->symbol +-string->uninterned-symbol] from @racketmodname[racket].} ++string->uninterned-symbol] from @racketmodname[racket], but ++@racket[string->symbol] accepts only strings that do not contain the ++null character.} + + + @section{Hash Tables (Persistent Maps)} +diff --git a/racket/src/zuo/zuo.c b/racket/src/zuo/zuo.c +index 88d5747326..17f161826d 100644 +--- a/racket/src/zuo/zuo.c ++++ b/racket/src/zuo/zuo.c +@@ -1323,7 +1323,7 @@ static zuo_t *zuo_symbol_list_sort(zuo_t *l_in) { + + first = last = z.o_null; + while ((left != z.o_null) && (right != z.o_null)) { +- zuo_t *p; ++ zuo_t *p, *s_left, *s_right; + + if (strcmp(ZUO_STRING_PTR(((zuo_symbol_t *)_zuo_car(left))->str), + ZUO_STRING_PTR(((zuo_symbol_t *)_zuo_car(right))->str)) +@@ -2573,8 +2573,28 @@ static zuo_t *zuo_substring(zuo_t *obj, zuo_t *start_i, zuo_t *end_i) { + return zuo_sized_string((const char *)&((zuo_string_t *)obj)->s[s_idx], e_idx - s_idx); + } + ++static int zuo_is_string_without_nul(zuo_t *obj) { ++ zuo_int_t i; ++ ++ if ((obj->tag != zuo_string_tag) ++ || ZUO_STRING_LEN(obj) == 0) ++ return 0; ++ ++ for (i = ZUO_STRING_LEN(obj); i--; ) { ++ if (((zuo_string_t *)obj)->s[i] == 0) ++ return 0; ++ } ++ ++ return 1; ++} ++ + static zuo_t *zuo_string_to_symbol(zuo_t *obj) { +- check_string("string->symbol", obj); ++ if (!zuo_is_string_without_nul(obj)) { ++ const char *who = "string->symbol"; ++ check_string(who, obj); ++ zuo_fail_arg(who, "string without a nul character", obj); ++ } ++ + return zuo_symbol_from_string(ZUO_STRING_PTR(obj), obj); + } + +@@ -3577,18 +3597,7 @@ static void *zuo_envvars_block(const char *who, zuo_t *envvars) + #endif + + static int zuo_is_path_string(zuo_t *obj) { +- zuo_int_t i; +- +- if ((obj->tag != zuo_string_tag) +- || ZUO_STRING_LEN(obj) == 0) +- return 0; +- +- for (i = ZUO_STRING_LEN(obj); i--; ) { +- if (((zuo_string_t *)obj)->s[i] == 0) +- return 0; +- } +- +- return 1; ++ return zuo_is_string_without_nul(obj); + } + + static zuo_t *zuo_path_string_p(zuo_t *obj) { +-- +2.32.0 + + +From de6618cb3819d25580e3cd400ea09c8cf4f673a9 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 23 Jul 2022 19:50:46 -0600 +Subject: [PATCH 4/4] Zuo: CPPFLAGS_FOR_BUILD, too + +(cherry picked from commit cf82706c4b298f654a04c4bc8d98dff39b62a2ac) +--- + racket/src/zuo/Makefile.in | 3 ++- + racket/src/zuo/configure | 5 ++++- + racket/src/zuo/configure.ac | 4 +++- + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/racket/src/zuo/Makefile.in b/racket/src/zuo/Makefile.in +index 747b584c5c..0376c038a8 100644 +--- a/racket/src/zuo/Makefile.in ++++ b/racket/src/zuo/Makefile.in +@@ -19,6 +19,7 @@ LIBS = @LIBS@ + + CC_FOR_BUILD = @CC_FOR_BUILD@ + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ ++CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ + LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ + LIBS_FOR_BUILD = @LIBS_FOR_BUILD@ + +@@ -29,7 +30,7 @@ zuos-to-run-and-install: zuo + ./zuo . zuos-to-run-and-install + + zuo: $(srcdir)/zuo.c +- $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -DZUO_LIB_PATH='"'"$(srcdir)/lib"'"' -o zuo $(srcdir)/zuo.c $(LDFLAGS_FOR_BUILD) $(LIBS_FOR_BUILD) ++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -DZUO_LIB_PATH='"'"$(srcdir)/lib"'"' -o zuo $(srcdir)/zuo.c $(LDFLAGS_FOR_BUILD) $(LIBS_FOR_BUILD) + + .PHONY: check + check: zuo +diff --git a/racket/src/zuo/configure b/racket/src/zuo/configure +index 575ce07d96..7ac453e3bc 100755 +--- a/racket/src/zuo/configure ++++ b/racket/src/zuo/configure +@@ -591,6 +591,7 @@ LIBOBJS + EMBED_LIBS + LIBS_FOR_BUILD + LDFLAGS_FOR_BUILD ++CPPFLAGS_FOR_BUILD + CFLAGS_FOR_BUILD + CC_FOR_BUILD + OBJEXT +@@ -2590,7 +2591,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "${CC_FOR_BUILD}" = ""; then + CC_FOR_BUILD='$(CC) -O2' +- CFLAGS_FOR_BUILD='$(CPPFLAGS) $(CFLAGS)' ++ CPPFLAGS_FOR_BUILD='$(CPPFLAGS)' ++ CFLAGS_FOR_BUILD='$(CFLAGS)' + LDFLAGS_FOR_BUILD='$(LDFLAGS)' + LIBS_FOR_BUILD='$(LIBS)' + fi +@@ -2600,6 +2602,7 @@ fi + + + ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: zuo libraries to embed: \"${EMBED_LIBS}\"" >&5 + $as_echo "$as_me: zuo libraries to embed: \"${EMBED_LIBS}\"" >&6;} + +diff --git a/racket/src/zuo/configure.ac b/racket/src/zuo/configure.ac +index 598ff79629..051ea0beb5 100644 +--- a/racket/src/zuo/configure.ac ++++ b/racket/src/zuo/configure.ac +@@ -27,12 +27,14 @@ AC_PROG_CC + + if test "${CC_FOR_BUILD}" = ""; then + CC_FOR_BUILD='$(CC) -O2' +- CFLAGS_FOR_BUILD='$(CPPFLAGS) $(CFLAGS)' ++ CPPFLAGS_FOR_BUILD='$(CPPFLAGS)' ++ CFLAGS_FOR_BUILD='$(CFLAGS)' + LDFLAGS_FOR_BUILD='$(LDFLAGS)' + LIBS_FOR_BUILD='$(LIBS)' + fi + AC_SUBST(CC_FOR_BUILD) + AC_SUBST(CFLAGS_FOR_BUILD) ++AC_SUBST(CPPFLAGS_FOR_BUILD) + AC_SUBST(LDFLAGS_FOR_BUILD) + AC_SUBST(LIBS_FOR_BUILD) + +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-zuo-bin-sh.patch b/gnu/packages/patches/racket-zuo-bin-sh.patch new file mode 100644 index 0000000000..392ea05129 --- /dev/null +++ b/gnu/packages/patches/racket-zuo-bin-sh.patch @@ -0,0 +1,72 @@ +From 4888106cdfd80d1af925e5a485a2812d35a83b46 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Mon, 11 Apr 2022 20:43:18 -0400 +Subject: [PATCH] Zuo: patch zuo_process for "/bin/sh" on Guix + +This patch reuses the C preprocessor macro `GUIX_RKTIO_BIN_SH` +from a previous patch. + +If: + + 1. The `GUIX_RKTIO_BIN_SH` macro is defined; and + + 2. `zuo_process` is called with the exact path "/bin/sh"; and + + 3. The path specified by `GUIX_RKTIO_BIN_SH` exists; + +then `zuo_process` will execute the file specified by +`GUIX_RKTIO_BIN_SH` instead of "/bin/sh". +--- + racket/src/zuo/zuo.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/racket/src/zuo/zuo.c b/racket/src/zuo/zuo.c +index 17f161826d..10e7a2a297 100644 +--- a/racket/src/zuo/zuo.c ++++ b/racket/src/zuo/zuo.c +@@ -5730,7 +5730,18 @@ static void zuo_pipe(zuo_raw_handle_t *_r, zuo_raw_handle_t *_w) + zuo_t *zuo_process(zuo_t *command_and_args) + { + const char *who = "process"; +- zuo_t *command = _zuo_car(command_and_args); ++ /* BEGIN PATCH for Guix */ ++ zuo_t *_guix_orig_command = _zuo_car(command_and_args); ++ zuo_t *command; ++#if defined(GUIX_RKTIO_BIN_SH) ++# define GUIX_AS_a_STR_HELPER(x) #x ++# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x) ++ /* A level of indirection makes `#` work as needed: */ ++ const char *guix_sh = GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH); ++# undef GUIX_AS_a_STR ++# undef GUIX_AS_a_STR_HELPER ++#endif ++ /* END PATCH for Guix */ + zuo_t *args = _zuo_cdr(command_and_args), *rev_args = z.o_null; + zuo_t *options = z.o_empty_hash, *opt; + zuo_t *dir, *l, *p_handle, *result; +@@ -5741,7 +5752,19 @@ zuo_t *zuo_process(zuo_t *command_and_args) + void *env; + int as_child, exact_cmdline; + +- check_path_string(who, command); ++ /* BEGIN PATCH for Guix */ ++ check_path_string(who, _guix_orig_command); ++#if defined(GUIX_RKTIO_BIN_SH) ++ command = ++ ((z.o_false == zuo_string_eql(_guix_orig_command, zuo_string("/bin/sh"))) ++ || (z.o_false == zuo_stat(zuo_string(guix_sh), z.o_false, z.o_true))) ++ ? _guix_orig_command ++ : zuo_string(guix_sh); ++#else ++ command = _guix_orig_command; ++#endif ++ /* END PATCH for Guix */ ++ + for (l = args; l->tag == zuo_pair_tag; l = _zuo_cdr(l)) { + zuo_t *a = _zuo_car(l); + if (a == z.o_null) { + +base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index cddb617232..0c8b3b6bb8 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -201,6 +201,7 @@ (define* (racket-vm-for-system #:optional racket-vm-bc)) (define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! +(define %zuo-version "1.0") ; defined in racket/src/zuo/zuo.c (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -233,6 +234,69 @@ (define %racket-origin ;; Unbundle libffi. (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + +(define-public zuo + (let ((revision #f)) + (package + (name "zuo") + (version (string-append %zuo-version + "-racket" + "8.6" + (if revision "-guix" "") + (or revision ""))) + (source + (origin + (inherit %racket-origin) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit "v8.6"))) + (sha256 + (base32 "1yi36nr7zrdwrnvpmliirxxjz4pyfyhkar6yvk3rapvmg4q2vmnk")) + (patches (append (origin-patches %racket-origin) + (search-patches "racket-backport-8.6-zuo.patch" + "racket-zuo-bin-sh.patch"))) + (file-name (git-file-name "racket" "8.6")))) + (outputs '("out" "debug")) + (build-system gnu-build-system) + (inputs (list bash-minimal)) + (native-inputs (list bash-minimal)) + (arguments + (list + #:configure-flags + #~`(,(string-append "CPPFLAGS=-DGUIX_RKTIO_BIN_SH=" + #$(file-append (this-package-input "bash-minimal") + "/bin/sh")) + #+@(if (%current-target-system) + (list #~,(string-append + "CPPFLAGS_FOR_BUILD=-DGUIX_RKTIO_BIN_SH=" + #+(file-append + (this-package-native-input "bash-minimal") + "/bin/sh"))) + '())) + #:out-of-source? #t + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/zuo")))))) + (home-page "https://github.com/racket/zuo") + ;; ^ This is downstream of https://github.com/racket/racket, + ;; but it's designed to be a friendly landing place + (synopsis "Tiny Racket for build scripts") + (description "You should use Racket to write scripts. But what if you +need something much smaller than Racket for some reason—or what if you're +trying to script a build of Racket itself? Zuo is a tiny Racket with +primitives for dealing with files and running processes, and it comes with a +@command{make}-like embedded DSL. + +Zuo (作) is a Racket variant in the sense that program files start with +@code{#lang}, and the module path after @code{#lang} determines the parsing +and expansion of the file content. That's how the @command{make}-like DSL is +defined, and even the base Zuo language is defined by layers of @code{#lang}s. +One of the early layers implements macros.") + (license (list license:asl2.0 license:expat))))) + + (define (racket-vm-common-configure-flags) ;; under a lambda abstraction to avoid evaluating bash-minimal too early. #~`(,@(cond From patchwork Thu Aug 11 11:08:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41560 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 AF5F127BBE9; Thu, 11 Aug 2022 12:11:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 15AB227BBEB for ; Thu, 11 Aug 2022 12:10:56 +0100 (BST) Received: from localhost ([::1]:57508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65W-0001LC-Jb for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64h-0000fB-Cf for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64h-0005MK-3N for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64g-0006YT-Uw for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 05/13] gnu: racket: Update to 8.6. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021615125019 (code B ref 57050); Thu, 11 Aug 2022 11:10:02 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:11 +0000 Received: from localhost ([127.0.0.1]:51829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63p-0006VL-1d for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:11 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:38401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63k-0006Tx-86 for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:07 -0400 Received: by mail-qt1-f174.google.com with SMTP id y18so3119301qtv.5 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=UAlttYJoj/PGU3tozmZk7twml4DQ0h8KwvCRTyPmxsQ=; b=clwtD3CUgINfyn8murO2IE9DNLTCh17w0C3jlA8CN7PaaSYXkdN1R7hIRSoq2Q3SYF StH1bmC6nh3EoaRLeLMeiFiLdP9aDHIl94eSWhAVEgHMS1aawYuOu6vlHAuuyKRWH9zO BqiA2vgVLZGDndFCB8jgD+Kn1oza9gaX97H07dVJO5chl1Vl68BXncWkc1HWlaipxokp vZOqFjQJc3dvVeHHmEzfBa1ckb76APvxzGopk55cz4Ni6/5t8voMw8BQq5wJ1A+gBYTr Xvbu/BZMmUQYzqbMfD/YFGtoaUdgkdHRTUu4oU7m/OY+XXOtQaRzMuIeYS+y7RymeKu1 LQvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=UAlttYJoj/PGU3tozmZk7twml4DQ0h8KwvCRTyPmxsQ=; b=WFLpsJDnmF38MxBMDET9z+oJe7TAVGp0IwCPHHO0fp8j8f9pO7/Mtl5/YpaBZq2tOW LvXnGj7VnL9/GC/byD5SgMvOK47OynGAhh80lrMOV8luwVag7Fc7KpT8o+As7XRGFqSt ZM2H25UwAFNg6k0AHXxRoMPyhpMilCWXI9rIxAbAX2g1IwUO5v/oTCFaIDwVFCiH4rYZ ROAXcz6GpH1+Pab3MyhHgqP5aeN54CBtpre69HBAOCcpScBZfnRjdgGFZRwUZIV8kkwr ox8o2vABSw5JGcu0RCTd0KyKlDkG8VrxFcWip/jIKOlHzJw0PuoTLAHzssHzxZc31lOf sw3A== X-Gm-Message-State: ACgBeo1BSsFD1e+PzP/yZOHH+gbc7/+e/E+bInV7BDSAeK7/iH3SlEBt DzvDDnQuHgQvxedv98V0MNvSQDLXont4kpOD X-Google-Smtp-Source: AA6agR5JllerHC4e3lRW0ILd3xxEITMbJaadf0v/YgXNYE4mog9/FeOPKmlEDvxf4E96kiGQZBZAhA== X-Received: by 2002:ac8:5c49:0:b0:343:5628:5fe with SMTP id j9-20020ac85c49000000b00343562805femr6675664qtj.250.1660216142151; Thu, 11 Aug 2022 04:09:02 -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 l3-20020a05620a28c300b006b9a24dc9d7sm1853516qkp.7.2022.08.11.04.09.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:01 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:15 -0400 Message-Id: <5e784e0d35bf5b342bd7df77c4fa137deb942e47.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Also, update 'chez-scheme-for-racket' to 9.5.9.2. * gnu/packages/patches/racket-chez-scheme-bin-sh.patch: Refresh patch. * gnu/packages/patches/racket-backport-8.6-cross-install.patch, gnu/packages/patches/racket-backport-8.6-docindex-write.patch, gnu/packages/patches/racket-backport-8.6-hurd.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/racket.scm (%racket-origin)[patches]: Use them and the patches for Zuo. (%racket-version): Update to 8.6. (zuo)[version]: Refer to '%racket-version'. [origin]: Use '%racket-origin'. (racket-vm-cgc)[native-inputs]: Add 'zuo'. [arguments]<#:make-flags>: Use 'zuo' from 'native-inputs'. (racket)[inputs]: Update checksums. * gnu/packages/chez.scm (target-chez-os): Handle Hurd and QNX. (%chez-features-table): Likewise. (chez-scheme-for-racket): Update to 9.5.9.2. [native-inputs]: Add 'zuo'. [arguments]<#:out-of-source?>: Use out-of-source build. <#:tests?>: Skip them due to ongoing problems. <#:configure-flags>: Add '--install-csug=' and '--installreleasenotes='. <#:make-flags>: Use 'zuo' from 'native-inputs'. Supply 'STEXLIB=' here, rather than in a phase. <#:phases>: Replace 'install-docs' using new 'make' target. --- gnu/packages/chez.scm | 52 +- .../racket-backport-8.6-cross-install.patch | 32 + .../racket-backport-8.6-docindex-write.patch | 36 ++ .../patches/racket-backport-8.6-hurd.patch | 609 ++++++++++++++++++ .../patches/racket-chez-scheme-bin-sh.patch | 16 +- gnu/packages/racket.scm | 121 ++-- 6 files changed, 794 insertions(+), 72 deletions(-) create mode 100644 gnu/packages/patches/racket-backport-8.6-cross-install.patch create mode 100644 gnu/packages/patches/racket-backport-8.6-docindex-write.patch create mode 100644 gnu/packages/patches/racket-backport-8.6-hurd.patch diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 66098c7a24..dde2c22ca5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -116,7 +116,7 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) ((target-linux? system) "le") ((target-hurd? system) - #f) + "gnu") ((target-mingw? system) "nt") ;; missing (guix utils) predicates @@ -132,6 +132,8 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) ;; Nix says "x86_64-solaris", but accommodate "-solaris2" ((string-contains system "solaris") "s2") + ((string-suffix? "-qnx" system) + "qnx") ;; unknown (else #f))) @@ -168,6 +170,9 @@ (define %chez-features-table ("arm32" bootstrap-bootfiles) ("arm64" . #f) ("ppc32" threads)) + ;; Hurd + ("gnu" + ("i3" . #f)) ;; FreeBSD ("fb" ("i3" threads) ;; commented out @@ -193,6 +198,9 @@ (define %chez-features-table ("s2" ("i3" threads) ;; commented out ("a6" threads)) ;; commented out + ;; QNX + ("qnx" + ("i3" . #f)) ;; Windows ("nt" ("i3" threads bootstrap-bootfiles) @@ -437,7 +445,7 @@ (define-public chez-scheme-for-racket (package (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.5.7.6") + (version "9.5.9.2") ;; The version should match `(scheme-fork-version-number)`. ;; See racket/src/ChezScheme/s/cmacros.ss c. line 360. ;; It will always be different than the upstream version! @@ -448,18 +456,52 @@ (define-public chez-scheme-for-racket (delete "libx11" "util-linux:lib"))) (native-inputs (modify-inputs (package-native-inputs chez-scheme) + (append zuo) (replace "chez-scheme-bootstrap-bootfiles" chez-scheme-for-racket-bootstrap-bootfiles))) (arguments (substitute-keyword-arguments (package-arguments chez-scheme) + ((#:out-of-source? _ #f) + #t) + ((#:tests? _ #t) + ;; FIXME: There have been some flaky test failures. Some have been + ;; fixed upstream post-release but have proven non-trivial to + ;; backport; at least one issue remains. Re-enable tests once + ;; https://github.com/racket/racket/issues/4359 is fixed. + #f) ((#:configure-flags cfg-flags #~'()) - #~(cons* "--disable-x11" - "--threads" ;; ok to potentially duplicate - #$cfg-flags)) + #~`("--disable-x11" + "--threads" ;; ok to potentially duplicate + ,@(let* ((chez+version (strip-store-file-name #$output)) + (doc-prefix (assoc-ref %outputs "doc")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (list (string-append "--installcsug=" + doc-dir + "/csug") + (string-append "--installreleasenotes=" + doc-dir + "/release_notes"))) + ,@#$cfg-flags)) + ((#:make-flags mk-flags #~'()) + #~(cons* (string-append "ZUO=" + #+(this-package-native-input "zuo") + "/bin/zuo") + (string-append "STEXLIB=" + #+(this-package-native-input "stex") + "/lib/stex") + #$mk-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) (unpack (assoc-ref those-phases 'unpack))) (modify-phases those-phases + (replace 'install-docs + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke + "make" + "install-docs" + make-flags))) (replace 'unpack (lambda args (unpack #:source #$(or (package-source this-package) diff --git a/gnu/packages/patches/racket-backport-8.6-cross-install.patch b/gnu/packages/patches/racket-backport-8.6-cross-install.patch new file mode 100644 index 0000000000..4f7849ecc6 --- /dev/null +++ b/gnu/packages/patches/racket-backport-8.6-cross-install.patch @@ -0,0 +1,32 @@ +From 585215c5c42f7ee0fee05e6a637ab1bc17f5e8e0 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 30 Jul 2022 07:06:55 -0600 +Subject: [PATCH] CS makefiles: fix Unix-style install for cross compilation + +Closes #4377 + +(cherry picked from commit 053be470e7c5454cdf48e934f3254d2d916bbbc5) +--- + racket/src/cs/c/build.zuo | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/racket/src/cs/c/build.zuo b/racket/src/cs/c/build.zuo +index 8d3950bb27..d8b74c509d 100644 +--- a/racket/src/cs/c/build.zuo ++++ b/racket/src/cs/c/build.zuo +@@ -1016,10 +1016,9 @@ + (define (setup) + (call-with-dest-racket + (lambda (bindir dest-racket) +- (define copytree-racket (and cross? (config-bootstrap-racket))) ++ (define copytree-racket (and cross? (hash-ref (config-bootstrap-racket) 'racket))) + (maybe-copytree config dest-racket copytree-racket at-dir) +- (run-raco-setup config dest-racket +- (and cross? (hash-ref (config-bootstrap-racket) 'racket)) ++ (run-raco-setup config dest-racket copytree-racket + ;; this can be redundant if it's also supplied via `SETUP_MACHINE_FLAGS`, + ;; but redundant should be ok: + (list "-MCR" (~a (at-dir "compiled") ":") +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-backport-8.6-docindex-write.patch b/gnu/packages/patches/racket-backport-8.6-docindex-write.patch new file mode 100644 index 0000000000..abe1984507 --- /dev/null +++ b/gnu/packages/patches/racket-backport-8.6-docindex-write.patch @@ -0,0 +1,36 @@ +From 8b4d686a62fd66dedfc40ecdcf3698316993d614 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Sun, 17 Jul 2022 22:51:44 -0400 +Subject: [PATCH] racket-index: set write permission when copying + `docindex.sqlite` + +Fixes https://github.com/racket/racket/issues/4357 + +(cherry picked from commit 55b6cbdca1f36a4f37bab1519c1b658717d3cad2) +--- + pkgs/racket-index/setup/scribble.rkt | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/pkgs/racket-index/setup/scribble.rkt b/pkgs/racket-index/setup/scribble.rkt +index 6694f0b793..e27a8fa348 100644 +--- a/pkgs/racket-index/setup/scribble.rkt ++++ b/pkgs/racket-index/setup/scribble.rkt +@@ -252,7 +252,14 @@ + (unless (file-exists? db-file) + (define-values (base name dir?) (split-path db-file)) + (make-directory* base) +- (when copy-from (copy-file copy-from db-file)) ++ (when copy-from ++ (copy-file copy-from db-file) ++ ;; we might not have write permissions for the previous layer: ++ ;; ensure that we do for the new file ++ (define orig-mode (file-or-directory-permissions db-file 'bits)) ++ (define writeable-mode (bitwise-ior user-write-bit orig-mode)) ++ (unless (= writeable-mode orig-mode) ++ (file-or-directory-permissions db-file writeable-mode))) + (doc-db-disconnect + (doc-db-file->connection db-file #t)))) + (when (or (ormap can-build*? main-docs) +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-backport-8.6-hurd.patch b/gnu/packages/patches/racket-backport-8.6-hurd.patch new file mode 100644 index 0000000000..d593b01e62 --- /dev/null +++ b/gnu/packages/patches/racket-backport-8.6-hurd.patch @@ -0,0 +1,609 @@ +From f17b030fa2f902bb3666913d4a3cd6ba9c146d22 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Wed, 3 Aug 2022 03:13:03 -0400 +Subject: [PATCH 1/3] Chez Scheme: Fix build on GNU/Hurd + +Mostly GNU/Hurd should take the same options as GNU/Linux. One +difference is that the Hurd does not define macros such as `PATH_MAX` or +`NOFILE`, because it avoids imposing arbitrary limits on such resources. +This patch provides alternatives for localized uses of those constants, +but it accepts the pervasive use of `PATH_MAX` in finding bootfiles for +now. See https://www.gnu.org/software/hurd/hurd/porting/guidelines.html. + +(cherry picked from commit 87eee6e2adb8c6bc11e60619c706fa6295096085) +--- + racket/src/ChezScheme/README.md | 1 + + racket/src/ChezScheme/c/number.c | 22 +++++++++---------- + racket/src/ChezScheme/c/prim5.c | 35 ++++++++++++++++++++++++++++-- + racket/src/ChezScheme/c/scheme.c | 34 +++++++++++++++++------------ + racket/src/ChezScheme/c/version.h | 7 ++++-- + racket/src/ChezScheme/configure | 17 ++++++++++----- + racket/src/ChezScheme/s/cmacros.ss | 1 + + racket/src/cs/c/configure | 14 ++++++++++-- + racket/src/cs/c/configure.ac | 14 ++++++++++-- + racket/src/cs/rumble/system.ss | 3 +++ + 10 files changed, 109 insertions(+), 39 deletions(-) + +diff --git a/racket/src/ChezScheme/README.md b/racket/src/ChezScheme/README.md +index a4a11a5eef..25231dd9bb 100644 +--- a/racket/src/ChezScheme/README.md ++++ b/racket/src/ChezScheme/README.md +@@ -13,6 +13,7 @@ Supported platforms (bytecode interpreter may work for others): + * OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32 + * NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32 + * Solaris: x86, x86_64 ++ * GNU/Hurd: x86 + * Android: ARMv7, AArch64 + * iOS: AArch64 + * WebAssembly via Emscripten (bytecode interpreter only) +diff --git a/racket/src/ChezScheme/c/number.c b/racket/src/ChezScheme/c/number.c +index ede38cc626..e2bce0d2d3 100644 +--- a/racket/src/ChezScheme/c/number.c ++++ b/racket/src/ChezScheme/c/number.c +@@ -1041,15 +1041,15 @@ floating-point operations + + #ifdef IEEE_DOUBLE + /* exponent stored + 1024, hidden bit to left of decimal point */ +-#define bias 1023 +-#define bitstoright 52 +-#define m1mask 0xf +-#ifdef WIN32 +-#define hidden_bit 0x10000000000000 +-#else +-#define hidden_bit 0x10000000000000ULL +-#endif +-#ifdef LITTLE_ENDIAN_IEEE_DOUBLE ++# define bias 1023 ++# define bitstoright 52 ++# define m1mask 0xf ++# ifdef WIN32 ++# define hidden_bit 0x10000000000000 ++# else ++# define hidden_bit 0x10000000000000ULL ++# endif ++# ifdef LITTLE_ENDIAN_IEEE_DOUBLE + struct dblflt { + UINT m4: 16; + UINT m3: 16; +@@ -1058,7 +1058,7 @@ struct dblflt { + UINT e: 11; + UINT sign: 1; + }; +-#else ++# else + struct dblflt { + UINT sign: 1; + UINT e: 11; +@@ -1067,7 +1067,7 @@ struct dblflt { + UINT m3: 16; + UINT m4: 16; + }; +-#endif ++# endif + #endif + + double S_random_double(U32 m1, U32 m2, U32 m3, U32 m4, double scale) { +diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c +index 124d1e049c..82bbf8d687 100644 +--- a/racket/src/ChezScheme/c/prim5.c ++++ b/racket/src/ChezScheme/c/prim5.c +@@ -23,6 +23,10 @@ + #include + #include + ++#if defined(__GNU__) /* Hurd */ ++#include ++#endif ++ + /* locally defined functions */ + static INT s_errno(void); + static IBOOL s_addr_in_heap(uptr x); +@@ -58,7 +62,7 @@ static void s_showalloc(IBOOL show_dump, const char *outfn); + static ptr s_system(const char *s); + static ptr s_process(char *s, IBOOL stderrp); + static I32 s_chdir(const char *inpath); +-#ifdef GETWD ++#if defined(GETWD) || defined(__GNU__) /* Hurd */ + static char *s_getwd(void); + #endif + static ptr s_set_code_byte(ptr p, ptr n, ptr x); +@@ -881,7 +885,18 @@ static ptr s_process(char *s, IBOOL stderrp) { + CLOSE(0); if (dup(tofds[0]) != 0) _exit(1); + CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1); + CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1); ++#ifndef __GNU__ /* Hurd */ + {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);} ++#else /* __GNU__ Hurd: no NOFILE */ ++ { ++ INT i; ++ struct rlimit rlim; ++ getrlimit(RLIMIT_NOFILE, &rlim); ++ for (i = 3; i < rlim.rlim_cur; i++) { ++ (void)CLOSE(i); ++ } ++ } ++#endif /* __GNU__ Hurd */ + execl("/bin/sh", "/bin/sh", "-c", s, NULL); + _exit(1) /* only if execl fails */; + /*NOTREACHED*/ +@@ -927,6 +942,22 @@ static I32 s_chdir(const char *inpath) { + static char *s_getwd() { + return GETWD(TO_VOIDP(&BVIT(S_bytevector(PATH_MAX), 0))); + } ++#elif defined(__GNU__) /* Hurd: no PATH_MAX */ ++static char *s_getwd() { ++ char *path; ++ size_t len; ++ ptr bv; ++ path = getcwd(NULL, 0); ++ if (NULL == path) { ++ return NULL; ++ } else { ++ len = strlen(path); ++ bv = S_bytevector(len); ++ memcpy(TO_VOIDP(&BVIT(bv, 0)), path, len); ++ free(path); ++ return TO_VOIDP(&BVIT(bv, 0)); ++ } ++} + #endif /* GETWD */ + + static ptr s_set_code_byte(ptr p, ptr n, ptr x) { +@@ -1817,7 +1848,7 @@ void S_prim5_init(void) { + Sforeign_symbol("(cs)s_rational", (void *)S_rational); + Sforeign_symbol("(cs)sub", (void *)S_sub); + Sforeign_symbol("(cs)rem", (void *)S_rem); +-#ifdef GETWD ++#if defined(GETWD) || defined(__GNU__) /* Hurd */ + Sforeign_symbol("(cs)s_getwd", (void *)s_getwd); + #endif + Sforeign_symbol("(cs)s_chdir", (void *)s_chdir); +diff --git a/racket/src/ChezScheme/c/scheme.c b/racket/src/ChezScheme/c/scheme.c +index ed5564540b..0c40e3eaf0 100644 +--- a/racket/src/ChezScheme/c/scheme.c ++++ b/racket/src/ChezScheme/c/scheme.c +@@ -458,6 +458,12 @@ static IBOOL next_path(char *path, const char *name, const char *ext, const char + static const char *path_last(const char *path); + static char *get_defaultheapdirs(void); + ++#ifdef PATH_MAX ++# define BOOT_PATH_MAX PATH_MAX ++#else /* hack for Hurd: better to remove the restriction */ ++# define BOOT_PATH_MAX 4096 ++#endif ++ + static const char *path_last(const char *p) { + const char *s; + #ifdef WIN32 +@@ -483,7 +489,7 @@ static const char *path_last(const char *p) { + + static char *get_defaultheapdirs() { + char *result; +- wchar_t buf[PATH_MAX]; ++ wchar_t buf[BOOT_PATH_MAX]; + DWORD len = sizeof(buf); + if (ERROR_SUCCESS != RegGetValueW(HKEY_LOCAL_MACHINE, L"Software\\Chez Scheme\\csv" VERSION, L"HeapSearchPath", RRF_RT_REG_SZ, NULL, buf, &len)) + return DEFAULT_HEAP_PATH; +@@ -512,14 +518,14 @@ static char *get_defaultheapdirs() { + * leaving the full path with name affixed in path and *sp / *dsp pointing + * past the current entry. it returns 1 on success and 0 if at the end of + * the search path. path should be a pointer to an unoccupied buffer +- * PATH_MAX characters long. either or both of sp/dsp may be empty, ++ * BOOT_PATH_MAX characters long. either or both of sp/dsp may be empty, + * but neither may be null, i.e., (char *)0. */ + static IBOOL next_path(char *path, const char *name, const char *ext, + const char **sp, const char **dsp) { + char *p; + const char *s, *t; + +-#define setp(c) if (p >= path + PATH_MAX) { fprintf(stderr, "search path entry too long\n"); S_abnormal_exit(); } else *p++ = (c) ++#define setp(c) if (p >= path + BOOT_PATH_MAX) { fprintf(stderr, "search path entry too long\n"); S_abnormal_exit(); } else *p++ = (c) + for (;;) { + s = *sp; + p = path; +@@ -532,10 +538,10 @@ static IBOOL next_path(char *path, const char *name, const char *ext, + switch (*s) { + #ifdef WIN32 + case 'x': { +- wchar_t exepath[PATH_MAX]; DWORD n; ++ wchar_t exepath[BOOT_PATH_MAX]; DWORD n; + s += 1; +- n = GetModuleFileNameW(NULL, exepath, PATH_MAX); +- if (n == 0 || (n == PATH_MAX && GetLastError() == ERROR_INSUFFICIENT_BUFFER)) { ++ n = GetModuleFileNameW(NULL, exepath, BOOT_PATH_MAX); ++ if (n == 0 || (n == BOOT_PATH_MAX && GetLastError() == ERROR_INSUFFICIENT_BUFFER)) { + fprintf(stderr, "warning: executable path is too long; ignoring %%x\n"); + } else { + char *tstart; +@@ -608,7 +614,7 @@ typedef struct { + iptr len; /* 0 => unknown */ + iptr offset; + IBOOL need_check, close_after; +- char path[PATH_MAX]; ++ char path[BOOT_PATH_MAX]; + } boot_desc; + + #define MAX_BOOT_FILES 10 +@@ -695,14 +701,14 @@ static void finish_dependencies_header(int fd, const char *path, int c) { + static IBOOL find_boot(const char *name, const char *ext, IBOOL direct_pathp, + int fd, + IBOOL errorp) { +- char pathbuf[PATH_MAX], buf[PATH_MAX]; ++ char pathbuf[BOOT_PATH_MAX], buf[BOOT_PATH_MAX]; + uptr n = 0; + INT c; + const char *path; + char *expandedpath; + + if ((fd != -1) || direct_pathp || S_fixedpathp(name)) { +- if (strlen(name) >= PATH_MAX) { ++ if (strlen(name) >= BOOT_PATH_MAX) { + fprintf(stderr, "boot-file path is too long %s\n", name); + S_abnormal_exit(); + } +@@ -776,7 +782,7 @@ static IBOOL find_boot(const char *name, const char *ext, IBOOL direct_pathp, + if (boot_count == 0) { + for (;;) { + /* try to load heap or boot file this boot file requires */ +- if (get_string(fd, buf, PATH_MAX, &c) != 0) { ++ if (get_string(fd, buf, BOOT_PATH_MAX, &c) != 0) { + fprintf(stderr, "unexpected end of file on %s\n", path); + CLOSE(fd); + S_abnormal_exit(); +@@ -796,7 +802,7 @@ static IBOOL find_boot(const char *name, const char *ext, IBOOL direct_pathp, + c = get_u8(fd); + for (sep = " "; ; sep = "or ") { + if (c == ')') break; +- (void) get_string(fd, buf, PATH_MAX, &c); ++ (void) get_string(fd, buf, BOOT_PATH_MAX, &c); + fprintf(stderr, "%s%s.boot ", sep, buf); + } + fprintf(stderr, "required by %s\n", path); +@@ -1090,7 +1096,7 @@ extern void Sregister_boot_file_fd_region(const char *name, + int close_after) { + check_boot_file_state("Sregister_boot_file_fd"); + +- if (strlen(name) >= PATH_MAX) { ++ if (strlen(name) >= BOOT_PATH_MAX) { + fprintf(stderr, "boot-file path is too long %s\n", name); + S_abnormal_exit(); + } +@@ -1141,14 +1147,14 @@ extern void Sbuild_heap(const char *kernel, void (*custom_init)(void)) { + } + + name = path_last(kernel); +- if (strlen(name) >= PATH_MAX) { ++ if (strlen(name) >= BOOT_PATH_MAX) { + fprintf(stderr, "executable name too long: %s\n", name); + S_abnormal_exit(); + } + + #ifdef WIN32 + { /* strip off trailing .exe, if any */ +- static char buf[PATH_MAX]; ++ static char buf[BOOT_PATH_MAX]; + iptr n; + + n = strlen(name) - 4; +diff --git a/racket/src/ChezScheme/c/version.h b/racket/src/ChezScheme/c/version.h +index a79d12621b..61751a9fad 100644 +--- a/racket/src/ChezScheme/c/version.h ++++ b/racket/src/ChezScheme/c/version.h +@@ -80,7 +80,7 @@ FORCEINLINE void store_unaligned_uptr(uptr *addr, uptr val) { + /*****************************************/ + /* Operating systems */ + +-#if defined(__linux__) ++#if defined(__linux__) || defined(__GNU__) /* Hurd */ + #define NOBLOCK O_NONBLOCK + #define LOAD_SHARED_OBJECT + #define USE_MMAP +@@ -91,7 +91,10 @@ FORCEINLINE void store_unaligned_uptr(uptr *addr, uptr val) { + #define GETPAGESIZE() getpagesize() + typedef char *memcpy_t; + #define MAKE_NAN(x) { x = 0.0; x = x / x; } +-#define GETWD(x) getcwd((x),PATH_MAX) ++#ifndef __GNU__ /* Hurd: no PATH_MAX */ ++/* n.b. don't test PATH_MAX directly: we have not yet included */ ++# define GETWD(x) getcwd((x),PATH_MAX) ++#endif + typedef int tputsputcchar; + #ifndef __ANDROID__ + # define LOCKF +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index f64b639c3a..efdb6029cb 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -102,6 +102,11 @@ case "${CONFIG_UNAME}" in + installprefix=/usr + installmansuffix=share/man + ;; ++ GNU) ++ unixsuffix=gnu # the Hurd ++ installprefix=/usr ++ installmansuffix=share/man ++ ;; + QNX) + if uname -a | egrep 'x86' > /dev/null 2>&1 ; then + m32=i3qnx +@@ -591,7 +596,7 @@ fi + + # Infer flags needed for threads: + case "${flagsm}" in +- *le|*fb|*ob|*nb) ++ *le|*gnu|*fb|*ob|*nb) + threadFlags="-D_REENTRANT -pthread" + threadLibs="-lpthread" + ;; +@@ -627,7 +632,7 @@ if [ "$cflagsset" = "no" ] ; then + a6*) + CFLAGS="-m64 ${optFlags}" + ;; +- i3le) ++ i3le) # intentionally not including i3gnu, which may not support sse2 + CFLAGS="-m32 -msse2 -mfpmath=sse ${optFlags}" + ;; + i3nt) +@@ -688,7 +693,7 @@ fi + # Add automatic linking flags, unless suppressed by --disable-auto-flags + if [ "$addflags" = "yes" ] ; then + case "${flagsm}" in +- *le) ++ *le|*gnu) + LDFLAGS="${LDFLAGS} -rdynamic" + ;; + *fb|*nb) +@@ -702,7 +707,7 @@ if [ "$addflags" = "yes" ] ; then + esac + + case "${flagsm}" in +- *le) ++ *le|*gnu) + LIBS="${LIBS} -lm -ldl ${ncursesLib} -lrt" + ;; + *fb|*ob) +@@ -749,7 +754,7 @@ exeSuffix= + + # compile flags for c/Mf-unix and mats/Mf-unix + case "${flagsmuni}" in +- *le) ++ *le|*gnu) + mdcflags="-fPIC -shared" + ;; + *fb|*ob) +@@ -781,7 +786,7 @@ case "${flagsmuni}" in + i3le) + mdldflags="-melf_i386" + ;; +- *le) ++ *le|*gnu) + ;; + i3nb) + mdldflags="-m elf_i386" +diff --git a/racket/src/ChezScheme/s/cmacros.ss b/racket/src/ChezScheme/s/cmacros.ss +index ff2b09217b..2e79a4d8de 100644 +--- a/racket/src/ChezScheme/s/cmacros.ss ++++ b/racket/src/ChezScheme/s/cmacros.ss +@@ -385,6 +385,7 @@ + i3fb ti3fb + i3ob ti3ob + i3osx ti3osx ++ i3gnu ti3gnu + a6le ta6le + a6osx ta6osx + a6ob ta6ob +diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure +index 454d79e11a..dab545c0b4 100755 +--- a/racket/src/cs/c/configure ++++ b/racket/src/cs/c/configure +@@ -4449,8 +4449,15 @@ case "$host_os" in + ;; + irix*) + ;; +- linux*) +- MACH_OS=le ++ linux*|gnu*) ++ case "$host_os" in ++ *linux*) ++ MACH_OS=le ++ ;; ++ *) ++ MACH_OS=gnu # Hurd ++ ;; ++ esac + case "$host_os" in + *linux-android*) + ;; +@@ -4730,6 +4737,9 @@ if test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then + linux*) + BUILD_OS=le + ;; ++ gnu*) # Hurd: must come after linux* ++ BUILD_OS=gnu ++ ;; + *mingw*) + BUILD_OS=nt + ;; +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 5bce979c92..43e7307b1b 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -272,8 +272,15 @@ case "$host_os" in + ;; + irix*) + ;; +- linux*) +- MACH_OS=le ++ linux*|gnu*) ++ case "$host_os" in ++ linux*) ++ MACH_OS=le ++ ;; ++ *) ++ MACH_OS=gnu # Hurd ++ ;; ++ esac + case "$host_os" in + *linux-android*) + ;; +@@ -466,6 +473,9 @@ if test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then + linux*) + BUILD_OS=le + ;; ++ gnu*) # Hurd - must come after linux* ++ BUILD_OS=gnu ++ ;; + *mingw*) + BUILD_OS=nt + ;; +diff --git a/racket/src/cs/rumble/system.ss b/racket/src/cs/rumble/system.ss +index 2319cbe7a5..773eb79cf3 100644 +--- a/racket/src/cs/rumble/system.ss ++++ b/racket/src/cs/rumble/system.ss +@@ -48,6 +48,8 @@ + arm32le tarm32le arm64le tarm64le + ppc32le tppc32le) + 'linux] ++ [(i3gnu ti3gnu) ++ 'gnu-hurd] + [(a6fb ta6fb i3fb ti3fb + arm32fb tarm32fb arm64fb tarm64fb + ppc32fb tppc32fb) +@@ -85,6 +87,7 @@ + i3nb ti3nb + i3fb ti3fb + i3s2 ti3s2 ++ i3gnu ti3gnu + i3qnx) + 'i386] + [(arm32le tarm32le +-- +2.32.0 + + +From 8653294b771c741d320aba31e692b4f0ed0c702f Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Thu, 4 Aug 2022 20:18:09 -0400 +Subject: [PATCH 2/3] BC: Fix build on GNU/Hurd + +(cherry picked from commit 5c05496afd6159c2f9cd52e7f23389fdc6b55f43) +--- + racket/src/bc/configure | 2 +- + racket/src/bc/configure.ac | 2 +- + racket/src/bc/sconfig.h | 14 +++++++++----- + 3 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/racket/src/bc/configure b/racket/src/bc/configure +index 4ddb607b37..4ee346014d 100755 +--- a/racket/src/bc/configure ++++ b/racket/src/bc/configure +@@ -5018,7 +5018,7 @@ case "$host_os" in + X_PRE_LIBS="" + fi + ;; +- linux*) ++ linux*,gnu*) + LIBS="$LIBS -ldl -lm -lrt -rdynamic" + DYN_CFLAGS="-fPIC" + curses_portable_link="/usr/lib/${host_cpu}-${host_os}/libncurses.a /usr/lib/${host_cpu}-${host_os}/libtermcap.a" +diff --git a/racket/src/bc/configure.ac b/racket/src/bc/configure.ac +index deef8f3077..866851236e 100644 +--- a/racket/src/bc/configure.ac ++++ b/racket/src/bc/configure.ac +@@ -557,7 +557,7 @@ case "$host_os" in + X_PRE_LIBS="" + fi + ;; +- linux*) ++ linux*,gnu*) + LIBS="$LIBS -ldl -lm -lrt -rdynamic" + DYN_CFLAGS="-fPIC" + curses_portable_link="/usr/lib/${host_cpu}-${host_os}/libncurses.a /usr/lib/${host_cpu}-${host_os}/libtermcap.a" +diff --git a/racket/src/bc/sconfig.h b/racket/src/bc/sconfig.h +index 01ecb48158..8468942fcd 100644 +--- a/racket/src/bc/sconfig.h ++++ b/racket/src/bc/sconfig.h +@@ -79,12 +79,14 @@ + + #endif + +- /************** Linux with gcc ****************/ ++ /************** Linux (or Hurd) with gcc ****************/ + +-#if defined(__linux__) ++#if defined(__linux__) || defined(__GNU__) + + # ifdef __ANDROID__ + # define SCHEME_OS "android" ++# elif defined(__GNU__) ++# define SCHEME_OS "gnu-hurd" + # else + # define SCHEME_OS "linux" + # endif +@@ -146,13 +148,15 @@ + # define USE_IEEE_FP_PREDS + # define USE_EXPLICT_FP_FORM_CHECK + +-# define LINUX_FIND_STACK_BASE ++# define LINUX_FIND_STACK_BASE /* also ok for Hurd */ + + # define FLAGS_ALREADY_SET + + #if defined(__i386__) +-# define MZ_USE_JIT_I386 +-# define MZ_JIT_USE_MPROTECT ++# ifndef __GNU__ /* Hurd */ ++# define MZ_USE_JIT_I386 ++# define MZ_JIT_USE_MPROTECT ++# endif + # ifndef MZ_NO_UNWIND_SUPPORT + # define MZ_USE_DWARF_LIBUNWIND + # endif +-- +2.32.0 + + +From 1b0cd08557f58506c96f0ddd855bd9051a45a2f1 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Sat, 6 Aug 2022 22:48:40 -0400 +Subject: [PATCH 3/3] BC: repair configure script + +Hopefully this will fix the DrDr failures caused by 5c05496. + +Related to https://github.com/racket/racket/pull/4384 + +(cherry picked from commit c3dd01055ed7589a18136904510fe4db557d6e77) +--- + racket/src/bc/configure | 2 +- + racket/src/bc/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/racket/src/bc/configure b/racket/src/bc/configure +index 4ee346014d..b1c5175b84 100755 +--- a/racket/src/bc/configure ++++ b/racket/src/bc/configure +@@ -5018,7 +5018,7 @@ case "$host_os" in + X_PRE_LIBS="" + fi + ;; +- linux*,gnu*) ++ linux*|gnu*) + LIBS="$LIBS -ldl -lm -lrt -rdynamic" + DYN_CFLAGS="-fPIC" + curses_portable_link="/usr/lib/${host_cpu}-${host_os}/libncurses.a /usr/lib/${host_cpu}-${host_os}/libtermcap.a" +diff --git a/racket/src/bc/configure.ac b/racket/src/bc/configure.ac +index 866851236e..ecc3b0b579 100644 +--- a/racket/src/bc/configure.ac ++++ b/racket/src/bc/configure.ac +@@ -557,7 +557,7 @@ case "$host_os" in + X_PRE_LIBS="" + fi + ;; +- linux*,gnu*) ++ linux*|gnu*) + LIBS="$LIBS -ldl -lm -lrt -rdynamic" + DYN_CFLAGS="-fPIC" + curses_portable_link="/usr/lib/${host_cpu}-${host_os}/libncurses.a /usr/lib/${host_cpu}-${host_os}/libtermcap.a" +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-chez-scheme-bin-sh.patch b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch index df2eb671b3..69aca3b483 100644 --- a/gnu/packages/patches/racket-chez-scheme-bin-sh.patch +++ b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch @@ -1,4 +1,4 @@ -From 5f3fc12bf123f30485800960b0493f5dd538d107 Mon Sep 17 00:00:00 2001 +From 988eea0a875d570d8ec155cb0925b4586d36e8d7 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Thu, 19 May 2022 13:41:56 -0400 Subject: [PATCH] Chez Scheme: patch s_process for "/bin/sh" on Guix @@ -22,10 +22,10 @@ on `system` from the C library. 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c -index f5e3e345be..9db2989138 100644 +index 82bbf8d687..307c8673a1 100644 --- a/racket/src/ChezScheme/c/prim5.c +++ b/racket/src/ChezScheme/c/prim5.c -@@ -856,6 +856,22 @@ static ptr s_process(s, stderrp) char *s; IBOOL stderrp; { +@@ -861,6 +861,22 @@ static ptr s_process(char *s, IBOOL stderrp) { INT tofds[2], fromfds[2], errfds[2]; struct sigaction act, oint_act; @@ -48,10 +48,10 @@ index f5e3e345be..9db2989138 100644 if (pipe(tofds)) S_error("process","cannot open pipes"); if (pipe(fromfds)) { -@@ -881,7 +897,9 @@ static ptr s_process(s, stderrp) char *s; IBOOL stderrp; { - CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1); - CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1); - {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);} +@@ -897,7 +913,9 @@ static ptr s_process(char *s, IBOOL stderrp) { + } + } + #endif /* __GNU__ Hurd */ - execl("/bin/sh", "/bin/sh", "-c", s, NULL); + /* BEGIN PATCH for Guix */ + execl(guix_sh, guix_sh, "-c", s, NULL); @@ -60,7 +60,7 @@ index f5e3e345be..9db2989138 100644 /*NOTREACHED*/ } else { -base-commit: 9d228d16fb99c274c964e5bef93e97333888769f +base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 -- 2.32.0 diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 0c8b3b6bb8..31f3394fa3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -54,7 +54,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:)) -;; Commentary: +;; COMMENTARY: ;; ;; Anatomy of Racket: ;; ------------------ @@ -73,14 +73,16 @@ (define-module (gnu packages racket) ;; ├── bc/ ;; ├── cs/ ;; ├── ChezScheme/ +;; ├── zuo/ ;; └── ... ;; ;; The 'racket/src/' directory contains the source of the runtime system, core ;; compiler, and primitives for the major Racket implementations: this layer -;; is called the ``Racket VM''. It is basically a normal autotools -;; project. (Even when Racket VM implementations use components implemented in -;; Racket, they are compiled in special modes to produce VM primitives.) -;; (There are or have been experimental Racket VM implementations elsewhere, +;; is called the ``Racket VM''. It is basically a normal Autoconf project, +;; except that the makefiles just run Zuo to do the real work. (Even when +;; Racket VM implementations use components implemented in Racket, they are +;; compiled in special modes to produce VM primitives.) (There are or have +;; been experimental Racket VM implementations elsewhere, ;; e.g. .) ;; ;; The 'racket/collects/' directory contains ``built in'' Racket libraries @@ -101,10 +103,10 @@ (define-module (gnu packages racket) ;; ;; The top-level 'Makefile' is more like a directory of scripts: it has ;; convienience targets for developing Racket, and it cooperates with the -;; 'distro-build' package to assemble custom Racket distributions. It is not -;; part of Racket source distributions: the root of a source distribution is -;; basically 'racket/src' with some extra package sources and configuration -;; added. +;; 'distro-build' package to assemble custom Racket distributions. (Again, +;; the makefile just delegates to Zuo.) It is not part of Racket source +;; distributions: the root of a source distribution is basically 'racket/src' +;; with some extra package sources and configuration added. ;; ;; A ''minimal Racket'' installation includes two packages: 'base', which is a ;; sort of bridge between the current ``built-in'' collections and the package @@ -130,12 +132,12 @@ (define-module (gnu packages racket) ;; output. The function 'racket-vm-for-system' returns the recomended Racket ;; VM package for a given system. ;; -;; The file 'racket.scm' builds on these packages to define 'racket-minimal' -;; and 'racket' packages. These use Racket's support for ``layered -;; installations'', which allow an immutable base layer to be extended with -;; additional packages. They use the layer configuration directly provide -;; ready-to-install FHS-like trees, rather than relying on the built in -;; ``Unix-style install'' mechanism. +;; We then define the packages 'racket-minimal' and +;; 'racket'. These use Racket's support for ``layered installations'', which +;; allow an immutable base layer to be extended with additional packages. +;; They use the layer configuration directly provide ready-to-install FHS-like +;; trees, rather than relying on the built in ``Unix-style install'' +;; mechanism. ;; ;; Bootstrapping Racket: ;; --------------------- @@ -178,16 +180,18 @@ (define-module (gnu packages racket) ;; However, other Racket subsystems implemented in Racket for Racket CS ;; use older C implementations for Racket BC, whereas the reader, expander, ;; and module system were completely replaced with the Racket implementation -;; as of Racket 7.0. +;; as of Racket 7.0. See also . ;; ;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) ;; are embeded in C as a static string constant. Eventually, they are further ;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compiler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) ;; -;; Code: +;; Zuo is notably *not* a problem for bootstrapping. The implementation is a +;; single hand-written C file designed to build with just `cc -o zuo zuo.c`, +;; even with very old or limited compilers. (We use the Autoconf support for +;; convienience.) +;; +;; CODE: (define* (racket-vm-for-system #:optional (system (or (%current-target-system) @@ -200,7 +204,7 @@ (define* (racket-vm-for-system #:optional racket-vm-cs racket-vm-bc)) -(define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! +(define %racket-version "8.6") ; Remember to update chez-scheme-for-racket! (define %zuo-version "1.0") ; defined in racket/src/zuo/zuo.c (define %racket-commit (string-append "v" %racket-version)) @@ -211,10 +215,15 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) + (base32 "1yi36nr7zrdwrnvpmliirxxjz4pyfyhkar6yvk3rapvmg4q2vmnk")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-chez-scheme-bin-sh.patch" - "racket-rktio-bin-sh.patch")) + (patches (search-patches "racket-backport-8.6-cross-install.patch" + "racket-backport-8.6-docindex-write.patch" + "racket-backport-8.6-hurd.patch" + "racket-backport-8.6-zuo.patch" + "racket-chez-scheme-bin-sh.patch" + "racket-rktio-bin-sh.patch" + "racket-zuo-bin-sh.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -241,21 +250,10 @@ (define-public zuo (name "zuo") (version (string-append %zuo-version "-racket" - "8.6" + %racket-version (if revision "-guix" "") (or revision ""))) - (source - (origin - (inherit %racket-origin) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit "v8.6"))) - (sha256 - (base32 "1yi36nr7zrdwrnvpmliirxxjz4pyfyhkar6yvk3rapvmg4q2vmnk")) - (patches (append (origin-patches %racket-origin) - (search-patches "racket-backport-8.6-zuo.patch" - "racket-zuo-bin-sh.patch"))) - (file-name (git-file-name "racket" "8.6")))) + (source %racket-origin) (outputs '("out" "debug")) (build-system gnu-build-system) (inputs (list bash-minimal)) @@ -334,7 +332,8 @@ (define-public racket-vm-cgc (inputs (list ncurses ;; <- common to all variants (for #%terminal) bash-minimal ;; <- common to all variants (for `system`) libffi)) ;; <- only for BC variants - (native-inputs (list libtool)) ;; <- only for BC variants + (native-inputs (list zuo ;; <- for all variants + libtool)) ;; <- only for BC variants (outputs '("out" "debug")) (build-system gnu-build-system) (arguments @@ -342,6 +341,10 @@ (define-public racket-vm-cgc #:configure-flags #~(cons "--enable-cgcdefault" #$(racket-vm-common-configure-flags)) + #:make-flags + #~(list (string-append "ZUO=" + #+(this-package-native-input "zuo") + "/bin/zuo")) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main ;; distribution. @@ -701,25 +704,25 @@ (define-public racket "contract-profile" (base32 "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3") '(("contract-profile" "."))) (simple-racket-origin - "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") + "data" (base32 "08sj4m0g0cp7gwb0nq90m770f0c21b7ydif7nljc8rxmcdprfisc") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") '(("datalog" "."))) (simple-racket-origin - "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") + "db" (base32 "0jzsbfcdm3xj0g8xxw3ky2swrhiqqsq2aqa3r08m641dc981dmjq") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "0g8flr1qg3bcyhdinqhs4w7dyisaqyailbxrjgd2a7zlqmdyicfr") + "deinprogramm" (base32 "16ncs3ms3mmdavbk0mkhm2qi62vyyif9cch3sn1y64pij489x34v") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") '("distributed-places" "distributed-places-doc" "distributed-places-lib")) (simple-racket-origin - "draw" (base32 "1fpk85rs2crd63bxnmwj2pysisd62pxcqaip01si67dv1ri8ff92") + "draw" (base32 "00rq5y4ba6z1d6jh76kl8rwpxrlqqp81a875zyhk3k81i42635sm") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "0dipnz92c63zxys9z1kl5215rm7arc35g9r8bs8ivp96p75mljnz") + "drracket" (base32 "05d7wssi0ry13alb5hl3llpsg30dd0jhyfv5nb1nmg189fn42q62") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -736,7 +739,7 @@ (define-public racket "eopl" (base32 "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s") '(("eopl" "."))) (simple-racket-origin - "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") + "errortrace" (base32 "0r5630bb2d6hk0fbi95fmyfja54nnwdfcj2zjba124pp6xkjyavx") '("errortrace" "errortrace-doc" "errortrace-lib")) (simple-racket-origin "expeditor" (base32 "0mjfwb4wzwsg5xj3k6cmik0va432n56rp5h7rxx1c2yy3prh1j7q") @@ -753,13 +756,13 @@ (define-public racket "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") '(("games" "."))) (simple-racket-origin - "gui" (base32 "0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx") + "gui" (base32 "18pcnx3wi8f32i2frm8bn9pi08n4y3c5jgqs4gy21w6f84dv401w") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "19xqixrqbwdxph17w9jga19008j88harb5wgml4hpqj3x0apx9g3") + "htdp" (base32 "173xy6ks55npvwn6cykjs41s9qfb70hc2gfjiqvw91hdsbjykwir") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -783,7 +786,7 @@ (define-public racket "make" (base32 "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa") '(("make" "."))) (simple-racket-origin - "math" (base32 "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac") + "math" (base32 "00ld38in5jfshs1q4zf07w84cyv4yjr40kmw30pyd5wqgs2zq9ai") '("math" "math-doc" "math-lib")) (simple-racket-origin "mysterx" (base32 "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48") @@ -818,16 +821,16 @@ (define-public racket (git-file-name "stamourv-optimization-coach" %racket-version))) '(("optimization-coach" "."))) (simple-racket-origin - "option-contract" (base32 "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk") + "option-contract" (base32 "07cncg9pi15cm19k7rzv54vx83wq7y42i2m6bgzaqja1h8vnj2ww") '("option-contract" "option-contract-doc" "option-contract-lib")) (simple-racket-origin - "parser-tools" (base32 "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3") + "parser-tools" (base32 "04ycihliikh0c47ivp09gayxiql9d9wpl216czic19cj6f7rmcnj") '("parser-tools" "parser-tools-doc" "parser-tools-lib")) (simple-racket-origin "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "0v7a3l77swsbh80mnb9rakdwgw7s66ji0mall7qcqfwyg1b4zmlv") + "pict" (base32 "1n0v7kynkiin1v8igs9m8k8vfwjn5cswanhq2imp1pxzjvdyq6sx") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -881,7 +884,7 @@ (define-public racket "racklog" (base32 "0fbq0fpfb3l6h7h772dvkmlzlk2dnq5f8296xx1qxhhwypibqzr9") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "0vfwcddzrgrdv5awjka7m0jzqhqvfc5wlkih83a670y96496a83n") + "rackunit" (base32 "1gpz9sgnm8hrc0cb3rii0wzbcwp9mgy5k1amnxidy7gyzl7prn81") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -894,10 +897,10 @@ (define-public racket "readline" (base32 "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn") '("readline" "readline-doc" "readline-lib")) (simple-racket-origin - "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") + "realm" (base32 "0rlvwyd6rpyl0zda4a5p8dp346fvqzc8555dgfnrhliymkxb6x4g") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "18rn8ddsqh1s7hdlb2cb9wxln63bz0wysjssaf9v92r712xnnv8i") + "redex" (base32 "06dhyqmin0qdm6b6sdvgzpy3pa4svlw42ld9k2h1dxcr852czil7") '("redex" "redex-benchmark" "redex-doc" @@ -912,7 +915,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0fbb7xgz95y90247hfc1a19v7ry8m6blvv4y8irdgzhjvik70zb3") + "scribble" (base32 "0a11kvcnzp04mp4xxq68rkl09jv00hv81k2nmwkmwpfx9b2acvd3") '("scribble" "scribble-doc" "scribble-html-lib" @@ -944,7 +947,7 @@ (define-public racket "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "0z6bagp6qiw0i3slhvq035y5hqgq664xw3bdlvdayad0bgbg0mdc") + "typed-racket" (base32 "03wsz647fi58brbg33fw1xavp100gzfvngdy8bk7bdc0jfg8a18l") '("source-syntax" "typed-racket" "typed-racket-compatibility" @@ -955,13 +958,13 @@ (define-public racket "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "0b1ji31pv6bjb0a2bh9sqp5abvf91gn2rai8r4c4nkar1fzfwfac") + "string-constants" (base32 "1kg3vxq2hcd0vl76brgpzdwbrb65a4nrrkc6hj4az5lfbbdvqz47") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin - "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") + "swindle" (base32 "03n9ymjhrw45h7hxkw4nq8nidnvs9mfzb4228s2cjfaqbgqxvsyb") '(("swindle" "."))) (simple-racket-origin - "syntax-color" (base32 "17lb2403ymz6sflw4vs3gsh2y7kgsf0gn8sncsxjhi16rpj3a9vm") + "syntax-color" (base32 "02dcd4yvdnw35m3srvfd43csxffxw3j4rk6zi379b8dsvbbrjyq1") '("syntax-color" "syntax-color-doc" "syntax-color-lib")) (simple-racket-origin "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") @@ -970,7 +973,7 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "1g4x79ym3mgxv4f3z3z84j12355pf44pjlzlb7f0h6r0i7p0cbjd") + "web-server" (base32 "104lnzjykkd6f3gxpv7p14l94if6zac33nmb4sj5jxmd6r3fwcpf") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") From patchwork Thu Aug 11 11:08:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41561 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 A95A327BBEC; Thu, 11 Aug 2022 12:11:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 F208227BBE9 for ; Thu, 11 Aug 2022 12:11:22 +0100 (BST) Received: from localhost ([::1]:58418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65y-0002Al-4O for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64i-0000gH-VI for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64i-0005TK-Kv for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64i-0006Yu-GW for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 06/13] gnu: chez-scheme: Bootfiles should not be native inputs. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021615825053 (code B ref 57050); Thu, 11 Aug 2022 11:10:04 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:18 +0000 Received: from localhost ([127.0.0.1]:51837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63x-0006Vv-Oo for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:18 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:33409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63r-0006V7-KZ for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:12 -0400 Received: by mail-qk1-f181.google.com with SMTP id f14so13213402qkm.0 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=LPwoWqmZF2jIyAfy1wzTj3H5doONEMV1wg7yceTuFak=; b=cFFw+sYwQ/PtFfhpI+FjnFSDD1s2XGHq03fKiaSDxxnO1yvKEx3yXpK/Ab2eTafFBi XMRxml+4bsOl5KaMj9i1Iu6TJBQg/qaLppxXWBQb4oKRg718RRSzzNnHTLmD/oiIv7iL l+3ceUXrTi4cnSMEUXKljrXG/KVIp30C9CV8z1glmZsY4515+Ywag9BhC+Ytf/NZmf+a XrY3R/+C8Myn+yth4yhN9vqGFNW4DPw7iFx89Qowmi0N7Io1c/mHM8zYy5ybN9pDIbUt Ii6ot4CujIpkQ89R94B3vyovUjZdrjj46RcMiD+78t3waAAM2loljk/SZ+nJMZyOTwOW JKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=LPwoWqmZF2jIyAfy1wzTj3H5doONEMV1wg7yceTuFak=; b=xa/NB4meC25SdSd+xvjrFFhSgGEO54MnJPLXj9AMhlPIZ0ZJDM9MaVgoFZ2UpMLQ8I h8TXdh2uBTP3JrJMoOeRQZt0gJjydqTUkLelBubmze+P95v67uMy0n7rBfa9Sp/gUtqu tfJ7e/XzJ2x+E0KaRfGHFpN24gDHnQuHMBwR3dqPN/oj8+I9l4W1aRRtunSxT7Om8sBe KHV3Q4Ucp0qf6JO6LSeq/TNzlAkjsPINagapFuCNU1dtVSP9HZhoKL67OcRDiEds9Zbt aw85yRooh/GS1vKDkU0WfRQgcFxFDJ2LzBcM+pZGAfUHQEDf1+74LZn3X7GLoSI4Rcj+ xiYw== X-Gm-Message-State: ACgBeo2HtllWnoYV2Co/xv8Nqw9V6jHXHCZ+8qtz0rV8pkP8eTSKnUyY PfTlhfHa5mQK4gLHUL5YQxGVbj8JIPOlEycB X-Google-Smtp-Source: AA6agR45g7WRdPdTmvDRHOfGhS4wYnhcjwSw/Y/oASqCpaG1D4Eeje7nYFM17RuQYpASm+8rCFqXJA== X-Received: by 2002:a05:620a:4416:b0:6b6:8101:be81 with SMTP id v22-20020a05620a441600b006b68101be81mr24610901qkp.414.1660216146101; Thu, 11 Aug 2022 04:09:06 -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 k5-20020a05620a414500b006b9526cfe6bsm1771731qko.80.2022.08.11.04.09.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:05 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:16 -0400 Message-Id: <760b29c0cb071c142a637e538233a661ad4a5c87.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This makes a difference for cross-compilation. * gnu/packages/chez.scm (chez-scheme)[native-inputs]: Move 'chez-scheme-bootstrap-bootfiles' to ... [inputs]: ... this field. [arguments]<#:phases>: Update 'unpack-bootfiles' accordingly. (chez-scheme-for-racket)[native-inputs]: Move 'chez-scheme-for-racket-bootstrap-bootfiles' to ... [inputs]: ... this field. --- gnu/packages/chez.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dde2c22ca5..294edca1a4 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -294,6 +294,7 @@ (define-public chez-scheme (build-system gnu-build-system) (inputs (list + chez-scheme-bootstrap-bootfiles `(,util-linux "lib") ;<-- libuuid zlib lz4 @@ -302,8 +303,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list chez-scheme-bootstrap-bootfiles - chez-nanopass-bootstrap + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification @@ -342,7 +342,7 @@ (define-public chez-scheme (when (directory-exists? "boot") (delete-file-recursively "boot")) (copy-recursively - (search-input-directory (or native-inputs inputs) + (search-input-directory inputs "lib/chez-scheme-bootfiles") "boot"))) ;; NOTE: The custom Chez 'configure' script doesn't allow @@ -453,12 +453,12 @@ (define-public chez-scheme-for-racket (source #f) ; avoid problematic cycle with racket.scm (inputs (modify-inputs (package-inputs chez-scheme) - (delete "libx11" "util-linux:lib"))) + (delete "libx11" "util-linux:lib") + (replace "chez-scheme-bootstrap-bootfiles" + chez-scheme-for-racket-bootstrap-bootfiles))) (native-inputs (modify-inputs (package-native-inputs chez-scheme) - (append zuo) - (replace "chez-scheme-bootstrap-bootfiles" - chez-scheme-for-racket-bootstrap-bootfiles))) + (append zuo))) (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:out-of-source? _ #f) From patchwork Thu Aug 11 11:08:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41557 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 72E9F27BBEC; Thu, 11 Aug 2022 12:10:56 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 518A427BBEA for ; Thu, 11 Aug 2022 12:10:55 +0100 (BST) Received: from localhost ([::1]:57510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65W-0001LE-7O for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64i-0000fw-Jv for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64i-0005Pw-8t for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64i-0006Yn-4Z for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 07/13] gnu: chez-scheme-for-racket: Support cross-compilation. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021615725046 (code B ref 57050); Thu, 11 Aug 2022 11:10:04 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:17 +0000 Received: from localhost ([127.0.0.1]:51835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63x-0006Vt-8u for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:17 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:45983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63q-0006UA-Hd for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:11 -0400 Received: by mail-qk1-f170.google.com with SMTP id b2so455707qkh.12 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=HxhcUY+za+mNFpnCVDuQEKAH0aEVOhBTm4Rup5xFZAs=; b=elaofE0KfGyWS2UrVApjRQOoijzfAyFQWO/j+PPy/giBVcpwn81njhv3iTUkdj41Un DRqix2jZh24qul5DhgtjW79whxBCNSgmH36TDNBbdC/GwBRlDyW0mHKFgtOHNEb3bOhs C4P8apaAGc4FhJAvWHANM5VWpyoHde505uhq+N9YgmuqpLYFjI59f4Q/Dj6ljY6M90aj a9Zm/xSk3IuWCua+RMhMf70fX8qUFNLAHGEKGTpm7upJFvfhsJ92rYT4eZ4ed0sqxofa 4/zSdaKEOK156o3i0pc0Vh/GVKqtXz2rw18M1UdkT203iEuRsPtgNC+TO0FuYoKc3us3 jGWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=HxhcUY+za+mNFpnCVDuQEKAH0aEVOhBTm4Rup5xFZAs=; b=C1A+h1tZGtD3gEl0x+DhjJMXvK8cxqj4JpfHnuuwmurc5Yqj0i4VzYxRJxgsx73rji YHbdok5QQ2QZXzr2z5aAvshTXCEcXoJoex3bQ5UNcy9B/AYDq6P0C00tZ1Z5LNM7sa1B VDkMgqtCAnoBVze8sqp5ebf/w3sexgtlNrdwshj+ELk7JpCEtGqWYgkhL6pyDmUrvPCX kZyHjjbp6RqIo1go7Nhcx6AVAfMHzYM4Iwz0f92c7/nLNhaJEKGRU/Fbvut1HVSao+Xj aC+8Z25UskMVTETobuuuzXkRzpDIME47ZeamwFHn2+jVdhdgiqqfudY0InMosnQ75ugN aqGQ== X-Gm-Message-State: ACgBeo3cvoomJVeSU2hsqjdKVVOwHSAfpkCYhW2cakXr+zh8QMIPKhtz DN6X1GU394GIt7RqFwCuArC5aO/U44BgizE1 X-Google-Smtp-Source: AA6agR6JP8y6PUP2QeZsMgYom0TNGfmcfYsv2r1YeOLT4rL7c99+vHWb0RFdkuFlHzjaNFRVV8+nfw== X-Received: by 2002:a05:620a:4411:b0:6b9:aded:c992 with SMTP id v17-20020a05620a441100b006b9adedc992mr4329312qkp.107.1660216150112; Thu, 11 Aug 2022 04:09:10 -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 v17-20020a05620a441100b006b5e5ebfff8sm1696670qkp.62.2022.08.11.04.09.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:09 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:17 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/chez.scm (racket-cs-native-supported-system): Change to return the applicable machine type instead of '#t'. (chez-scheme-for-racket)[native-inputs]: When cross-compiling, add 'this-package'. [arguments]<#:configure-flags>: When cross-compiling, supply '-m=' and '--toolprefix='. <#:phases>: Work around cross-compilation issues in 'build' and 'install-docs'. (chez-scheme-for-racket-bootstrap-bootfiles): When cross-compiling, use 'zuo' and 'chez-scheme-for-racket' instead of 'racket-vm-bc'. [arguments]<#:phases>: Adapt 'build' phase for cross-compilation. --- gnu/packages/chez.scm | 85 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 15 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 294edca1a4..be9884b3d2 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -236,14 +236,15 @@ (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." + "Can Racket's variant of Chez Scheme generate native code for SYSTEM? If +so, return the applicable machine type as a string. Otherwise, when SYSTEM +can use only the ``portable bytecode'' backends, return #f." (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))) + (string-append "t" chez-arch chez-os)))) ;; ;; Chez Scheme: @@ -457,8 +458,12 @@ (define-public chez-scheme-for-racket (replace "chez-scheme-bootstrap-bootfiles" chez-scheme-for-racket-bootstrap-bootfiles))) (native-inputs - (modify-inputs (package-native-inputs chez-scheme) - (append zuo))) + (let ((native-inputs (modify-inputs (package-native-inputs chez-scheme) + (append zuo)))) + (if (%current-target-system) + (modify-inputs native-inputs + (append this-package)) + native-inputs))) (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:out-of-source? _ #f) @@ -472,6 +477,15 @@ (define-public chez-scheme-for-racket ((#:configure-flags cfg-flags #~'()) #~`("--disable-x11" "--threads" ;; ok to potentially duplicate + #$@(if (%current-target-system) + (list (string-append "-m=" + (racket-cs-native-supported-system?))) + '()) + #$@(if (%current-target-system) + (list (string-append "--toolprefix=" + (%current-target-system) + "-")) + '()) ,@(let* ((chez+version (strip-store-file-name #$output)) (doc-prefix (assoc-ref %outputs "doc")) (doc-dir (string-append doc-prefix @@ -494,18 +508,42 @@ (define-public chez-scheme-for-racket #$mk-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) - (unpack (assoc-ref those-phases 'unpack))) + (gnu:unpack (assoc-ref those-phases 'unpack)) + (gnu:build (assoc-ref those-phases 'build))) (modify-phases those-phases + (replace 'build + ;; need to override target for cross-compilation + ;; https://racket.discourse.group/t/950/19 + (lambda* (#:key target (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (gnu:build #:make-flags (if target + (cons "kernel" make-flags) + make-flags) + #:parallel-build? parallel-build?))) (replace 'install-docs - (lambda* (#:key make-flags #:allow-other-keys) + (lambda* (#:key native-inputs (make-flags '()) + #:allow-other-keys) + ;; The tests for 'native-inputs' are cross-compilation + ;; workarounds that would be better to address upstream: + ;; see . + (when native-inputs + (substitute* "Makefile" + (("install-docs: build \\$[(]ZUO[)]") + "install-docs: $(ZUO)"))) (apply invoke "make" "install-docs" - make-flags))) + (if native-inputs + (cons (string-append + "Scheme=" + (search-input-file native-inputs + "/bin/scheme")) + make-flags) + make-flags)))) (replace 'unpack (lambda args - (unpack #:source #$(or (package-source this-package) - (package-source racket-vm-bc))))) + (gnu:unpack #:source #$(or (package-source this-package) + (package-source racket-vm-bc))))) (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) @@ -587,8 +625,12 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (name "chez-scheme-for-racket-bootstrap-bootfiles") (version (package-version chez-scheme-for-racket)) (source #f) ; avoid problematic cycle with racket.scm - (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - ;; TODO: cross compilation + (native-inputs + (cons* chez-nanopass-bootstrap + (if (%current-target-system) + (list zuo + chez-scheme-for-racket) + (list racket-vm-bc)))) (arguments (substitute-keyword-arguments (package-arguments chez-scheme-bootstrap-bootfiles) @@ -608,9 +650,22 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles #$unpack-nanopass+stex)) (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt")))))))) + #$(cond + ((%current-target-system) + ;; cross-compiling + #~(invoke + (search-input-file (or native-inputs inputs) + "/bin/zuo") + "makefiles/boot.zuo" + (search-input-file (or native-inputs inputs) + "/bin/scheme") + #$(racket-cs-native-supported-system?))) + (else + ;; bootstrapping + #~(invoke + (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt")))))))))) (supported-systems (package-supported-systems chez-scheme-for-racket)) (home-page "https://github.com/racket/ChezScheme") From patchwork Thu Aug 11 11:08:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41562 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 0542827BBE9; Thu, 11 Aug 2022 12:11:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 3FD1827BBEA for ; Thu, 11 Aug 2022 12:11:23 +0100 (BST) Received: from localhost ([::1]:58444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65y-0002Bn-DV for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64j-0000gp-9d for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64i-0005Vf-Vx for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64i-0006Z2-S0 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 08/13] gnu: racket: Support cross-compiling the VM packages. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021616325072 (code B ref 57050); Thu, 11 Aug 2022 11:10:04 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:23 +0000 Received: from localhost ([127.0.0.1]:51840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM643-0006WJ-5X for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:23 -0400 Received: from mail-qv1-f47.google.com ([209.85.219.47]:34772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63z-0006Vp-Mz for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:20 -0400 Received: by mail-qv1-f47.google.com with SMTP id u8so13075572qvv.1 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=tN4aDTA3DHwgyJpiQzTQ+7Aqun8FzI4rNB2Y5gBAwLE=; b=dXuR+KBv0Uk1TSHCYIcBPbuqY2dYLXkZrKFpRFffn1usUWmSSRhsvNdoZSsob1TSOb Bax7Q5zrGSi6DDDvT+fLbcHit65/Sciv3mKlI/+QfW9Ed04ITPD8KWVatv5PFwMXugV+ u360CLX+BV3DsDM2NmK/oAbdyJOHAvpstBDSG5W1Ot5egJuwSfwqcygz7ewlQOmRH6OL WwyFnMxVMDv4UfZYHCYj4IUHMw1TP6BWKPN19YbEqiSduwRSEr/kpFlMVcvw7VZ/QEej ZerK4gus9HCcERdHaZ4rXZoXFKLb9bvQ6G6I+n9nPh8wWeU+pXB+7+jnNffhEfPmMgQF NfRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=tN4aDTA3DHwgyJpiQzTQ+7Aqun8FzI4rNB2Y5gBAwLE=; b=rn4Mpr2dyN1xqtgIkL5ThMLqKP9sSkvrFJ/RpySRXvZ8UxwAneJYNAr86WR3Glb4x8 L7XkgPP2g2mISM5HY1YjXQGc2eHTljI8Z7U0cs9DjSu3GDEkkpKOCKgd/AuvwB2KRZh1 7QiLclQ+7o8sPVYu5PNFmWOB5xKlHodJ/g4pDZ0KwepkbMH/tg1xyPya/5m4ussKa6hM vhTEQTGuJgGO1wOR8P+4PbI4COPe4xFjYjUT3pBCk3MqbpVMYAY1lXGUfIPyb8qA3bMu pp/XHT4lIj0tdNPDTNQAl9xtn+dD1rH9AhWWf4V3pISNWKE8+Ex6IFdKZmSdbs5S2Qx3 9uGw== X-Gm-Message-State: ACgBeo2IyKZykmcre16oSlt3HpsJ1FXWtxQHjs63eYeZeO8O6aVREB3V hFVWl6HXeJV23PpVFstTqYIOc/pNOx4bSsgg X-Google-Smtp-Source: AA6agR5nNGiGVf1xhLvSqFg8D/i6vkSo+/whoqNE9OSWfaaMsPdEmtPMHkH7l7lp9y4C27tJAmXIHQ== X-Received: by 2002:a05:6214:268c:b0:474:8351:5803 with SMTP id gm12-20020a056214268c00b0047483515803mr28150001qvb.23.1660216154236; Thu, 11 Aug 2022 04:09:14 -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 fv14-20020a05622a4a0e00b00342fb07944fsm1505139qtb.82.2022.08.11.04.09.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:14 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:18 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Cross-compilation works for 'racket-vm-cgc', 'racket-vm-bc', and 'racket-vm-cs'. These changes are not enough to cross-compile 'racket-minimal' or 'racket': that would require building and loading cross-compilation pluggins for 'racket-vm-cs', which will be much easier once we can build the package 'raco-cross'. * gnu/packages/racket.scm (racket-vm-cgc): Add 'this-package' when cross-compiling. (racket-vm-bc)[native-inputs]: Adjust accordingly. (racket-vm-cs)[native-inputs]: Use 'racket-vm-cs' instead of 'racket-vm-bc' when cross-compiling. Adapt to changes to 'racket-vm-cgc'. [arguments]<#:configure-flags>: Fix '--enable-scheme' for cross-compilation. --- gnu/packages/racket.scm | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 31f3394fa3..ef353103d6 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -332,8 +332,11 @@ (define-public racket-vm-cgc (inputs (list ncurses ;; <- common to all variants (for #%terminal) bash-minimal ;; <- common to all variants (for `system`) libffi)) ;; <- only for BC variants - (native-inputs (list zuo ;; <- for all variants - libtool)) ;; <- only for BC variants + (native-inputs (cons* zuo ;; <- for all variants + libtool ;; <- only for BC variants + (if (%current-target-system) + (list this-package) + '()))) (outputs '("out" "debug")) (build-system gnu-build-system) (arguments @@ -421,8 +424,10 @@ (define-public racket-vm-bc (inherit racket-vm-cgc) (name "racket-vm-bc") (native-inputs - (modify-inputs (package-native-inputs racket-vm-cgc) - (prepend racket-vm-cgc))) + (if (%current-target-system) + (package-native-inputs racket-vm-cgc) + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc)))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) @@ -452,11 +457,17 @@ (define-public racket-vm-cs (prepend zlib lz4) (delete "libffi"))) (native-inputs - (modify-inputs (package-native-inputs racket-vm-cgc) - (delete "libtool") - (prepend chez-scheme-for-racket - chez-nanopass-bootstrap - racket-vm-bc))) + (let ((native-inputs (package-native-inputs racket-vm-cgc))) + (modify-inputs (if (%current-target-system) + (modify-inputs native-inputs + (delete "racket-vm-cgc")) + native-inputs) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + (if (%current-target-system) + racket-vm-cs + racket-vm-bc))))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:phases those-phases #~%standard-phases) @@ -470,7 +481,7 @@ (define-public racket-vm-cs "--enable-libz" "--enable-lz4" (string-append "--enable-scheme=" - #$(this-package-native-input + #+(this-package-native-input "chez-scheme-for-racket") "/bin/scheme") #$(racket-vm-common-configure-flags))))) From patchwork Thu Aug 11 11:08:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41559 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 62B8A27BBEA; Thu, 11 Aug 2022 12:11:01 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 86B6E27BBE9 for ; Thu, 11 Aug 2022 12:10:58 +0100 (BST) Received: from localhost ([::1]:57752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65Z-0001VR-M6 for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64j-0000hd-Pt for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64j-0005Yk-DS for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64j-0006Z9-8I for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 09/13] gnu: chez-scheme-for-racket: Suport all systems. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021616725094 (code B ref 57050); Thu, 11 Aug 2022 11:10:05 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:27 +0000 Received: from localhost ([127.0.0.1]:51843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM646-0006WZ-GV for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:27 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:35780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM644-0006W8-1K for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:24 -0400 Received: by mail-qt1-f182.google.com with SMTP id h22so7730062qtu.2 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=7MKC3/Pnu/mtp7H3lV/Zz0rLWbz6x5gR+yWAVKjusII=; b=gRwGIXNJmuv/T+l9JguzlEjFYOw1Vw7SW92udkr8uwQYEbG3RQTQ+CSUJy/Lz76Vt1 xIcePTfQsRdNA/9ImyzXGEWDGPusc/VjBYuxiHgJEt7pCmVvcwvgRUvE6RjEgu9tD5ga UlP1noryHHUteXzr3cpabLbJ0ttzZqc5IVaOtq3eNsZ/9bAJT32owngaSzX023u14Uwr AmZxScM2tn0BlV/EfgNA++p7pTeduBz//dQJJhiNWLKXb+3+J+dg3HdDZamq3+zhQNsz sFRc9KpogUtwLrgSAwOQbAz/RQhR0tORT5L/biiqmLH72REoemKwEwVtcLknMlocOzYj VvHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=7MKC3/Pnu/mtp7H3lV/Zz0rLWbz6x5gR+yWAVKjusII=; b=W2Sesz/Z4PNVEthuzUVUQueSBpVCD0d575q5dU4zD2O31MVBtpqBM/l6DdOR0Dx+nI KWcuV1KisOEIoqcTwmX6YFhspQ2HWGCXaNvBj/LKvOB8ZvKsTFQmYmC6yGxsWUGKGFgK KIbwO4BSqLeXUUzbX7t72BAtjMVdGOZzr2XwA8299b3LWbEZkz2rTT5MdPJHqbcSyH+R 8dFdYqa878B2fU7FNc+OJqczJnNrfNVbjQ2bvxxKIfIqwRBXSA2kY8M55CZ5V5HszzCA HulvkMx6lBfRS8+a35kCMGN1df9nNyDWjADbUhaRpGkbwMJpkTqRvatPQETjLzMdwSvR aztA== X-Gm-Message-State: ACgBeo1r9El/qBfdDkiNQEFCNBAdb8Zs843to4HqWSu485NsrqZEVq5u R4BPb7pftgisrCwAIOnQ45/qgoC7S2fiBXDh X-Google-Smtp-Source: AA6agR4WBvPesoFHfZb1O9SVRjXkmWFUZsi+h+XbDuOYmzefXW06za+olp+lPhyrYWf3l3vqEfpAMg== X-Received: by 2002:ac8:57d2:0:b0:31f:1f3:b3ec with SMTP id w18-20020ac857d2000000b0031f01f3b3ecmr28000425qta.214.1660216158474; Thu, 11 Aug 2022 04:09:18 -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 u8-20020ac87508000000b0031e9ab4e4cesm1480985qtq.26.2022.08.11.04.09.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:18 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:19 -0400 Message-Id: <4d63cf22559de641440810e451b9366aa6091774.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches On systems for which Racket's variant of Chez Scheme cannot generate native code, it can use a 'pbarch' machine type: a variant of the ``portable bytecode'' backend specialized to word size and endianness. This allows Racket CS to replace Racket BC on those systems while maintaining comparable performance. (Racket BC lacks JIT support for those systems anyway.) It also lets us provide a Chez Scheme package on all systems Guix supports. This patch adds 'pbarch' support to both 'chez-scheme-for-racket' and 'racket-vm-cs', but it does not change the Racket VM implementation used for the 'racket' and 'racket-minimal' packages. * gnu/packages/chez.scm (nix-system->pbarch-machine-type): New variable. (chez-scheme-for-racket)[inputs]: Use 'libffi' for non-native systems. [arguments]<#:configure-flags>: Always supply '-m='. Add applicable flags for non-native systems. [supported-systems]: Use '%supported-systems'. [description]: Update. (chez-scheme-for-racket-bootstrap-bootfiles)[arguments]<#:phases>: Adapt 'build' phase for non-native systems. * gnu/packages/racket.scm (racket-vm-bc)[description]: Update. (racket-vm-cs)[description]: Likewise. [inputs]: Use 'libffi' for non-native systems. [arguments]<#:configure-flags>: Add applicable flags for non-native systems. --- gnu/packages/chez.scm | 76 ++++++++++++++++++++++++++++++----------- gnu/packages/racket.scm | 26 +++++++++----- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index be9884b3d2..38b724ae5f 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -38,6 +38,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages netpbm) #:use-module (gnu packages racket) @@ -50,6 +51,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system racket-cs-native-supported-system? + nix-system->pbarch-machine-type unpack-nanopass+stex)) ;; Commentary: @@ -232,6 +234,28 @@ (define* (chez-upstream-features-for-system #:optional (and=> (assoc-ref %chez-features-table chez-os) (cut assoc-ref <> chez-arch)))) +(define* (nix-system->pbarch-machine-type #:optional + (system + (or (%current-target-system) + (%current-system))) + #:key (threads? #t)) + "Return a string naming the pseudo–machine type used by Racket's variant of +Chez Scheme to represent the appropriate ``pbarch'' backend for SYSTEM: that +is, the ``portable bytecode'' backend specialized for SYSTEM's word size and +endianness. The result will name the threaded machine type unless THREADS? is +provided and is #f." + (string-append (if threads? + "t" + "") + "pb" + (if (target-64bit? system) + "64" + "32") + ;; missing (guix utils) predicate target-little-endian? + (if (target-ppc32? system) + "b" + "l"))) + (define* (racket-cs-native-supported-system? #:optional (system (or (%current-target-system) @@ -453,10 +477,14 @@ (define-public chez-scheme-for-racket ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm (inputs - (modify-inputs (package-inputs chez-scheme) - (delete "libx11" "util-linux:lib") - (replace "chez-scheme-bootstrap-bootfiles" - chez-scheme-for-racket-bootstrap-bootfiles))) + (let ((inputs (modify-inputs (package-inputs chez-scheme) + (replace "chez-scheme-bootstrap-bootfiles" + chez-scheme-for-racket-bootstrap-bootfiles) + (delete "libx11" "util-linux:lib")))) + (if (racket-cs-native-supported-system?) + inputs + (modify-inputs inputs + (append libffi))))) (native-inputs (let ((native-inputs (modify-inputs (package-native-inputs chez-scheme) (append zuo)))) @@ -477,10 +505,16 @@ (define-public chez-scheme-for-racket ((#:configure-flags cfg-flags #~'()) #~`("--disable-x11" "--threads" ;; ok to potentially duplicate - #$@(if (%current-target-system) - (list (string-append "-m=" - (racket-cs-native-supported-system?))) - '()) + #$(string-append "-m=" (or (racket-cs-native-supported-system?) + (nix-system->pbarch-machine-type))) + ;; ^ could skip -m= for non-cross non-pbarch builds + #$@(if (racket-cs-native-supported-system?) + #~() + ;; not inferred on non-native platforms: see + ;; https://racket.discourse.group/t/950/9 + #~("--enable-libffi" + "CFLAGS=-g -O2 -D_REENTRANT -pthread" + "LIBS=-lm -ldl -lrt -lffi -lncurses")) #$@(if (%current-target-system) (list (string-append "--toolprefix=" (%current-target-system) @@ -547,10 +581,7 @@ (define-public chez-scheme-for-racket (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) - ;; 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)) + (supported-systems %supported-systems) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, ;; but it's designed to be a friendly landing place for people @@ -563,13 +594,17 @@ (define-public chez-scheme-for-racket Main additions to Chez Scheme in the Racket variant: @itemize @bullet @item -AArch64 support +AArch64 code generation @item -Portable bytes (@code{pb}) support, which is mainly useful for bootstrapping -a build on any supported platform +Portable bytecode (@code{pb}) mode, which is mainly useful for bootstrapping a +build on any platform, but can also be used on platforms without native-code +generation, compiled via Emscripten, linked with @code{libffi}, or used with +bytecode partially compiled to C @item Unboxed floating-point arithmetic and flvectors @item +Faster multiplication and division for large exact numbers +@item Type reconstruction during optimization (especially for safe code) @item Continuation attachments @@ -580,8 +615,6 @@ (define-public chez-scheme-for-racket @item Ordered finalization, immobile (but collectable) objects, weak/ephemeron generic hash tables, and reference bytevectors -@item -Faster multiplication and division for large exact numbers @end itemize") (license asl2.0))) @@ -659,13 +692,18 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles "makefiles/boot.zuo" (search-input-file (or native-inputs inputs) "/bin/scheme") - #$(racket-cs-native-supported-system?))) + #$(or (racket-cs-native-supported-system?) + (nix-system->pbarch-machine-type)))) (else ;; bootstrapping #~(invoke (search-input-file (or native-inputs inputs) "/opt/racket-vm/bin/racket") - "rktboot/main.rkt")))))))))) + "rktboot/main.rkt" + #$@(if (racket-cs-native-supported-system?) + #~() + (let ((m (nix-system->pbarch-machine-type))) + #~("--machine" #$m))))))))))))) (supported-systems (package-supported-systems chez-scheme-for-racket)) (home-page "https://github.com/racket/ChezScheme") diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ef353103d6..3b96cf46ef 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -331,7 +331,7 @@ (define-public racket-vm-cgc (source %racket-origin) (inputs (list ncurses ;; <- common to all variants (for #%terminal) bash-minimal ;; <- common to all variants (for `system`) - libffi)) ;; <- only for BC variants + libffi)) ;; <- for BC and non-native CS variants (native-inputs (cons* zuo ;; <- for all variants libtool ;; <- only for BC variants (if (%current-target-system) @@ -437,10 +437,8 @@ (define-public racket-vm-bc (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). It is the recommended implementation for architectures -that Racket CS doesn't support. +platforms. Racket BC has a different C API than the current default runtime +system, Racket CS (based on ``Chez Scheme''). This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'').") @@ -453,9 +451,12 @@ (define-public racket-vm-cs (inherit racket-vm-bc) (name "racket-vm-cs") (inputs - (modify-inputs (package-inputs racket-vm-cgc) - (prepend zlib lz4) - (delete "libffi"))) + (let ((inputs (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4)))) + (if (racket-cs-native-supported-system?) + (modify-inputs inputs + (delete "libffi")) + inputs))) (native-inputs (let ((native-inputs (package-native-inputs racket-vm-cgc))) (modify-inputs (if (%current-target-system) @@ -484,12 +485,19 @@ (define-public racket-vm-cs #+(this-package-native-input "chez-scheme-for-racket") "/bin/scheme") + #$@(if (racket-cs-native-supported-system?) + #~() + #~(#$(string-append "--enable-mach=" + (nix-system->pbarch-machine-type)) + "--enable-pb")) #$(racket-vm-common-configure-flags))))) (synopsis "Racket CS implementation") (description "The Racket CS implementation, which uses ``Chez Scheme'' as its core compiler and runtime system, has been the default Racket VM implementation since Racket 8.0. It performs better than the Racket BC -implementation for most programs. +implementation for most programs. On systems for which Racket CS cannot +generate machine code, this package uses a variant of its ``portable +bytecode'' backend specialized for word size and endianness. Using the Racket VM packages directly is not recommended: instead, install the @code{racket-minimal} or @code{racket} packages.") From patchwork Thu Aug 11 11:08:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41558 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 E113C27BBEA; Thu, 11 Aug 2022 12:11:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 D090727BBEC for ; Thu, 11 Aug 2022 12:10:58 +0100 (BST) Received: from localhost ([::1]:57724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65Z-0001UB-W9 for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64k-0000j8-IH for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64k-0005Zf-64 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64k-0006ZO-1q for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 10/13] gnu: racket-vm-bc: Add workaround for ppc64le. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021617125123 (code B ref 57050); Thu, 11 Aug 2022 11:10:06 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:31 +0000 Received: from localhost ([127.0.0.1]:51849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64A-0006X4-Pm for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:31 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:33598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM647-0006WI-TJ for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:28 -0400 Received: by mail-qt1-f176.google.com with SMTP id cb8so410823qtb.0 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=pQTxR4LDTZDlUrUtPMMBXtDWDwJ3UyRNwmWmjO5ITMg=; b=kEKeFQHOR/kvVShrTxnHp37gL+c6D32BwAmh/jrDQApjTlUtlduBhWLvGRK9u34fiu e/Z9epw4dDWFZl3yeWMUq0s3iUvXk9Gwjy5gkFL4JEOfbh8cGOpSmYpL/T+w2KzwNyac A1VZucNeiVGe4hmgKph+Deltj+4qAMRQA1Gx5T06EomHZpXpl/h3CedXL7mTxeJ/u0mZ uWA4T+C52UdQhuZ9qSC72F+VGyQ91EC3Wv8AF9FkXDxt9ks/4iOmkxoJVIYvXD5Gfzti w4wC1rZCuxSYEl6NDvYAUOFJzzp/69Zsm0QtmqbRyGSBa+Y6C/XeedtGYk2bPYnbH844 5y9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=pQTxR4LDTZDlUrUtPMMBXtDWDwJ3UyRNwmWmjO5ITMg=; b=vrIUKTXHDoaWCJUu640P0gtxtOj6dBzxim3gLRfYw2/4iTIOmM31WQzJQyb07DPNdF bkFP2TcaK/CZ/a+bnmfo1FESP9EgW6Gb6gME3/yI1PHY4ad9cjRDyvzGxFeENh6Bza9d ZTvNJ7LIvmp2A0iSE8+ws3KE0UgVul/dNCb2ybpA+SXRguBc4d7UbCgH2rDiYclvOaEV SIvzO4IOm1l6opLdSJkiPxH7b0wHErqr06aNPH8ECkwv6s+s0Gh3C83CKPDP1vx8bOeO EmdPe3D2ua9L4Sxsa82B91DfYYJInI26h9mi5k6OFhC93R9UR+eUlTun65zSQ4ZFXfeF 3Htg== X-Gm-Message-State: ACgBeo2OYsVCAKn0bugY4BDKimg/cpdf2cqOdPa3HAjYATpPm5yeTNbH Fll44zgLAxodSc1mU7cXMsuAhi0vXzMzhdWF X-Google-Smtp-Source: AA6agR70FXyIEqHUxAi8KLmqS9ctKwc1LshvMtNJ1w8hgAeRJgDAN4QUDqiE4U3Jz/4DHPQKJXN2Dg== X-Received: by 2002:a05:622a:44:b0:31e:d448:8746 with SMTP id y4-20020a05622a004400b0031ed4488746mr27925409qtw.664.1660216162430; Thu, 11 Aug 2022 04:09:22 -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 v6-20020a05620a0f0600b006af10bd3635sm1913526qkl.57.2022.08.11.04.09.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:22 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:20 -0400 Message-Id: <7421f7c6769f500334adeffae9a61d7b5d2e7cf0.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This is an attempt to avoid a problem with Racket BC on ppc64 reported in that was exposed by attempting to use Racket BC to bootstrap Chez Scheme. Thanks to Matthew Flatt for the workaround: . * gnu/packages/racket.scm (racket-vm-bc)[arguments]<#:configure-flags>: Increase the number of bytes that should be available on the stack for "safety" when checking for stack overflow. --- gnu/packages/racket.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3b96cf46ef..008adcc072 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -432,7 +432,20 @@ (define-public racket-vm-bc (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))))) + #$(cond + ((target-ppc64le?) + ;; Attempt to avoid a problem bootstrapping Chez Scheme: + ;; see + ;; and . + #~(map + (lambda (flag) + (if (string-prefix? "CPPFLAGS=" flag) + (string-append flag + " -DSTACK_SAFETY_MARGIN=200000") + flag)) + #$(racket-vm-common-configure-flags))) + (else + (racket-vm-common-configure-flags))))))) (synopsis "Racket BC [3M] implementation") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written From patchwork Thu Aug 11 11:08:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41554 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 BCD3527BBED; Thu, 11 Aug 2022 12:10:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 E8BD527BBEA for ; Thu, 11 Aug 2022 12:10:20 +0100 (BST) Received: from localhost ([::1]:56772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM64y-0000kR-2E for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64k-0000iK-4Z for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64j-0005Z9-QA for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64j-0006ZG-M3 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 11/13] gnu: racket: Use Racket CS on all systems. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021617125117 (code B ref 57050); Thu, 11 Aug 2022 11:10:05 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:31 +0000 Received: from localhost ([127.0.0.1]:51847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64A-0006X1-CN for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:30 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:33409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM646-0006V7-QR for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:27 -0400 Received: by mail-qk1-f181.google.com with SMTP id f14so13213845qkm.0 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=cAlwoSnviEUTVlhOjMlaO48NpqwtNpELKoMUv7d4ars=; b=hVXrNLC7JIOrZcmVt1ttFUhtgMEw3z3b3ssbz6W9SFhZmpCoKJKbVtWStD0fE2C+Jv pSDCxBxKbyT5AdtQRL2n1crn2HeeFcyEVZMjNuHQhAlI0+ga9J5bT17dmC8XjbruZx3m PcvrgtsaQyiMx+q9Q3kWwfcx8ksRaqv+XPTySnS7OyBW4U87/7AcSEYxiBoALxIiddzf NfE2aP3RWmpCayp1h3c0iRP5aOuBG7fdJ53DAZy29qCg2rzoJZhPKXHgrcV2UQTw3wPF g98aq5+tHb0Ptha8FRUoRULKFUYaoqndcWOPF45RD2ElLGbnjlCm0xCxTrfpB8x8ps2q sNkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=cAlwoSnviEUTVlhOjMlaO48NpqwtNpELKoMUv7d4ars=; b=L2bAb+4cUY9JYfORITutnem+qzgr2tLjyiYOu3/eRohg+gorEBYYFO5mG1LGTO2hzL pW+gXOqunbHWUcS0m7KawyX2/moRwTkSy2oylJJ+BcoLVLZFE1CHXyaxRa78w2QJ+etV N3ZM6HvZcniuDM95U7Rc9PxIMGNYEBJZPG7Ptm6Jgr03ducRag/N4wbrWYyEgSrLs54f Pn22M9Ql4V4HYY+hLPun9x1y4Adqtolj/LFleU7erSYZxXHHCNzO1oe8bOlHhxRCO6CI e4TUxT4DF+xWZP7A+sdkzAlx5ZPqJz6qZ4bOrGyw88oAkfcHwJ20oh7EIY4N3PsrAKIh t9nw== X-Gm-Message-State: ACgBeo3xXvZA1tHe20qjfZQlpAXHhv2LNbCjZWDI+LO4rdUx+keRxjKA xAyP17RDBqbzyv9aSxneIZmNVsMFfRfMPjXx X-Google-Smtp-Source: AA6agR6EGmB78/XUD/ujpGsAagNL4RcJLrwv7QzN47vtGm6YRcQvBmD34Yyk4jRMH2fkoW2BlRCyWw== X-Received: by 2002:a05:620a:601a:b0:6b9:3ffb:3dd2 with SMTP id dw26-20020a05620a601a00b006b93ffb3dd2mr15754411qkb.643.1660216166428; Thu, 11 Aug 2022 04:09:26 -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 z66-20020a379745000000b006b95b0a714esm1700043qkd.17.2022.08.11.04.09.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:26 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:21 -0400 Message-Id: <72d693448b5e07e8322eb3eeb302b16d20adfaf5.1660215295.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This patch uses the 'pbarch' support added to 'racket-vm-cs' to make it the default Racket VM implementation on all systems. * gnu/packages/racket.scm (racket-vm-for-system): Remove. (racket-minimal, racket)[inputs]: Replace '(racket-vm-for-system)' with 'racket-vm-cs'. --- gnu/packages/racket.scm | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 008adcc072..b1de6cf885 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -129,10 +129,9 @@ (define-module (gnu packages racket) ;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and ;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and ;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store -;; output. The function 'racket-vm-for-system' returns the recomended Racket -;; VM package for a given system. +;; output. ;; -;; We then define the packages 'racket-minimal' and +;; Using 'racket-vm-cs', we then define the packages 'racket-minimal' and ;; 'racket'. These use Racket's support for ``layered installations'', which ;; allow an immutable base layer to be extended with additional packages. ;; They use the layer configuration directly provide ready-to-install FHS-like @@ -193,17 +192,6 @@ (define-module (gnu packages racket) ;; ;; CODE: -(define* (racket-vm-for-system #:optional - (system (or (%current-target-system) - (%current-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)) - (define %racket-version "8.6") ; Remember to update chez-scheme-for-racket! (define %zuo-version "1.0") ; defined in racket/src/zuo/zuo.c (define %racket-commit @@ -586,7 +574,7 @@ (define-public racket-minimal (inputs (list openssl sqlite - (racket-vm-for-system) + racket-vm-cs (racket-packages-origin "base" %racket-origin '(("base" "pkgs/base") @@ -704,7 +692,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer - (racket-vm-for-system) + racket-vm-cs (simple-racket-origin "2d" (base32 "0fb5v6058ls08xw3zbmqyr2ym0psm119gl9ffgmhm9w8rs9i4dq7") '("2d" "2d-doc" "2d-lib")) From patchwork Thu Aug 11 11:08:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41556 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 09B9727BBEA; Thu, 11 Aug 2022 12:10:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 A826C27BBE9 for ; Thu, 11 Aug 2022 12:10:21 +0100 (BST) Received: from localhost ([::1]:56832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM64y-0000nN-JV for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64k-0000jq-TJ for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64k-0005a5-IY for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64k-0006ZV-Ds for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 12/13] etc: teams: Add racket team. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021617725142 (code B ref 57050); Thu, 11 Aug 2022 11:10:06 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:37 +0000 Received: from localhost ([127.0.0.1]:51852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64H-0006XS-7V for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:37 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:38462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64F-0006X2-Qr for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:36 -0400 Received: by mail-qk1-f169.google.com with SMTP id b24so6771371qka.5 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=TjI/ow93wjlZsLQd8qVPjMPI/14E2Ukc++6/EjGldCM=; b=gx7nvg5fX4hvG/Q50uo40aGnJO2eIWCJKPH137eL4zdIIydzFAyQ1DN99BHktKwb3U 32FuB6yRhyYSGzYOq7kvS7VfueXyZ7WdTFaPXKYlEvtEBpPzmBhpQDHgf/NMed0JMqPR SE4b7MUS2gGmi3ddpVa0ivqwnNPd1Ygfe30IunZqaexT+eFmOMbqsil0N+RwBab8Fzw2 SN+E415v/GooZFi0nu89+eXGo0n7Gg5fmWSqCN5CcTL5w/8aXsxdqajRTtTMiGDdJYec 6BVsW9mE4zkuyraFYyHU9qnzfw6Qq9Rrk8K2oqjewl/SeEgGrnlSbYy2UNAiUuQmKnUD nKlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=TjI/ow93wjlZsLQd8qVPjMPI/14E2Ukc++6/EjGldCM=; b=GQ9g0vyPe3g6TNhLhiayKCuG7n4p9MwSGUmrTyfyz872LmLBzpgnDwoVZ+j1G1NvVh JO+R6/HuBfcVMZafBNKckoFmAHBNo/sYMqtNPhAsC8qlDbkMLvnweGj6/Vh2z5nlQ2vI WcjLR+V6PamWn7uMpMBmO+vmUvZRyp9yB2Ndklua+167PizXF1Qhftj30HepXebxNwRO Uw7/MGL4aePS5PgJrxUuNVOFl80U96UFOHoFf+Hnz8djvTheGBgJ9LawLoyqdGkFsz71 5EF30gzgUBDlkBFDDpdAMNh524IhV/u2z+5WsW1KTzfx9ajKfDyi4FE7/i5k6kYUL6Ws kb9Q== X-Gm-Message-State: ACgBeo1G0iJYqFA5T7gHLYirSmhYSvDk0hOpABE9cesyNVsP1dn6dZ4l dX4fEIp95Z2gEhbBVCfFiVlWVe6qLw7xns5j X-Google-Smtp-Source: AA6agR5ypTtLiLjZThnlemSbDYLsf0VfUyTm+JdOue8ob/TQ++2T3qqZ6bycqhcD8ykl79CU0RNopw== X-Received: by 2002:a05:620a:294e:b0:6a7:750b:abf8 with SMTP id n14-20020a05620a294e00b006a7750babf8mr23256677qkp.513.1660216170361; Thu, 11 Aug 2022 04:09:30 -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-20020ac85d89000000b00342f05defd1sm1506978qtx.66.2022.08.11.04.09.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:30 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:22 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * etc/teams.scm.in (racket): New team. --- etc/teams.scm.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/teams.scm.in b/etc/teams.scm.in index adee5d4356..af70f7525e 100644 --- a/etc/teams.scm.in +++ b/etc/teams.scm.in @@ -185,6 +185,14 @@ (define-team mozilla "Taking care about Icecat and Icedove, built from Mozilla Firefox and Thunderbird.")) +(define-team racket + (team 'racket + #:name "Racket team" + #:description + "The Racket language and Racket-based languages, Racket packages, +Racket's variant of Chez Scheme, and development of a Racket build system and +importer.")) + (define-member (person "Thiago Jung Bauermann" "bauermann@kolabnow.com") From patchwork Thu Aug 11 11:08:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41563 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 275E827BBEA; Thu, 11 Aug 2022 12:11:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 08A9D27BBE9 for ; Thu, 11 Aug 2022 12:11:27 +0100 (BST) Received: from localhost ([::1]:58648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM662-0002M1-7a for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:11:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64l-0000kP-AG for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64k-0005aM-UL for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64k-0006Zc-PY for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 13/13] etc: teams: Add entry for Philip McGrath. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021618125159 (code B ref 57050); Thu, 11 Aug 2022 11:10:06 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:41 +0000 Received: from localhost ([127.0.0.1]:51855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64L-0006Xj-Hg for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:41 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:40834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM64J-0006XK-M7 for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:40 -0400 Received: by mail-qt1-f174.google.com with SMTP id w28so5028069qtc.7 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=W5nwTPbkFJneMPhj1YoI7TGor1lidjw2ar40JsTdPus=; b=NZBEMAOx/pYpQZg6nCwrjHBsuVZO1MKrfboPuZDZtcoDvW7lgIDVzhdFGgMo1Qgj1X cojRD/+el0nDT9OzNVuVJtBJNwRkz+FLnwApUX9AMwsN4DcDb7wslGlcg3fb3FVEAVPB aIVGlHnss52Mpn4sXdy8U0/sq/lmoKdd+iEucxWpcKJzLdbkS5eYGDG0Npewbz1RSHbz 04IhlPb0ku0LrtZIa3ITwpodnoPiov3tbrXQ6YLuYkQT9Ig+y99S5KQ7W94puzkNFtSi Xen/Zkll9YRxQBE/C3+jPeVMcchch00bL5C+RrUDQxLNsFzJb/gy7ZnYpNi8zFYedChy 7aLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=W5nwTPbkFJneMPhj1YoI7TGor1lidjw2ar40JsTdPus=; b=4Ee7LYkDQD2FOqTV77e15ldf3Kge8FEq2FdalMygr3RrDzu2NA77ApqDmD+9Cqtg13 dC9qXlI1Jqz71swDllXuf0Sd2qMUGu0YWaSN6jvKtcgIIMGhJ7hb7xE3Zym8rAx+h+g3 asT9WNlwGIz33Be86mWBI+JgVsuXaFmJOggjhXzahwucUelVWtHcdqzvHcGksTIhg3BA sDGrv3n5a6Ibkf6ajmQn+DYHOZIujI5wRizX7oDkZFZf3c+Il9KwGvkeMcRj30tBRW19 UswVk9Kive9BaDjlV///pjpwj5gdFFYNO4+QIsfHE1m7ic2oeI3xrz9jtxqxflbdHIpx De/A== X-Gm-Message-State: ACgBeo3lTwW4ibDuDcSIYJbABlmtRMFE3z8IdFu3FO6x5G+O8bz1uOVy CgBUtsakHS2iGi/ijhDthiJO3B3hGCjSt9bO X-Google-Smtp-Source: AA6agR52ZKny34O04Hb9+5MRe0Absfk4aFw13mwbhHrIZvO59kX0zchy5p3MhmRvbR8EmYaqEJy9rg== X-Received: by 2002:ac8:4e41:0:b0:343:5c49:951a with SMTP id e1-20020ac84e41000000b003435c49951amr5333573qtw.25.1660216174259; Thu, 11 Aug 2022 04: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 bk9-20020a05620a1a0900b006b978b521c8sm1756997qkb.69.2022.08.11.04.09.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:34 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:23 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * etc/teams.scm.in ("Philip McGrath"): New member. --- etc/teams.scm.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/teams.scm.in b/etc/teams.scm.in index af70f7525e..8f0191f1fa 100644 --- a/etc/teams.scm.in +++ b/etc/teams.scm.in @@ -238,6 +238,10 @@ (define-member (person "Julien Lepiller" "julien@lepiller.eu") java ocaml translations) +(define-member (person "Philip McGrath" + "philip@philipmcgrath.com") + racket) + (define-member (person "Mathieu Othacehe" "othacehe@gnu.org") core installer)