public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions
@ 2012-09-20 17:34 Ambroz Bizjak
  2012-09-21 16:06 ` Zac Medico
  0 siblings, 1 reply; 9+ messages in thread
From: Ambroz Bizjak @ 2012-09-20 17:34 UTC (permalink / raw
  To: gentoo-dev

I'm working on some EAPI extensions with the goal of making Portage
more powerful for cross-compilation. See
https://bugs.gentoo.org/show_bug.cgi?id=317337
Currently, it's come down to the following:

- A new dependency type HDEPEND for packages which must be installed
in / at build time. With HDEPEND present in the new EAPI (probably
4-hdepend), DEPEND will always mean ROOT (target) dependencies, and
will no longer be affected by --root-deps option.

- Another dependency type CROSS_HDEPEND, like HDEPEND, but in effect
only when cross compiling. This in particular is required for packages
which need themselves on the host when cross compiling, and adding
this to HDEPEND would make a package not buildable on native due to a
circular dependency.

- A --crosscompile option to tell emerge when we are cross compiling,
and this triggers CROSS_HDEPEND (except for installs to /). Basically
we don't want emerge doing any black magic guessing like comparing
CHOST.

But the one thing missing currently is a way to check from within an
ebuild function whether we are cross compiling, in a way that would
correspond directly to --crosscompile (again, except for /). There is
currently "tc-is-cross-compiler" from toolchain-funcs.eclass, but this
may not work right when not at build time (pkg_{pre,post}{inst,rm}),
and it also may not correspond to presence of --crosscompile.

The question now is, how should this method for checking
--crosscompile be implemented? In particular, we have two options:

- Environment variable. If so, how to call it? Possible names are
CROSSCOMPILE, GENTOO_CROSSCOMPILE, PORTAGE_CROSSCOMPILE,
ECROSSCOMPILE... For more generic names (CROSSCOMPILE) it needs to be
taken into account that they may inadvertently affect packages.
However environment vars have the benefit that it's easy to pass them
through programs and scripts.

- Internal function, similar to "use". Probably "is_crosscompile".
This may look nicer and reduces the risk of collisions.

This RFC is only about checking for presence of --crosscompile. Please
do not discuss HDEPEND in general here, or anything that would require
major effort to get done.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-22 18:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 17:34 [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions Ambroz Bizjak
2012-09-21 16:06 ` Zac Medico
2012-09-22 15:16   ` Luca Barbato
2012-09-22 16:08   ` Ambroz Bizjak
2012-09-22 16:31     ` Zac Medico
     [not found]       ` <CAOA3yKJq7hVcXhOzdbesb1Opfb6Cj-zU2Sqjf3oM7jeM7yChFg@mail.gmail.com>
2012-09-22 16:48         ` Ambroz Bizjak
2012-09-22 17:01           ` Zac Medico
2012-09-22 17:14             ` Ambroz Bizjak
2012-09-22 18:35               ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox