easybuilders / easybuild

EasyBuild - building software with ease
http://easybuild.io
GNU General Public License v2.0
456 stars 142 forks source link

OpenSSL easyconfig fails to build with various python3 versions #864

Open doswellf opened 1 year ago

doswellf commented 1 year ago

Have tried to build foss22.10.eb in various virtualenv instances using pyenv. Tried 3.10.9, 3.8.15, 3.7.15, 3.9.7 in separate virtualenvs. In all cases I get a LooseVersion-related error that stops OpenSSL from building and installing. Ubuntu 22 on and AMD 12-core with a big AMD gfx1030-series gpu. Lots of memory and disk space too. Here is the message:

eb /home/py3user/.pyenv/versions/ebtest471/easybuild/easyconfigs/o/OpenSSL/OpenSSL-1.1.eb
== Temporary log file in case of crash /tmp/eb-0rwc_18y/easybuild-z3dgf5tz.log
== found valid index for /home/py3user/.pyenv/versions/ebtest471/easybuild/easyconfigs, so using it...
== processing EasyBuild easyconfig /home/py3user/.pyenv/versions/ebtest471/easybuild/easyconfigs/o/OpenSSL/OpenSSL-1.1.eb
ERROR: Traceback (most recent call last):
  File "/home/py3user/.pyenv/versions/ebtest471/lib/python3.10/site-packages/easybuild/main.py", line 133, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/home/py3user/.pyenv/versions/ebtest471/lib/python3.10/site-packages/easybuild/framework/easyblock.py", line 4174, in build_and_install_one
    app = app_class(ecdict['ec'])
  File "/home/py3user/.pyenv/versions/ebtest471/lib/python3.10/site-packages/easybuild/easyblocks/o/openssl_wrapper.py", line 178, in __init__
    if LooseVersion(openssl_version) >= LooseVersion(min_openssl_version):
  File "/home/py3user/.pyenv/versions/ebtest471/lib/python3.10/site-packages/setuptools/_distutils/version.py", line 90, in __ge__
    c = self._cmp(other)
  File "/home/py3user/.pyenv/versions/ebtest471/lib/python3.10/site-packages/setuptools/_distutils/version.py", line 350, in _cmp
    if self.version == other.version:
AttributeError: 'LooseVersion' object has no attribute 'version'

I even tried to hack the openssl.py in the easyconfigs but that just created a chain-reaction of more errors.

Not sure how to debug this one, as I use python but haven't gone that deep into package development. And easybuild was supposed to prevent that anyways.

boegel commented 1 year ago

This looks like a bug in the setuptools installation being used here... Which Python package versions do you have installed in that environment?

ocaisa commented 1 year ago

@doswellf in https://github.com/easybuilders/easybuild-easyblocks/pull/2914 we've fixed the (immediate) issue you were running into. You can use this fix with

eb --include-easyblocks-from-pr=2914 OpenSSL-1.1.eb

It's interesting to see exactly why you ran into this code path. Since you're using a very recent OS, I wonder if there is something wrong with our version detection in

https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/o/openssl_wrapper.py#L167-L176

Can you please run the installation with a --debug flag for a debug log and then search through the logfile:

grep 'Could not detect' <log file>
boegel commented 1 year ago

Part of the problem here is probably that Ubuntu 22.04 comes with OpenSSL 3.0.x (which implies that installing OpenSSL-1.1.eb will make EasyBuild do a from-source installation of OpenSSL 1.1)

I gave it a quick try in a Ubuntu 22.04 container, and I didn't see a problem when installing OpenSSL-1.1.eb using EasyBuild v4.7.1, so there's something system-specific here that is confusing the OpenSSL_wrapper easyblock.

A full (debug) EasyBuild log file would be very helpful here, indeed.

doswellf commented 11 months ago

Sorry I missed your replies in March - I have tried Nobara Linux (fedora based) and have run into the problem again. Will log and post the python3 and other versions here by the end of this week.