Subject: Re: [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation.

From: Philip McGrath <[email-masked]>
Date: Mon, 9 May 2022 03:20:30 -0400

Hi,

On 5/9/22 02:21, Liliana Marie Prikler wrote:
> Am Montag, dem 09.05.2022 um 02:02 -0400 schrieb Philip McGrath:
>> In this commit, we reimplement 'chez-upstream-features-for-system'
>> using the new '%chez-features-table', which explicitly specifies
>> platform support for both 'chez-scheme' and 'chez-scheme-for-racket',
>> rather than assuming a non-false result from 'nix-system->chez-machine'
>> means that the system is supported.
>>
>> The remaining uses of 'nix-system->chez-machine' still make that
>> incorrect assumption and must be repaired in a future commit.
> Do they really?  As far as I can see, we have a bijection between
> supported nix systems and chez-machines, with the behaviour when
> looking up unsupported systems being undefined.  This means that nix-
> system->chez-machine is well-formed in contexts outside of supported-
> system, e.g. also for the 6/9 patch.
> 

I think a bijection happens to exist at the moment, but only by 
accident. For example, while it isn't packaged for Guix, apparently 
aarch64-w64-mingw32 is a thing. Racket's Chez Scheme only added tarm64nt 
support as of this release, but had previously supported aarch64 with 
other kernels and the NT kernel with other architectures. If Guix had 
added that system before Racket's Chez did, 'nix-system->chez-machine' 
would have known how to write it as a Chez machine type, but nonetheless 
it wouldn't have had a native code backend.

We explicitly list the systems for which Racket's Chez has a native code 
backend in '%chez-features-table', so I really think we should just use 
it, rather than try to be clever with 'nix-system->chez-machine'.

-Philip