Summary: | sys-apps/portage: empty profile triggers KeyError: u'ARCH' in pym/portage/package/ebuild/config.py", line 2629, in _getitem | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Martin Mokrejš <mmokrejs> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alt, belliash, O01eg |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 637452 |
Description
Martin Mokrejš
2016-06-17 16:32:41 UTC
(In reply to Martin Mokrejš from comment #0) > !!! /scratch/mmokrejs/gentoo/tmp/etc/portage/make.profile is not a symlink > and will probably prevent most merges. > !!! It should point into a profile within > /scratch/mmokrejs/gentoo/usr/portage/profiles/ > !!! (You can safely ignore this message when syncing. It's harmless.) The KeyError is a result of the above problem. Apparently $EPREFIX/etc/portage/make.profile does not point to a valid profile. The profile_check function inside pym/_emerge/main.py needs to be fixed to identify this case. It seems that root_trees["root_config"].settings.profiles is non-empty, even though root_trees["root_config"].settings.profile_path is None. Both the profiles and profile_path attributes come from the LocationsManager class. We should probably fix LocationsManager so that the profiles attribute is always empty when the profile_path attribute is None. Using the master branch of portage, the profile_check function works properly, causing it to bail out before the KeyError would occur. Tested with v2.2.28 and current master branch, it bails out as follows: !!! /etc/portage/make.profile is not a symlink and will probably prevent most merges. !!! It should point into a profile within /usr/portage/profiles/ !!! (You can safely ignore this message when syncing. It's harmless.) !!! Your current profile is invalid. If you have just changed your profile !!! configuration, you should revert back to the previous configuration. !!! Allowed actions are limited to --help, --info, --search, --sync, and !!! --version. It's reproducible with the master branch when /etc/portage/make.profile is an empty directory. We've got this ARCH sanity check in pym/_emerge/Scheduler.py, which we can move to profile_check function in pym/_emerge/main.py: https://gitweb.gentoo.org/proj/portage.git/commit/?id=df2c91cfdfbb827b61d4d3b7de6817a9ccd31a5d The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=a544824d5f62d26b08826c991275ed8e0e70f525 commit a544824d5f62d26b08826c991275ed8e0e70f525 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2017-12-02 22:26:49 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2017-12-02 22:33:06 +0000 profile_check: detect missing ARCH variable (bug 586214) The Scheduler._env_sanity_check method executed too late to prevent a KeyError for ARCH in getmaskingstatus, so use profile_check to detect missing ARCH and exit earlier. Bug: https://bugs.gentoo.org/586214 pym/_emerge/Scheduler.py | 36 ------------------------------------ pym/_emerge/main.py | 3 ++- pym/portage/package/ebuild/config.py | 4 +++- 3 files changed, 5 insertions(+), 38 deletions(-)} *** Bug 640676 has been marked as a duplicate of this bug. *** I got this error with crossdev when /usr/mipsel-hardfloat-linux-uclibc/etc/portage/make.profile points to /usr/portage/profiles/embedded |