From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Philip McGrath <philip@philipmcgrath.com>,
Diego Nicola Barbato <dnbarbato@posteo.de>
Cc: 54292@debbugs.gnu.org
Subject: bug#54292: Commit e8518c43 breaks guix pull on i686
Date: Tue, 08 Mar 2022 21:49:32 +0100 [thread overview]
Message-ID: <c9c6724165154433bacfc605924d109e547214c4.camel@gmail.com> (raw)
In-Reply-To: <5216289.ggv9HUQsqW@bastet>
Am Dienstag, dem 08.03.2022 um 13:33 -0500 schrieb Philip McGrath:
> I can see (at least) two paths forward:
>
> 1. `%nix-{arch,os}-to-chez-alist` could become many-to-one rather
> than one-to-one. Presumably we'd use the first applicable entry
> when going from Chez to Nix.
>
> 2. We could give up on alists and use existing predicates from
> (guix utils) like `target-x86-32?`, as Liliana had already
> suggested during review for `chez-upstream-features-for-system`.
>
> I liked the alists because they made the bidirectional relationship
> obvious, but I wonder if there are other potential pitfalls analogous
> to this one. Maybe someone more familiar with non-x86_64 systems in
> Guix/Nix than I am should decide.
There is no 1:1 mapping to be found here as far as I can see.
Likewise, the reverse mapping is currently unused and should in my
opinion be dropped so that people don't expect a round-trip to be well-
defined.
> OTOH, while it's definitely a bug that `(nix-system->chez-machine
> "i686-linux")` currently returns `#f`, it seems like the more
> immediate problem is from the `maybe-compile` phase of
> the stex-bootstrap package, where this code:
>
> (define machine
> #$(chez-machine->threaded
> (nix-system->chez-machine)))
>
> assumes, apparently incorrectly, that it's only going to be run when
> the result of `nix-system->chez-machine` is non-false. In other
> words, even if we fix the bug in `nix-system->chez-machine` for i686,
> I think we'd still hit this problem for systems that Chez really
> doesn't support, e.g. ppc64le or MIPS. I don't know what the most
> correct way would be to write this code, but I think we could defer
> the error until someone attempts to build the package for the
> unsupported system by just writing something like:
>
> (define machine
> #$(and=> (nix-system->chez-machine)
> chez-machine->threaded))
I pushed that definition upstream, but a rewrite is still needed. I
also think this logic should be a little decoupled from the question of
whether or not a given nix-system is supported. While surely this
function returning #f means it's not, there are still other questions
to consider.
An implementation could look like the following
(define* (nix-system->chez-machine system #:key threaded?)
(false-if-exception
(string-append
(if threads? "t" "")
(cond
((target-x86_64? system) "a6")
...)
(cond
((target-linux? system) "le")
...))))
Cheers
next prev parent reply other threads:[~2022-03-08 20:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 12:47 bug#54292: Commit e8518c43 breaks guix pull on i686 Diego Nicola Barbato
2022-03-07 13:53 ` Liliana Marie Prikler
2022-03-07 18:12 ` Diego Nicola Barbato
2022-03-08 8:00 ` Liliana Marie Prikler
2022-03-08 15:32 ` Liliana Marie Prikler
2022-03-08 18:33 ` Philip McGrath
2022-03-08 20:49 ` Liliana Marie Prikler [this message]
2022-03-09 14:24 ` Diego Nicola Barbato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c9c6724165154433bacfc605924d109e547214c4.camel@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=54292@debbugs.gnu.org \
--cc=dnbarbato@posteo.de \
--cc=philip@philipmcgrath.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).