Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 543634 - emerge doesn't honor --config-root for /etc/portage/package.use/*
Summary: emerge doesn't honor --config-root for /etc/portage/package.use/*
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2015-03-17 18:11 UTC by Robert White
Modified: 2015-03-26 17:33 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert White 2015-03-17 18:11:45 UTC
I am trying to build a x86 image on an amd64 base. I've set up a directory /mnt/dst/__Target_32/ and I use

emerge --ask --update --deep --newuse --config-root=/mnt/dst/__Target_32/ --keep-going --with-bdeps=y @world

/mnt/dst/__Target_32/etc/portage/make.conf then has ROOT= set as needed etc.

NOTE :: emerge --version
Portage 2.2.17 (python 3.4.2-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.20-r2, 3.19.0-gentoo x86_64)


The system keept telling me to make the same changes.

e.g.
The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by media-libs/mesa-10.5.1::gentoo
# required by x11-base/xorg-server-1.16.4-r2::gentoo[-minimal]
# required by x11-drivers/xf86-video-mga-1.6.4::gentoo[dri]
# required by x11-base/xorg-drivers-1.17::gentoo[video_cards_mga]
# required by x11-base/xorg-server-1.17.1-r1::gentoo[xorg]
# required by x11-drivers/xf86-video-tdfx-1.4.6::gentoo
=x11-libs/libdrm-2.4.59 video_cards_vmware video_cards_radeon
# required by x11-drivers/xf86-video-vmware-13.1.0::gentoo
# required by x11-base/xorg-drivers-1.17::gentoo[video_cards_vmware]
# required by x11-base/xorg-server-1.16.4-r2::gentoo[xorg]
# required by x11-drivers/xf86-video-mga-1.6.4::gentoo[dri]
=media-libs/mesa-10.5.1 xa

but these changes are already in place...

system # cat /mnt/dst/__Target_32/etc/portage/package.use/zzzz_autowrite 
# required by x11-drivers/xf86-video-vmware-13.1.0::gentoo
# required by x11-base/xorg-drivers-1.17::gentoo[video_cards_vmware]
# required by x11-base/xorg-server-1.17.1-r1::gentoo[xorg]
# required by x11-drivers/xf86-video-intel-2.99.917::gentoo
# required by @__auto_slot_operator_replace_installed__ (argument)
=media-libs/mesa-10.5.1 xa
# required by x11-drivers/xf86-video-ati-7.5.0::gentoo
# required by x11-base/xorg-drivers-1.17::gentoo[video_cards_radeon]
# required by x11-base/xorg-server-1.17.1-r1::gentoo[xorg]
# required by x11-drivers/xf86-video-intel-2.99.917::gentoo
# required by @__auto_slot_operator_replace_installed__ (argument)
=x11-libs/libdrm-2.4.59 video_cards_vmware video_cards_radeon

using the auto unmask write options causes emerge to modify /etc/portage/package.use/ by adding the change file there.

This strongly suggests that some or all of the config root redirection stops working or is not honored when package.use is a directory.

Results are unchanged if --root is specified.

Results are unchanged if $PORTAGE_CONFIGROOT/etc/portage/package.use is converted to a flat file.

Results are independent of ROOT= and PORTAGE_CONFIGROOT= settings in --config-root selected make.conf are modified.

I presume that this also means that other configuration directories (env, keyords, etc) also leak from the top-level to the target instance.

ASIDE: Things in $PORTAGE_CONFIGROOT/var/lib/portage and other paths seem to work fine.

This can cause target environments to be built incorrectly and so has unbound potential to damage data at arbitrary future runtimes by silently adding/removing features or including/excluding code from production or testing when compiling for foregn targets.

Reproducible: Always




# cat /mnt/dst/__Target_32/etc/portage/make.conf 
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=i686 -mtune=generic"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-l2 -j5"

ROOT=/mnt/dst/__Target_32/
PORTAGE_CONFIGROOT=/mnt/dst/__Target_32/

ACCEPT_KEYWORDS="~x86"
PYTHON_TARGETS="python2_7 python3_4"
USE_PYTHON="2.7 3.4"

USE="gpg X python perl icu nls threads"

LINGUAS="en en_US en_US.UTF-8 en_US.ISO-8859-1 C POSIX"
FEATURES="sandbox fixlafiles parallel-fetch sfperms userfetch"

EMERGE_DEFAULT_OPTS="--jobs=1"
Comment 1 Zac Medico gentoo-dev 2015-03-18 17:32:43 UTC
What version of sys-apps/portage do you have?

Maybe it's fixed by this commit, released in portage-2.2.16:

http://gitweb.gentoo.org/proj/portage.git/commit/?id=417fc75190eb70836de9856f35c8141cacfd49fb
Comment 2 Robert White 2015-03-26 17:33:15 UTC
(In reply to Zac Medico from comment #1)
> What version of sys-apps/portage do you have?
> 
> Maybe it's fixed by this commit, released in portage-2.2.16:
> 
> http://gitweb.gentoo.org/proj/portage.git/commit/
> ?id=417fc75190eb70836de9856f35c8141cacfd49fb

From initial description ::

>> NOTE :: emerge --version
>> Portage 2.2.17 (python 3.4.2-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.20-r2, 3.19.0-gentoo x86_64)

Far more than a config protect or autowrite issue, when using --config-root=/somplace emerge doesn't consult /someplace/etc/portage/package.use, it only consults /etc/portage/package.use which it should not consult at all.

I suspect that the other package.whatever directories/files are also affected.

I am pretty sure that the entire subsystem was missed when CONFIG_ROOT was added as it's definitely picking the master set of configs instead of the target set.