Comments (15)
python 2 is EOL, no further updates to this project.
from python-subprocess32.
More generally, the .c
files in subprocess32
contains lots of checks of the form #ifdef HAVE_FOO
. However, those cannot be expected to work properly because this backport is missing the configure
script from Python 3.x which sets all those macros. Some of those macros also appear in Python 2.7, so those are safe. But others like HAVE_DIRFD
do not exist in Python 2.7.
So I think that you should also use the configure
script from Python 3.x in subprocess32
.
from python-subprocess32.
I'd rather not require autoconf for this project, especially given the small number of defines not available in 2.7. Could we put specific platform+version checks in setup.py that set the necessary extra CFLAGS for the extension?
from python-subprocess32.
Well, gcc does not have anything useful for this purpose defined on Solaris 11. In Python you can do
In [6]: os.uname()
Out[6]: ('SunOS', 'xenos-sagetest', '5.11', '11.3', 'sun4v')
and so you'd need to check 1st entry for SunOS
, and then check for 5.11
(3rd entry) to generate -DHAVE_DIRFD
in your compiler flags.
from python-subprocess32.
Could we put specific platform+version checks in setup.py that set the necessary extra CFLAGS for the extension?
The problem is that you will end up with a bunch a special cases for specific platforms but no general solution.
from python-subprocess32.
For the record, the macros missing from Python 2.7.14 are
HAVE_DIRFD
HAVE_PIPE2
HAVE_SYS_SYSCALL_H
from python-subprocess32.
Please give pull request #48 a try on your systems and report back.
from python-subprocess32.
I just put up a 3.5.0rc3, please give it a try.
from python-subprocess32.
3.5.0 should fix this but i have no ability to test. report and issue if not.
from python-subprocess32.
well, no, there is a bug with recognising working C compiler:
[subprocess32-3.5.0] Installing collected packages: subprocess32
[subprocess32-3.5.0] Running setup.py install for subprocess32: started
[subprocess32-3.5.0] Running command /datapool/dima/Sage/sagetrac-mirror/local/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-1WyU_b-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" --no-user-cfg install --record /tmp/pip-vPZNo1-record/install-record.txt --single-version-externally-managed --compile
[subprocess32-3.5.0] running install
[subprocess32-3.5.0] running build
[subprocess32-3.5.0] running build_py
[subprocess32-3.5.0] creating build
[subprocess32-3.5.0] creating build/lib.solaris-2.11-sun4v.64bit-2.7
[subprocess32-3.5.0] copying subprocess32.py -> build/lib.solaris-2.11-sun4v.64bit-2.7
[subprocess32-3.5.0] running build_ext
[subprocess32-3.5.0] running build_configure
[subprocess32-3.5.0] checking for gcc... gcc
[subprocess32-3.5.0] checking whether the C compiler works... yes
[subprocess32-3.5.0] checking for C compiler default output file name... a.out
[subprocess32-3.5.0] checking for suffix of executables...
[subprocess32-3.5.0] checking whether we are cross compiling... configure: error: in `/tmp/pip-1WyU_b-build':
[subprocess32-3.5.0] configure: error: cannot run C compiled programs.
[subprocess32-3.5.0] If you meant to cross compile, use `--host'.
from python-subprocess32.
here is the relevant part of config.log
## Core tests. ##
## ----------- ##
configure:2341: checking for gcc
configure:2368: result: gcc
configure:2597: checking for C compiler version
configure:2606: gcc --version >&5
gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2617: $? = 0
configure:2606: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/datapool/dima/libexec/gcc/sparcv9-sun-solaris2.11/7.2.0/lto-wrapper
Target: sparcv9-sun-solaris2.11
Configured with: ./configure --prefix=/datapool/dima --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --with-mpc=/usr --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --enable-languages=c,c++,fortr
an --enable-shared --enable-initfini-array --with-system-zlib --with-as=/usr/gnu/bin/as --build=sparcv9-sun-solaris2.11
Thread model: posix
gcc version 7.2.0 (GCC)
configure:2617: $? = 0
configure:2606: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2617: $? = 1
configure:2606: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:2617: $? = 1
configure:2637: checking whether the C compiler works
configure:2659: gcc -L/datapool/dima/Sage/sagetrac-mirror/local/lib -Wl,-rpath,/datapool/dima/Sage/sagetrac-mirror/local/lib conftest.c >&5
configure:2663: $? = 0
configure:2711: result: yes
configure:2714: checking for C compiler default output file name
configure:2716: result: a.out
configure:2722: checking for suffix of executables
configure:2729: gcc -o conftest -L/datapool/dima/Sage/sagetrac-mirror/local/lib -Wl,-rpath,/datapool/dima/Sage/sagetrac-mirror/local/lib conftest.c >&5
configure:2733: $? = 0
configure:2755: result:
configure:2777: checking whether we are cross compiling
configure:2785: gcc -o conftest -L/datapool/dima/Sage/sagetrac-mirror/local/lib -Wl,-rpath,/datapool/dima/Sage/sagetrac-mirror/local/lib conftest.c >&5
In file included from /datapool/dima/lib/gcc/sparcv9-sun-solaris2.11/7.2.0/include-fixed/stdio.h:24:0,
from conftest.c:17:
/datapool/dima/lib/gcc/sparcv9-sun-solaris2.11/7.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
^~~~~
configure:2789: $? = 1
configure:2796: ./conftest
./configure[2798]: eval[1]: ./conftest: not found [No such file or directory]
configure:2800: $? = 127
configure:2807: error: in `/datapool/dima/Sage/sagetrac-mirror/local/var/tmp/sage/build/subprocess32-3.5.0/src':
configure:2809: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
from python-subprocess32.
I suspect you're doing something outdated for Solaris in configure.ac, as we are perfectly able to use autoconf with the setup I'm testing this on.
from python-subprocess32.
You probably need to call AC_PROG_CC
, too. If I put it right after AC_INIT
then something more meaningful happens, even though no headers are recognised:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E -traditional-cpp
checking for grep that handles long lines and -e... /opt/csw/gnu/grep
checking for egrep... /opt/csw/gnu/grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for unistd.h... (cached) no
checking fcntl.h usability... no
checking fcntl.h presence... no
checking for fcntl.h... no
checking sys/cdefs.h usability... no
checking sys/cdefs.h presence... no
checking for sys/cdefs.h... no
checking for sys/types.h... (cached) no
checking for sys/stat.h... (cached) no
checking sys/syscall.h usability... no
checking sys/syscall.h presence... yes
configure: WARNING: sys/syscall.h: present but cannot be compiled
configure: WARNING: sys/syscall.h: check for missing prerequisite headers?
configure: WARNING: sys/syscall.h: see the Autoconf documentation
configure: WARNING: sys/syscall.h: section "Present But Cannot Be Compiled"
configure: WARNING: sys/syscall.h: proceeding with the compiler's result
configure: WARNING: ## ------------------------------------------------------------- ##
configure: WARNING: ## Report this to https://github.com/google/python-subprocess32/ ##
configure: WARNING: ## ------------------------------------------------------------- ##
checking for sys/syscall.h... no
checking for dirent.h that defines DIR... no
checking for sys/ndir.h that defines DIR... no
checking for sys/dir.h that defines DIR... no
checking for ndir.h that defines DIR... no
checking for library containing opendir... none required
checking for pipe2... no
checking for setsid... no
checking whether dirfd is declared... no
configure: creating ./config.status
config.status: creating _posixsubprocess_config.h
from python-subprocess32.
odd environment. Python setuptools knows how to invoke the C compiler itself; I think figuring out how to get that from Python and plumb that through to the configure run (via CC= and potentially CFLAGS=) would make sense. even if configure finds a compiler toolchain on its own, there is no guarantee that it is the one used by Python.
from python-subprocess32.
The compiler toolchain is not important. The checks you are doing involving OS features which shouldn't depend on the compiler. Of course, you do need a working compiler.
from python-subprocess32.
Related Issues (20)
- Issue with _posixsubprocess when importing subprocess32 HOT 1
- How to specify dependency to subprocess32? HOT 4
- Error during pip install on ubuntu HOT 15
- Next release? rc1 out since 6 months HOT 3
- Is it possible to pip install this package without compiling C-extension? HOT 4
- build fails on FreeBSD 11.1 HOT 4
- error: package directory 'python3_redirect' does not exist HOT 5
- Missing local import: warnings
- AttributeError: 'module' object has no attribute 'Signals' HOT 2
- subprocess.run is not backported to python 3.4 HOT 2
- Heap Overflow in _PySequence_BytesToCharpArray HOT 1
- TimeoutExpired is not pickleable. HOT 1
- subprocess32 doesn't include updates from 3.7 HOT 2
- subprocess32 does not have a binary manylinux1 wheel HOT 3
- Not a full replacement for subprocess of Python 2.7 HOT 1
- build fails on archlinux HOT 2
- universal_newlines=True behaves differently on 3.5 and 2.7 HOT 1
- Different behaviour when running subprocess in python 2.7.12 and python 3.6.9
- Timeout doesn't work properly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-subprocess32.