help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing cross-compiled packages alongside a cross-compile toolcha


From: Christoph Buck
Subject: Re: Installing cross-compiled packages alongside a cross-compile toolchain
Date: Mon, 10 Jun 2024 13:51:27 +0200
User-agent: mu4e 1.12.0; emacs 30.0.50

Richard Sent <richard@freakingpenguin.com> writes:

> Hi Christoph!

Hi Richard!

Christoph here (writing from a different mail address to up my mailing
list game).

> (I assume your inspiration was [1], but in my opinion this is
> different enough in both context and content to deserve its own
> section.)
> [...]
> [1]: https://guix.gnu.org/en/cookbook/en/guix-cookbook.html#Build-Manifest

Exactly. This was my inspiration. 

> I also unfortunately don't know of a better solution. I'm not fluent
> with how cross-compilation works in Guix, but I think it would be
> valuable proposing this (or something like it) as a patch and/or
> cookbook entry! It seems too useful to leave hidden away in the mailing
> list.

I agree. If my hack is the technical correct way to achieve this, it
should probably be documented somewhere. I took me (a newbe) some time
to figure it out. I certainly can help writing an entry for the
guix cookbook if desired, but i am not sure if i am the correct person
to do so. My technical understanding and jargon of guix is currently
quite limited. I don't even understand my hack in full, it was more or
less try and error and guestimate engineering.

> The closest I can think of is wrapping your Guix software as a package
> and using --target, but this is often too much of a barrier to entry
> when all you want is a simple development environment. 

Interestingly there is no `--target` option for the `guix shell`
command, only the `--system` option, which result in using qemu to
emulate the target platform. I guess because it usually does not make
sense to instantiate a development environment with cross-compiled
packages which can't be used/executed on the host platfom if host !=
target platform?

If i had to come up with a feature to support native cross-build
toolchains in `guix shell` i would probably add the `target` option.
This option would instantiate the gcc toolchain with a cross-compile
configuration for the host platform, but treat any package as
cross-compiled version, so that i can specify the additional
dependencies in a manifest file like i normally would.

> Anything making cross-compilation easier is a good thing in my eyes.

Yes i agree. Unfortunately cross-compilation still seems to be very
"experimental". I stumpled upon multiple bugs ([1],[2],[3]) in order to
get it to work at all. Luckily they were well known and documented
([1][2]) or easy to fix. ([3]).

All in all not a production ready replacement for yocto, but imho the
potential is there :)

Best regards

Christoph


[1] https://issues.guix.gnu.org/68058
[2] https://issues.guix.gnu.org/66866,
[3] https://issues.guix.gnu.org/71174






reply via email to

[Prev in Thread] Current Thread [Next in Thread]