all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Thiago Jung Bauermann <bauermann@kolabnow.com>
Cc: Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
	58576@debbugs.gnu.org
Subject: [bug#58576] [PATCH] system: image: Define correct docker image arch when cross building
Date: Mon, 17 Oct 2022 09:54:51 +0200	[thread overview]
Message-ID: <87pmeqnaus.fsf@gnu.org> (raw)
In-Reply-To: <20221017012843.29975-1-bauermann@kolabnow.com> (Thiago Jung Bauermann's message of "Sun, 16 Oct 2022 22:28:43 -0300")


Hello Thiago,

Thanks for this patch!

> +         (image-target (or (%current-target-system)
> +                           (and=> (image-platform image) platform-target)
> +                           (nix-system->gnu-triplet)))

There's the following snippet in "system-image" that is trying to do the
right thing (and it is not easy) with the "target" value.

--8<---------------cut here---------------start------------->8---
  ;; The image platform definition may provide the appropriate "system"
  ;; architecture for the image.  If we are already running on this system,
  ;; the image can be built natively.  If we are running on a different
  ;; system, then we need to cross-compile, using the "target" provided by the
  ;; image definition.
  (define system (and=> platform platform-system))
  (define target (cond
                  ;; No defined platform, let's use the user defined
                  ;; system/target parameters.
                  ((not platform)
                   (%current-target-system))
                  ;; The current system is the same as the platform system, no
                  ;; need to cross-compile.
                  ((and system
                        (string=? system (%current-system)))
                   #f)
                  ;; If there is a user defined target let's override the
                  ;; platform target. Otherwise, we can cross-compile to the
                  ;; platform target.
                  (else
                   (or (%current-target-system)
                       (and=> platform platform-target)))))
--8<---------------cut here---------------end--------------->8---

The rationale is that the user supplied %current-target-system is always
overriding the image platform field. Then, %current-target-system is set
to the "target" value defined above.

It makes me think that you could use %current-target-system directly as
the "image-target" value. WDYT?

Mathieu




  reply	other threads:[~2022-10-17  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  1:28 [bug#58576] [PATCH] system: image: Define correct docker image arch when cross building Thiago Jung Bauermann via Guix-patches via
2022-10-17  7:54 ` Mathieu Othacehe [this message]
2022-10-26 23:47   ` Thiago Jung Bauermann via Guix-patches via
2022-11-04  1:54     ` [bug#58576] [PATCH v2] " Thiago Jung Bauermann via Guix-patches via
2022-11-04  7:46       ` bug#58576: " Mathieu Othacehe
2022-11-05  3:04         ` [bug#58576] " Thiago Jung Bauermann via Guix-patches via

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=87pmeqnaus.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=58576@debbugs.gnu.org \
    --cc=bauermann@kolabnow.com \
    --cc=thiago.bauermann@linaro.org \
    /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.