Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 222895 - $PORTAGE_CONFIGROOT + $ROOT + $host-DEPEND conflicts with itself
Summary: $PORTAGE_CONFIGROOT + $ROOT + $host-DEPEND conflicts with itself
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Conceptual/Abstract Ideas (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 261109 (view as bug list)
Depends on:
Blocks: 268228
  Show dependency tree
 
Reported: 2008-05-20 04:05 UTC by solar (RETIRED)
Modified: 2010-09-23 02:43 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
new options: --root-deps[=rdeps] (root_deps.patch,4.94 KB, patch)
2009-04-01 01:55 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description solar (RETIRED) gentoo-dev 2008-05-20 04:05:17 UTC
Problem:
1) Cross compiles can result in miscompiles on the host system.
2) Using PORTAGE_CONFIGROOT= portage still reads portage settings from /
3) Maintainers don't know how to use DEPEND vs RDEPEND correctly.

So a common case for number 1
You set up a emerge to pass PORTAGE_CONFIGROOT=/somedir
Inside of the PORTAGE_CONFIGROOT you have a 100% setup for cross 
compiling as it was designed for.  So it sets up ARCH= ACCEPT_KEYWORDS= ROOT= and all the other required jazz.
You then begin to cross emerge packages. This goes well for most base system stuff. The problems begin when ROOT!=/ and emerge wants to satisfy DEPEND= on /
and in ROOT=/somedir. This is clearly a problem for a number of reasons.

Packages that are in DEPEND when merging into a ROOT=/somedir cause you to have to keywords ~anotherarch vs the one you are trying to cross compile for. 
IE you have to package.keyword on / and in the $PORTAGE_CONFIGROOT. Some depend graphs will never be resolvable.

Solutions:
1) When PORTAGE_CONFIGROOT is defined. emerge/portage should 100% respect it and not read from /etc/portage/. This is verified by doing an 
PORTAGE_CONFIGROOT=/somedir strace -o /dev/stdout -eopen emerge -pvq anypkg \
 | grep /etc
1.1) When ROOT= is given portage/emerge should respect it and only use the var/db/pkg/ files from that dir.

2) extend the existing --with-bdeps=(y|n) option.. Maybe (Y|N) options? kinda like -k/-K/-g/-G 

3) introduce env variable in the PORTAGE_CONFIGROOT/etc/make.conf that tells emerge how not to behave.

4) Open to ideas that fix the problem quickly and don't introduce --some-super-duper-long-command-line-option.


When these options behave this way portage is one hell of a powerful tool that can arbitrarly build nearly anything. We just need to put a little trust in the end-user to notice things like "hey unzip" I probably need that..
Comment 1 Markus Duft (RETIRED) gentoo-dev 2008-05-20 06:49:47 UTC
huh.... i'm just fighting with prefixed portage (so no embedded :)), to get it to behave the same with EPREFIX=/somepath as with ROOT=/somepath dependency resolution wise. I want to build into another prefix, but have DEPENDS resolved from the "main" prefix too, if they are there - just like ROOT=/blah does.... for me this makes a lot of sense. i even require it, or i'll have to deal with package.provided in my new prefix, since it's a platform where most of @system for example is not buildable.

my case is this: i have an interix prefix (which uses the interix libc). i want a windows prefix (which uses the windows libc, and are executable on the build machine, just like the interix binaries). Compiler and linker for this task is in place an works, also merging with EPREFIX=/blah emerge -pv blah works perfectly, except that (of course) portage wants to emerge a whole bunch of deps. those deps (of course only DEPEND, not {R,P}DEPEND) have to be resolved from the interix prefix, otherwise i would have to put tons of packages in the package.provided, which clearly is no good solution...
Comment 2 Zac Medico gentoo-dev 2009-03-25 20:36:28 UTC
*** Bug 261109 has been marked as a duplicate of this bug. ***
Comment 3 solar (RETIRED) gentoo-dev 2009-03-29 19:53:17 UTC
This is solved with svn r13245 with two new options --rdeps-only and --root-deps
Comment 4 Zac Medico gentoo-dev 2009-04-01 01:55:51 UTC
Created attachment 186932 [details, diff]
new options: --root-deps[=rdeps]

This is in svn r13267.
Comment 5 Andrei Slavoiu 2009-04-12 11:09:15 UTC
(In reply to comment #4)
> Created an attachment (id=186932) [edit]
> new options: --root-deps[=rdeps]
> 
> This is in svn r13267.
> 

Just tried this new option with portage-2.2_rc30, and it apears to work fine.
Comment 6 Zac Medico gentoo-dev 2009-05-02 20:55:40 UTC
It's also in portage-2.1.6.12 now.
Comment 7 solar (RETIRED) gentoo-dev 2010-09-23 02:43:21 UTC
This feature has been working great. It's now become a time tested good feature. Not the ideal solution long run but till perl's build system along with a few others is resolved this prevents many headaches. It progressed embedded/gen2's ability to support projects such as chromium-os.