Maybe this is a dupe of bug #575070 ? I follow https://wiki.gentoo.org/wiki/Project:Prefix/Bootstrap and ./bootstrap-prefix.sh gave me: ... !!! /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.) !!! Problem with sandbox binary. Disabling... These are the packages that would be merged, in order: ================================================================================================ ======== Traceback for invalid call to portage.package.ebuild.config.config.__getitem__ ======== File "/scratch/mmokrejs/gentoo/tmp/usr/bin/emerge", line 50, in <module> retval = emerge_main() File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/main.py", line 1185, in emerge_main return run_action(emerge_config) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 3273, in run_action emerge_config.args, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 325, in action_build settings, trees, myopts, myparams, myaction, myfiles, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9196, in backtrack_depgraph myaction, myfiles, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9233, in _backtrack_depgraph success, favorites = mydepgraph.select_files(myfiles) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3583, in select_files return self._select_files(args) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3926, in _select_files return self._resolve(myfavorites) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3990, in _resolve myroot, atom, onlydeps=onlydeps) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5324, in _select_pkg_highest_available ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps, parent=parent) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5558, in _select_pkg_highest_available_imp autounmask_level=autounmask_level, parent=parent) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5899, in _wrapped_select_pkg_highest_available_imp if not self._pkg_visibility_check(pkg, autounmask_level): File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5596, in _pkg_visibility_check mreasons = _get_masking_status(pkg, pkgsettings, root_config, use=self._pkg_use_enabled(pkg)) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9479, in _get_masking_status portdb=root_config.trees["porttree"].dbapi, myrepo=myrepo) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/getmaskingstatus.py", line 100, in _getmaskingstatus myarch = settings["ARCH"] File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", line 2576, in __getitem__ return self._getitem(key) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", line 2629, in _getitem raise KeyError(mykey) KeyError: u'ARCH' ================================================================================================ !!! Problem in 'sys-libs/ncurses' dependencies. !!! u'ARCH' None Traceback (most recent call last): File "/scratch/mmokrejs/gentoo/tmp/usr/bin/emerge", line 50, in <module> retval = emerge_main() File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/main.py", line 1185, in emerge_main return run_action(emerge_config) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 3273, in run_action emerge_config.args, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 325, in action_build settings, trees, myopts, myparams, myaction, myfiles, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9196, in backtrack_depgraph myaction, myfiles, spinner) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9233, in _backtrack_depgraph success, favorites = mydepgraph.select_files(myfiles) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3583, in select_files return self._select_files(args) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3926, in _select_files return self._resolve(myfavorites) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 3990, in _resolve myroot, atom, onlydeps=onlydeps) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5324, in _select_pkg_highest_available ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps, parent=parent) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5558, in _select_pkg_highest_available_imp autounmask_level=autounmask_level, parent=parent) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5899, in _wrapped_select_pkg_highest_available_imp if not self._pkg_visibility_check(pkg, autounmask_level): File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 5596, in _pkg_visibility_check mreasons = _get_masking_status(pkg, pkgsettings, root_config, use=self._pkg_use_enabled(pkg)) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/_emerge/depgraph.py", line 9479, in _get_masking_status portdb=root_config.trees["porttree"].dbapi, myrepo=myrepo) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/getmaskingstatus.py", line 100, in _getmaskingstatus myarch = settings["ARCH"] File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", line 2576, in __getitem__ return self._getitem(key) File "/scratch/mmokrejs/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", line 2629, in _getitem raise KeyError(mykey) KeyError: u'ARCH' Odd! Running /bin/bash ./bootstrap-prefix.sh "/scratch/mmokrejs/gentoo" stage2 failed! :( Details might be found in the build log: (no build logs found?!?) I have no clue, really. Please find friendly folks in #gentoo-prefix on irc.gentoo.org, gentoo-alt@lists.gentoo.org mailing list, or file a bug at bugs.gentoo.org under Gentoo/Alt, Prefix Support. I am defeated. I am of no use here any more. Maybe you can find some clues in /scratch/mmokrejs/gentoo/stage2.log
(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