all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Jelle Licht <jlicht@fsfe.org>
Cc: guix-devel@gnu.org
Subject: Re: i686-linux GCC package on x86_64
Date: Fri, 4 Oct 2019 18:16:44 +0200	[thread overview]
Message-ID: <20191004181644.589c8ea3@scratchpost.org> (raw)
In-Reply-To: <87v9t4a4yk.fsf@jlicht.xyz>

[-- Attachment #1: Type: text/plain, Size: 2288 bytes --]

Hi,

On Fri, 04 Oct 2019 17:46:43 +0200
Jelle Licht <jlicht@fsfe.org> wrote:

> Mathieu Othacehe <m.othacehe@gmail.com> writes:
> 
> >
> > --8<---------------cut here---------------start------------->8---
> >     (native-inputs
> >      `(,@(if (not (string-prefix? "i686" (%current-system)))
> >            `(("cross-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))
> >              ("cross-binutils" ,(cross-binutils "i686-unknown-linux-gnu")))
> >            '())))
> > --8<---------------cut here---------------end--------------->8---
> >
> > that uses the current gcc if you're already building on an i686 system,
> > or define and use a cross-gcc targeting i686 systems otherwise.  
> 
> This snippet might make a lot of sense to seasoned schemers/guixfolk,

Basically just ignore the birdshit characters to understand what it does :)

The first unquote is to evaluate (%current-system) at the toplevel which is
what interprets the package definitions in the first place.

"`(,@" is a no-op.  Not sure why it's written like that.

>            `(("cross-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))
>              ("cross-binutils" ,(cross-binutils "i686-unknown-linux-gnu")))

is like we always write inputs, but it's calling the "cross-gcc" function in the
toplevel in order to get the package to use.

> with the multiple levels of (un)quoting and what not. It does not seem
> like what somebody with little experience in either would think of by
> themselves.
> 
> Would it make sense to have a section/stub in the cookbook about cross
> compilation?

I don't think that cross-gcc is stable API that much--and it's not
common that you need it anyway.  A normal user just cross compiles
by using

   guix build --target=i686-linux pkg

or better yet, uses qemu to natively compile it for a foreign system

   guix build --system=i686-linux pkg

.

The above is only necessary when for some reason your package has
parts which only compile on one system and other parts which only
compile on another system--that's very rare.

Nowadays, packages are supposed to be cross-platform, so using cross-gcc
directly is unnecessary, too.

Right now cross-gcc is not documented, so I guess that counts as
"not a public interface".


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-10-04 16:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-22 17:35 i686-linux GCC package on x86_64 Pierre Neidhardt
2019-10-03 12:38 ` Pierre Neidhardt
2019-10-04  6:32   ` Mathieu Othacehe
2019-10-04  8:09     ` Pierre Neidhardt
2019-10-04 15:16       ` Mathieu Othacehe
2019-10-04 15:46         ` Jelle Licht
2019-10-04 16:16           ` Danny Milosavljevic [this message]
2019-10-05  4:54             ` Chris Marusich
2019-10-07 22:34               ` Ricardo Wurmus
2019-10-08  2:36                 ` Chris Marusich
2019-10-10 13:34         ` Pierre Neidhardt
2019-10-11  8:12           ` Mathieu Othacehe
2019-10-11  9:30             ` Pierre Neidhardt
2019-10-11 10:07               ` Mathieu Othacehe
2019-10-14 13:35                 ` Pierre Neidhardt
2019-10-14 14:21                   ` Jelle Licht
2019-10-14 14:23                     ` Jelle Licht
2019-10-14 14:54                   ` Mathieu Othacehe
2019-10-14 15:44                     ` Pierre Neidhardt
2019-10-16 16:38                     ` Alex Kost
2019-10-07 15:19   ` Ludovic Courtès
2019-10-10 13:35     ` Pierre Neidhardt
2019-10-10 15:00       ` Ludovic Courtès

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=20191004181644.589c8ea3@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=jlicht@fsfe.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.