all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <m.othacehe@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Cross-compilation broken on canonical packages.
Date: Mon, 30 Dec 2019 19:48:13 +0100	[thread overview]
Message-ID: <87y2ut645u.fsf@gnu.org> (raw)
In-Reply-To: <87fthc9vav.fsf@gmail.com> (Mathieu Othacehe's message of "Sun, 22 Dec 2019 17:31:04 +0100")

Hi,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> This is expected: packages in ‘%final-inputs’ (those returned by
>> ‘canonical-package’) are rooted in the bootstrap graph and cannot be
>> cross-compiled.
>
> Looking at canonical-package in (gnu packages commencement), I see that
> there's already a switch on (%current-target-system). The given package
> is directly returned if (%current-target-system) is set, which appears
> to be what we want!
>
>          ;; In general we want CANON, except if we're cross-compiling: CANON
>          ;; uses explicit inputs, so it is "anchored" in the bootstrapped
>          ;; process, with dependencies on things that cannot be
>          ;; cross-compiled.
>          (if (%current-target-system)
>              package
>              canon))
>
>
> But, this doesn't work as expected. I guess it is because of
> (%current-target-system) evaluation time.

Ah yeah.  The hack works when you use ‘canonical-package’ in a package
input, because package input fields are “thunked”, so they’re evaluated
in a dynamic context where ‘%current-target-system’ has the right value.
  
However, the hack doesn’t work for things like the ‘packages’ field of
<operating-system> because it’s not a thunked field.

Two simple solutions here, I think:

  1. Make ‘packages’ a thunked field.

  2. Stop using ‘canonical-package’ altogether in ‘%base-packages’.

I actually have a preference for #2.  We’d need to check what impact it
has on the system closure size, but I suspect it’s going to be minimal.

Thoughts?

(The <canonical-package> trick you posted should work of course, but
it’s even better if we can avoid it!)

Thanks,
Ludo’.

  reply	other threads:[~2019-12-30 18:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 11:49 Cross-compilation broken on canonical packages Mathieu Othacehe
2019-12-14 11:52 ` Mathieu Othacehe
2019-12-19 16:48   ` Ludovic Courtès
2019-12-22 16:31     ` Mathieu Othacehe
2019-12-30 18:48       ` Ludovic Courtès [this message]
2019-12-31  9:55         ` Mathieu Othacehe
2020-01-02 18:07           ` Ludovic Courtès
2020-01-02 22:00             ` Mathieu Othacehe
2020-01-03 12:03               ` Mathieu Othacehe
2020-02-11 13:01                 ` Mathieu Othacehe
2020-02-11 14:04                   ` Ludovic Courtès
2020-02-12 10:20                     ` Mathieu Othacehe
2020-02-24 16:11                       ` Ludovic Courtès
2020-03-06  9:19                         ` Mathieu Othacehe

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2ut645u.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=m.othacehe@gmail.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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.