0

I have installed openssl version 1.1.1 on RHEL 7.9 and I am running the following commands

./configure --with-openssl=/opt/python/ssl --with-openssl-rpath=auto
make -j8

My gcc version is:

gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 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.

I am seeing this output.

./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
Could not import runpy module
Traceback (most recent call last):
  File "/tmp/Python-3.10.9/Lib/runpy.py", line 15, in <module>
    import importlib.util
  File "/tmp/Python-3.10.9/Lib/importlib/util.py", line 14, in <module>
    from contextlib import contextmanager
  File "/tmp/Python-3.10.9/Lib/contextlib.py", line 4, in <module>
    import _collections_abc
SystemError: <built-in function compile> returned NULL without setting an exception
generate-posix-vars failed
ScipioAfricanus
  • 1,331
  • 6
  • 18
  • 39
  • Related: https://stackoverflow.com/q/58048079/11082165 – Brian61354270 Feb 06 '23 at 18:09
  • I configure with and without optimization, doesnt help. I do need the ssl flags.. anything else I can try? make clean didnt make much of a difference. – ScipioAfricanus Feb 06 '23 at 18:18
  • 1
    @ScipioAfricanus: Did you [install all the relevant dependencies](https://devguide.python.org/getting-started/setup-building/#build-dependencies) for building Python? – ShadowRanger Feb 06 '23 at 18:19
  • looks like I already had yum-utls and yum-builddep python3 gives this: for No uninstalled build requires – ScipioAfricanus Feb 06 '23 at 18:21
  • update, I was able to run ./configure without any flags , and it seems to build fine. But it built without openssl lib, which I need to pass some internal audit in my org. I am running it on rhel7. – ScipioAfricanus Feb 06 '23 at 18:25
  • @ScipioAfricanus: As a side-note: That's a *really* old version of gcc at this point. I know RHEL is weird and old a lot of the time (and sometimes not as old as it seems, backporting way more than you'd think without bumping version numbers). I wouldn't be surprised if the cool stuff, like auto-configuring the RPATH for OpenSSL, had some dependency on newer build-utils or gcc or the like. Might see if you can get newer stuff from SCL, e.g. `devtoolset-11`, and set up your build environment to prefer it over the ancient core build tools? – ShadowRanger Feb 06 '23 at 18:32
  • so I have a development env with the same GCC and RHEL version as the prod version, these commands seem to work on prod and not dev, I was wondering what I could be missing, How I could diagnose/pinpoint what the difference is. I can look into installing a newer version of gcc in prod. – ScipioAfricanus Feb 06 '23 at 19:18
  • I notice in yum, "devtoolset-12-gcc-c++.x86_64 : C++ support for GCC version 12" I also have gcc 11 available, are you suggesting I install one of these? That may let me compile python? – ScipioAfricanus Feb 06 '23 at 19:29

0 Answers0