In stage1 a (non-fatal) failure occurs during install of python, during install of pip. Pip needs pyexpat, but pyexpat is disabled in build config. Since libexpat is a library with no dependencies, the attached patch proposes to bootstrap it and enable pyexpat module, so that the python install is not doomed to never succeed. Tested on CentOS7. If there is interest, I might be able to help test on OS X and Windows. Reproducible: Always Steps to Reproduce: 1. ./bootstrap-prefix.sh myprefix stage1 Actual Results: This (non-fatal) error in the output log: ModuleNotFoundError: No module named 'pyexpat' make: *** [Makefile:1102: install] Error 1 ??? Python failed to install *sigh* continuing anyway * Python bootstrapped Expected Results: After applying the attached patch: Collecting setuptools Collecting pip Installing collected packages: setuptools, pip Successfully installed pip-18.1 setuptools-40.6.2 * Python bootstrapped
Created attachment 629252 [details, diff] Patch to bootstrap libexpat and enable pyexpat for pip
Same on my Arch, and the patch is useful but out-of-date
Thanks for bringing this up. However, we do not want to expand the things to compile at stage1 if not absolutely necessary. Pip is of no use to us. Please use the full featured Python from stage 3.
Then, this message should be removed: ??? Python failed to install *sigh* continuing anyway The failure path is then the normal path, and the tool should not print an error. By the way, it takes negligible time to compile expat and it has no dependencies. Not sure why you are worried about including it as a dependency of a component that is required (Python).
We should disable expat from the bootstrap python I think. The reason the thing continues whilst complaining is to indicate that we're in a sub-optimal state, but it we get enough to run portage, then it's going to be resolved eventually.
@Fabian, agreed that the error should stay non-fatal and prefix build should continue, also agreed that disabling expat would be ideal, but that's the issue -- expat is disabled already, but the build of Python (specifically PIP) does not succeed without expat. Maybe the correct fix is to disable pip, isn't it?
ah, yes, pip is not required at this stage indeed.
(In reply to Alexei Colin from comment #6) > @Fabian, agreed that the error should stay non-fatal and prefix build should > continue, also agreed that disabling expat would be ideal, but that's the > issue -- expat is disabled already, but the build of Python (specifically > PIP) does not succeed without expat. Maybe the correct fix is to disable > pip, isn't it? That makes more sense here. As an absolute minimal python is needed here, if your patch were disabling pip, I would be happy to accept it.
(In reply to Alexei Colin from comment #4) > By the way, it takes negligible time to compile expat and it has no > dependencies. Not sure why you are worried about including it as a > dependency of a component that is required (Python). Be careful introducing new dependencies in stage1. It is the most fragile part of bootstrap, what works rock solid now might introduce failures in the future. That's why I am super conservative on stage1.
Created attachment 642382 [details, diff] Patch to disable Pip from Python build. Attached a tiny patch that disables Pip. Tested build through all stages with patch on top of latest master (c9c2e1e) on centos7: same error without patch, no error with patch. @Benda, how does this one look?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=91cc96f4ef5489dcf33724b5c3c615b59b7f5047 commit 91cc96f4ef5489dcf33724b5c3c615b59b7f5047 Author: Alexei Colin <acolin@isi.edu> AuthorDate: 2020-05-28 18:23:49 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2020-05-29 06:22:10 +0000 bootstrap-prefix.sh: exclude pip from Python build #715974 Pip is not needed but it fails to build due to lack of pyexpat, which generates a non-fatal error during boostrap of stage1: ModuleNotFoundError: No module named 'pyexpat' make: *** [Makefile:1102: install] Error 1 ??? Python failed to install *sigh* continuing anyway * Python bootstrapped Closes: https://bugs.gentoo.org/715974 Signed-off-by: Alexei Colin <acolin@isi.edu> Signed-off-by: Fabian Groffen <grobian@gentoo.org> scripts/bootstrap-prefix.sh | 1 + 1 file changed, 1 insertion(+)
Thanks for taking the time to figure it out, patch applied!