From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6MlKAypkFGSbqQAASxT56A (envelope-from ) for ; Fri, 17 Mar 2023 13:59:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WOFKAypkFGS1zwAA9RJhRA (envelope-from ) for ; Fri, 17 Mar 2023 13:59:22 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 34A2D3254C for ; Fri, 17 Mar 2023 13:59:21 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679057961; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post; bh=fnKlLCGJOQy1b/nI5wbmeDsfRygDBSr3+UK1XhEzwiU=; b=mg6koPZsBnlfqPPlvcBMOObZ41+Vo3YO4SoQ2oDMcWYQY7UHkI1mnRbbRbPQim/ppXlKYo rkunzozPqBSEKvCw72goUoMGa4Eecv8Bxu4ikIfyvxZfbAuLe6Xfqyiiz5Udm9OPV5zYxu AzOtlO5ywmD4xKYFlxaFmrGTLyNDxi7B5qCt5SIje9hZTbREx4w1AEvmBjp5ZEshIU6A0J aGrNZ66BrEc1R5soHPPVqBYWJVBDo1fU1chvjWAZE9xLvb5dzqoJ6NqKtEaSPAT7p3jJ9S QC6Gj0V7yeQFhv8q19Bp7zKiGhullxtjJF7ZfqI8h2BvVmUDL9cFzrm635jYbA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679057961; a=rsa-sha256; cv=none; b=fLhTjs4gSunBwROYkNxYttntFqBhL/TQmO19358xC3O2YGvGJBTl/T3KG+D9nSdQNg91gq CYLELonY2pMKt5Ee3LKzR8KG+cFOOZbqhVa2CrkAg9SVrJbGavQ3VAHc6yA0lNnLhf8pvt P5+HSm+00UWvraSXS632Jb7GYWeUKCn3gT16n+J7aBpOby8fTzEbhLpQYJey4ocF3Wel8o H2NfchDoGR6PrA0OSA1LK1DWWOqf+wQh4vnYxLnCT4KvCqphb/AnPGpbNgfljRqjoIFIT0 nmYv0RJ1zuQ3PKprfmE6bxCxbDJAE5Wx1sMSjh44Avn14b2Uf6WRk/WIVAUvsg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pd9fk-0001FE-2L; Fri, 17 Mar 2023 08:59:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pd2F5-0007J1-0Z for guix-patches@gnu.org; Fri, 17 Mar 2023 01:03:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pd2F4-0007LU-MH for guix-patches@gnu.org; Fri, 17 Mar 2023 01:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pd2F4-0001v4-5m for guix-patches@gnu.org; Fri, 17 Mar 2023 01:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62231] Chez Scheme for Racket build on aarch64 (patch attached) Resent-From: Tim Johann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Mar 2023 05:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62231 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 62231@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16790293767365 (code B ref -1); Fri, 17 Mar 2023 05:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Mar 2023 05:02:56 +0000 Received: from localhost ([127.0.0.1]:43440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pd2Ex-0001uh-E5 for submit@debbugs.gnu.org; Fri, 17 Mar 2023 01:02:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:54632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcxJs-0002Fy-Aa for submit@debbugs.gnu.org; Thu, 16 Mar 2023 19:47:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcxJs-0007u2-4K for guix-patches@gnu.org; Thu, 16 Mar 2023 19:47:40 -0400 Received: from ms-10.1blu.de ([178.254.4.101]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcxJp-0002sc-2R for guix-patches@gnu.org; Thu, 16 Mar 2023 19:47:39 -0400 Received: from [176.199.211.189] (helo=dolos) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcxJj-0003Fk-LA for guix-patches@gnu.org; Fri, 17 Mar 2023 00:47:31 +0100 From: Tim Johann Date: Fri, 17 Mar 2023 00:23:46 +0100 User-agent: mu4e 1.8.13; emacs 29.0.60 Message-ID: <87h6ukntrg.fsf@phrogstar.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Con-Id: 303810 X-Con-U: 0-timjohann X-Originating-IP: 176.199.211.189 Received-SPF: pass client-ip=178.254.4.101; envelope-from=t1m@phrogstar.de; helo=ms-10.1blu.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 17 Mar 2023 01:02:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 17 Mar 2023 08:59:02 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 34A2D3254C X-Spam-Score: -4.44 X-Migadu-Spam-Score: -4.44 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: kK8yy5bBYB1F --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Guix Team, tl;dr; The recipe for package 'chez-scheme-for-racket-bootstrap-bootfiles' (a dependency for racket-8.*) needs to use the --machine flag to build on aarc= h64 (and possibly also ppc32, the other non-x86 architectures supported by the Racket fork of Chez Scheme). I therefore suggest the attached patch to make building and using Racket possible on aarch64 Guix. End of tl;dr; A few weeks ago I wanted to use Racket on Guix on aarch64, but was made awa= re, that Racket was not available as a substitute and it did not build. On the other hand, recent versions of Racket were available on Raspberry Pi OS whi= ch is explicitly running on aarch64. The machine I am running Guix on actually i= s a Raspberry Pi 4B. So, I dug deeper to find that the problem is that the package chez-scheme-for-racket-bootstrap-bootfiles fails with the error ,---- | string-append: contract violation | expected: string? | given: #f | argument position: 1st | other arguments...: | ".def" | context...: | /tmp/guix-build-chez-scheme-for-racket-bootstrap-bootfiles-9.9.9-pre-r= elease.14.drv-0/source/racket/src/rktboot/machine-def.rkt:6:0: open-file-wi= th-machine.def-redirect | error: in phase 'build': uncaught exception: | %exception #<&invoke-error program: "/gnu/store/0n4skakcg05bbq9sq7g00j2zm= 25xh4wa-racket-vm-bc-8.8/opt/racket-vm/bin/racket" arguments: ("../rktboot/= main.rkt") exit-status: 1 term-signal: #f stop-signal: #f>=20 | phase `build' failed after 14.3 seconds | command "/gnu/store/0n4skakcg05bbq9sq7g00j2zm25xh4wa-racket-vm-bc-8.8/opt= /racket-vm/bin/racket" "../rktboot/main.rkt" failed with status 1 | builder for `/gnu/store/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-for-= racket-bootstrap-bootfiles-9.9.9-pre-release.14.drv' failed with exit code 1 | @ build-failed /gnu/store/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-fo= r-racket-bootstrap-bootfiles-9.9.9-pre-release.14.drv - 1 builder for `/gnu= /store/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-for-racket-bootstrap-bo= otfiles-9.9.9-pre-release.14.drv' failed with exit code 1 `---- (see, e.g. the build [442314 on ci.guix.gnu.org]). The Racket fork of Chez is natively supported on aarch64, which is supporte= d by comments in module (gnu packages chez), so I went on to find that machine architecture is communicated in the build process by setting the environment variable MACH. I haven't looked to verify this, but it seems that this environment variable is normally set to a guessed value by the zuo build pr= ocess (zuo for 'make' in Mandarin?). The Guix build recipe for chez-scheme-for-racket-bootstrap-bootfiles, thoug= h, is not configuring the whole downloaded racket source package but takes the shortcut of just building ChezScheme in the subdirectory racket/src/ChezScheme using the Racket utility ../rktboot/main.rkt This script would actually accept the flag '--machine' and would set the environment variable MACH to the value of the argument following the flag. The problem is that in the case of aarch64 the recipe would not set the fla= g. In the recipe for chez-scheme-for-racket-bootstrap-bootfiles in module (gnu packages chez), we find the lines ,---- | #~(invoke | (search-input-file (or native-inputs inputs) | "/opt/racket-vm/bin/racket") | "../rktboot/main.rkt" | #$@(if (racket-cs-native-supported-system?) | #~() | (let ((m (nix-system->pbarch-machine-type))) | #~("--machine" #$m))))))))))))) `---- and, since `(racket-cs-native-supported-system?)' returns `tarm64le', the f= irst branch of the if expression is taken, ommitting the flag. I suggest to change the above code to the following: ,---- | #~(invoke | (search-input-file (or native-inputs inputs) | "/opt/racket-vm/bin/racket") | "../rktboot/main.rkt" | #$@(let ((m (or (racket-cs-native-supported-system?) | (nix-system->pbarch-machine-type)))) | #~("--machine" #$m)))))))))))) `---- which sets the flag for natively supported architectures and those supporte= d by portable bytecode. The package (and subsequently Racket) builds on aarch64, the build on x86_64 seems to be unaffected. It is a simple change which would make a huge difference for Guix users who= want to be able to play with Racket on an aarch64 machine. Cheers Tim L=C3=A1 Fh=C3=A9ile P=C3=A1draig sona dhaoibh! [442314 on ci.guix.gnu.org] --==-=-= Content-Type: text/html; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable

Hi Guix Team,

tl;dr;

The recipe for package 'chez-scheme-for-racket-bootstrap-bootfiles' (a
dependency for racket-8.*) needs to use the =E2=80=93machine flag to build = on aarch64
(and possibly also ppc32, the other non-x86 architectures supported by the<= br/> Racket fork of Chez Scheme). I therefore suggest the attached patch to mak= e
building and using Racket possible on aarch64 Guix.

End of tl;dr;

A few weeks ago I wanted to use Racket on Guix on aarch64, but was made awa= re,
that Racket was not available as a substitute and it did not build. On the=
other hand, recent versions of Racket were available on Raspberry Pi OS whi= ch is
explicitly running on aarch64. The machine I am running Guix on actually i= s a
Raspberry Pi 4B.

So, I dug deeper to find that the problem is that the package
chez-scheme-for-racket-bootstrap-bootfiles
fails with the error

  string-append: contract violation
  expected: string?
  given: #f
  argument position: 1st
  other arguments...:
   ".def"
  context...:
   /tmp/guix-build-chez-scheme-for-racket-bootstrap-bootfiles-9.9.9-pre-rel=
ease.14.drv-0/source/racket/src/rktboot/machine-def.rkt:6:0: open-file-with=
-machine.def-redirect
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "/gnu/store/0n4skakcg05bbq9=
sq7g00j2zm25xh4wa-racket-vm-bc-8.8/opt/racket-vm/bin/racket" arguments=
: ("../rktboot/main.rkt") exit-status: 1 term-signal: #f stop-sig=
nal: #f>=20
phase `build' failed after 14.3 seconds
command "/gnu/store/0n4skakcg05bbq9sq7g00j2zm25xh4wa-racket-vm-bc-8.8/=
opt/racket-vm/bin/racket" "../rktboot/main.rkt" failed with =
status 1
builder for `/gnu/store/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-for-ra=
cket-bootstrap-bootfiles-9.9.9-pre-release.14.drv' failed with exit code 1
@ build-failed /gnu/store/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-for-=
racket-bootstrap-bootfiles-9.9.9-pre-release.14.drv - 1 builder for `/gnu/s=
tore/d04mbj02vzjv0ljcqy2lxs33scz7kjz0-chez-scheme-for-racket-bootstrap-boot=
files-9.9.9-pre-release.14.drv' failed with exit code 1

(see, e.g. the build 442314 on ci.guix.gnu.org).

The Racket fork of Chez is natively supported on aarch64, which is supporte= d by
comments in module (gnu packages chez), so I went on to find that machine architecture is communicated in the build process by setting the environmen= t
variable MACH. I haven't looked to verify this, but it seems that this
environment variable is normally set to a guessed value by the zuo build pr= ocess
(zuo for 'make' in Mandarin?).

The Guix build recipe for chez-scheme-for-racket-bootstrap-bootfiles, thoug= h, is
not configuring the whole downloaded racket source package but takes the shortcut of just building ChezScheme in the subdirectory
racket/src/ChezScheme
using the Racket utility
../rktboot/main.rkt
This script would actually accept the flag '=E2=80=93machine' and would set= the
environment variable MACH to the value of the argument following the flag.<= br/>

The problem is that in the case of aarch64 the recipe would not set the fla= g.
In the recipe for chez-scheme-for-racket-bootstrap-bootfiles in module (gnu=
packages chez), we find the lines

#~(invoke
   (search-input-file (or native-inp=
uts inputs)
                      "/opt/racket-vm/=
bin/racket")
   "../rktboot/main.rkt"
   #$@(if (racket-cs-native-supporte=
d-system?)
          #~()
          (let ((m (nix-system->p=
barch-machine-type)))
            #~("--machine"=
 #$m)))))))))))))

and, since (racket-cs-native-supported-system?) returns tarm64le,= the first
branch of the if expression is taken, ommitting the flag.

I suggest to change the above code to the following:

#~(invoke
   (search-input-file (or native-inp=
uts inputs)
                      "/opt/racket-vm/=
bin/racket")
   "../rktboot/main.rkt"
   #$@(let ((m (or (racket-cs-native-supported-system?)
                   (nix-system->pbarch-machine-type))))
        #~("--machine" #$m=
))))))))))))

which sets the flag for natively supported architectures and those supporte= d by
portable bytecode.

The package (and subsequently Racket) builds on aarch64, the build on x86_6= 4
seems to be unaffected.

It is a simple change which would make a huge difference for Guix users who= want
to be able to play with Racket on an aarch64 machine.

Cheers

Tim

L=C3=A1 Fh=C3=A9ile P=C3=A1draig sona dhaoibh!

--==-=-=-- --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=chez-racket-aarch64.patch commit f8d7b06a92b3839da1908837ac81ab6295626cf5 Author: Tim Johann Date: Thu Mar 16 18:53:13 2023 +0100 gnu: chez-scheme-for-racket-bootstrap-bootfiles: change for aarch64. * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): change for build on aarch64, making racket available on aarch64. [arguments] use --machine even when architecture is supported by Racket's fork of ChezScheme. diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index c6420a980e..bc709917c2 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -692,10 +692,9 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (search-input-file (or native-inputs inputs) "/opt/racket-vm/bin/racket") "../rktboot/main.rkt" - #$@(if (racket-cs-native-supported-system?) - #~() - (let ((m (nix-system->pbarch-machine-type))) - #~("--machine" #$m))))))))))))) + #$@(let ((m (or (racket-cs-native-supported-system?) + (nix-system->pbarch-machine-type)))) + #~("--machine" #$m)))))))))))) (supported-systems (package-supported-systems chez-scheme-for-racket)) (home-page "https://github.com/racket/ChezScheme") --=-=-=--