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

subprocess32 fails to compile on ancient RHEL/CentOS 5 & manylinux1 wheels - O_CLOEXEC and HAVE_PIPE2 related? #12

Closed
ldrljq opened this Issue Aug 2, 2016 · 10 comments

Comments

Projects
None yet
8 participants
@ldrljq

ldrljq commented Aug 2, 2016

OS:RHEL 5.11
PYTHON:2.7.11/12

When i use pip or python install to install this extension:
pip install subprocess32-3.2.7.tar.gz

The error messages:

Processing ./subprocess32-3.2.7.tar.gz
Installing collected packages: subprocess32
Running setup.py install for subprocess32 ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-ekkMER-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-EebZzY-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying subprocess32.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_posixsubprocess' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/python-2.7/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
_posixsubprocess.c: In function 'subprocess_cloexec_pipe':
_posixsubprocess.c:764: warning: implicit declaration of function 'pipe2'
_posixsubprocess.c:764: error: 'O_CLOEXEC' undeclared (first use in this function)
_posixsubprocess.c:764: error: (Each undeclared identifier is reported only once
_posixsubprocess.c:764: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-ekkMER-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-EebZzY-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ekkMER-build/

@dpkp

This comment has been minimized.

Show comment
Hide comment
@dpkp

dpkp Aug 4, 2016

Looks like _posixsubprocess.c depends on O_CLOEXEC which was released in glibc 2.7. RH 5.11 is glibc 2.5 ?

Should note that the manylinux1 spec also requires glibc <= 2.5, so I think that means this package cannot be packaged as a manylinux1 wheel as is.

dpkp commented Aug 4, 2016

Looks like _posixsubprocess.c depends on O_CLOEXEC which was released in glibc 2.7. RH 5.11 is glibc 2.5 ?

Should note that the manylinux1 spec also requires glibc <= 2.5, so I think that means this package cannot be packaged as a manylinux1 wheel as is.

@gpshead gpshead changed the title from subprocess32 unable to be installed via pip and python install to subprocess32 fails to compile on RHEL 5 and other ancient distros - O_CLOEXEC undeclared Aug 8, 2016

gpshead added a commit that referenced this issue Aug 8, 2016

Add missing check for O_CLOEXEC being defined
This should address issue #12 compiling on ancient Linux distros.
@szechyjs

This comment has been minimized.

Show comment
Hide comment
@szechyjs

szechyjs Sep 6, 2016

any idea when 3.2.8 with this fix will be released?

szechyjs commented Sep 6, 2016

any idea when 3.2.8 with this fix will be released?

@cwzkevin

This comment has been minimized.

Show comment
Hide comment
@cwzkevin

cwzkevin Feb 4, 2017

I have the exact same issue that we are also using RHEL 5...

cwzkevin commented Feb 4, 2017

I have the exact same issue that we are also using RHEL 5...

@wenlibin02

This comment has been minimized.

Show comment
Hide comment
@wenlibin02

wenlibin02 Feb 12, 2017

I successfully resolved the issue by uncomment the PIPE2 macro parts.

  1. pip download subprocess32; tar -zxvf xxx
  2. in file _posixsubprocess.c, uncomment the code blocks related to PIPE2: #ifdef HAVE_PIPE2 to #endif
  3. try now: python setup.py install

If necessary, code blocks related to O_CLOEXEC may also be removed.

wenlibin02 commented Feb 12, 2017

I successfully resolved the issue by uncomment the PIPE2 macro parts.

  1. pip download subprocess32; tar -zxvf xxx
  2. in file _posixsubprocess.c, uncomment the code blocks related to PIPE2: #ifdef HAVE_PIPE2 to #endif
  3. try now: python setup.py install

If necessary, code blocks related to O_CLOEXEC may also be removed.

@robertf224

This comment has been minimized.

Show comment
Hide comment
@robertf224

robertf224 Feb 23, 2017

+1 still can't build a manylinux wheel on CentOS 5

robertf224 commented Feb 23, 2017

+1 still can't build a manylinux wheel on CentOS 5

@gpshead

This comment has been minimized.

Show comment
Hide comment
@gpshead

gpshead May 28, 2017

Member

The manylinux environment described in https://github.com/pypa/manylinux is extremely old, I believe it would result in a module with substandard correctness, not just performance.

RHEL 5 and CentOS 5 are long past their lifetime. I may consider pull requests, but I'm not going to spend time in such environments banging on things to get them to work.

Member

gpshead commented May 28, 2017

The manylinux environment described in https://github.com/pypa/manylinux is extremely old, I believe it would result in a module with substandard correctness, not just performance.

RHEL 5 and CentOS 5 are long past their lifetime. I may consider pull requests, but I'm not going to spend time in such environments banging on things to get them to work.

@gpshead gpshead changed the title from subprocess32 fails to compile on RHEL 5 and other ancient distros - O_CLOEXEC undeclared to subprocess32 fails to compile on ancient RHEL/CentOS 5 & manylinux1 wheels - O_CLOEXEC and HAVE_PIPE2 related? May 28, 2017

@gpshead

This comment has been minimized.

Show comment
Hide comment
@gpshead

gpshead May 28, 2017

Member

can anyone test the current top of tree on RHEL or CentOS 5 and/or try a manylinux wheel build and report back?

Member

gpshead commented May 28, 2017

can anyone test the current top of tree on RHEL or CentOS 5 and/or try a manylinux wheel build and report back?

@matthew-brett

This comment has been minimized.

Show comment
Hide comment
@matthew-brett

matthew-brett May 29, 2017

Yes, thanks - current master does seem to compile on the manylinux docker image. I also tested automated wheel builds, built from https://github.com/MacPython/subprocess32-wheels - build and tests listed at https://travis-ci.org/MacPython/subprocess32-wheels, built wheels uploaded (automatically) to https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com from whence they can be tested.

Any chance of a release with this fix?

matthew-brett commented May 29, 2017

Yes, thanks - current master does seem to compile on the manylinux docker image. I also tested automated wheel builds, built from https://github.com/MacPython/subprocess32-wheels - build and tests listed at https://travis-ci.org/MacPython/subprocess32-wheels, built wheels uploaded (automatically) to https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com from whence they can be tested.

Any chance of a release with this fix?

@gpshead

This comment has been minimized.

Show comment
Hide comment
@gpshead

gpshead Oct 19, 2017

Member

I just pushed a sdist (source) release of 3.5.0rc1.

Member

gpshead commented Oct 19, 2017

I just pushed a sdist (source) release of 3.5.0rc1.

@gpshead

This comment has been minimized.

Show comment
Hide comment
@gpshead

gpshead Oct 19, 2017

Member

Closing this as it sounds like the build was fixed. I'm tracking if a manylinux1 wheel makes sense in #14.

Member

gpshead commented Oct 19, 2017

Closing this as it sounds like the build was fixed. I'm tracking if a manylinux1 wheel makes sense in #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment