Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

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

@ldrljq
Copy link

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
Copy link

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 subprocess32 unable to be installed via pip and python install 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
This should address issue #12 compiling on ancient Linux distros.
@szechyjs
Copy link

szechyjs commented Sep 6, 2016

any idea when 3.2.8 with this fix will be released?

@cwzkevin
Copy link

cwzkevin commented Feb 4, 2017

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

@wenlibin02
Copy link

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
Copy link

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

@gpshead
Copy link
Contributor

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 subprocess32 fails to compile on RHEL 5 and other ancient distros - O_CLOEXEC undeclared subprocess32 fails to compile on ancient RHEL/CentOS 5 & manylinux1 wheels - O_CLOEXEC and HAVE_PIPE2 related? May 28, 2017
@gpshead
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

gpshead commented Oct 19, 2017

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

@gpshead
Copy link
Contributor

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.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants