Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIX build is broken because of _bootsubprocess removal. #96305

Closed
ayappanec opened this issue Aug 26, 2022 · 3 comments
Closed

AIX build is broken because of _bootsubprocess removal. #96305

ayappanec opened this issue Aug 26, 2022 · 3 comments
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@ayappanec
Copy link
Contributor

ayappanec commented Aug 26, 2022

Building the main branch in AIX is broken with the below error.

./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
fi
Traceback (most recent call last):
  File "/home/buildusr/cpython_master/cpython/Lib/_aix_support.py", line 7, in <module>
    import subprocess
  File "/home/buildusr/cpython_master/cpython/Lib/subprocess.py", line 104, in <module>
    from _posixsubprocess import fork_exec as _fork_exec
ModuleNotFoundError: No module named '_posixsubprocess'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 851, in <module>
    _main()
  File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 839, in _main
    _generate_posix_vars()
  File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 511, in _generate_posix_vars
    pybuilddir = f'build/lib.{get_platform()}-{_PY_VERSION_SHORT}'
                              ^^^^^^^^^^^^^^
  File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 781, in get_platform
    from _aix_support import aix_platform
  File "/home/buildusr/cpython_master/cpython/Lib/_aix_support.py", line 11, in <module>
    import _bootsubprocess as subprocess
ModuleNotFoundError: No module named '_bootsubprocess'
generate-posix-vars failed
gmake: *** [Makefile:871: pybuilddir.txt] Error 1
gmake: *** Waiting for unfinished jobs....

Earlier the _bootsubprocess was supporting _aix_support during the building stage. With it being gone via #94474 and unable to find _posixsubprocess module, it fails. But I see _posixsubprocess is already build as part of the shared modules target inside the Modules directory.

Linked PRs

@ayappanec ayappanec added the type-bug An unexpected behavior, bug, or error label Aug 26, 2022
@AlexWaygood AlexWaygood added the build The build process and cross-build label Aug 26, 2022
@tiran
Copy link
Member

tiran commented Aug 26, 2022

_bootsubprocess was removed because it was a hack which is no longer needed for any supported platforms. I didn't realize that it is used by AIX because that platform is no longer supported by us.

I recommend that you replace the _aix_support code with autoconf -- either the entire module or at least the part that depends on subprocess.

@ayappanec
Copy link
Contributor Author

ayappanec commented Aug 29, 2022

I see there is a _read_output function in _osx_support that can be used here when subprocess is not available.
I did some testing and it seems to be working.

ayappanec added a commit to ayappanec/cpython that referenced this issue Nov 15, 2022
gpshead pushed a commit that referenced this issue Feb 2, 2023
* Fix AIX build by avoiding `subprocess` during bootstrap.
@ayappanec
Copy link
Contributor Author

Thanks @gpshead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants