Re: Installing Python2.7 in 14-RELEASE

From: Odhiambo Washington <odhiambo_at_gmail.com>
Date: Tue, 14 May 2024 08:39:30 UTC
On Mon, May 13, 2024 at 4:13 PM Herbert J. Skuhra <herbert@gojira.at> wrote:

> On Mon, 13 May 2024 14:31:16 +0200, Odhiambo Washington wrote:
> >
> > Hi
> >
> > I need to install Python27 from /usr/ports/lang/python27 to test
> something,
> > but it fails:
> >
> > ```
> > root@gw:/usr/ports/lang/python27 # make reinstall clean
> > ===>  Deinstalling for python27
> > ===>   python27 not installed, skipping
> > ===>  Installing for python27-2.7.18
> > ===>  Checking if python27 is already installed
> > ===>   Registering installation for python27-2.7.18
> > pkg-static: Unable to access file
> >
> /usr/ports/lang/python27/work/stage//lib/python2.7/lib-dynload/_hashlib.so:No
> > such file or directory
> > *** Error code 1
> >
> > Stop.
> > make[1]: stopped in /usr/ports/lang/python27
> > *** Error code 1
> >
> > Stop.
> > make: stopped in /usr/ports/lang/python27
> > ```
> >
> > The files missing are actually
> > in
> /usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/.
> >
> > How can I solve this problem?
>
> Works for me on stable/14 (amd64) and main(arm64):
>
> % find work/stage -name "_hashlib.so"
> work/stage/usr/local/lib/python2.7/lib-dynload/_hashlib.so
>
> Do you use openssl/libressl from ports? Can you check the build log
> for more information?


I am using openssl from the ports.
I checked the build log and saw:

```
#warning "Make sure new member of socket address initialized"
 ^
1 warning generated.
warning: openssl 0x00000000 is too old for _hashlib
building dbm using ndbm

Python build finished, but the necessary bits to build these modules were
not found:
_bsddb             _hashlib           dl
imageop            linuxaudiodev      spwd
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the
module's name.

===>  Staging for python27-2.7.18
===>   python27-2.7.18 depends on file: /usr/local/lib/libcrypto.so.12 -
found
===>   Generating temporary packing list
install  -s -m 555 python
/usr/ports/lang/python27/work/stage/usr/local/bin/python2.7
if test -f libpython2.7.so; then  if test -n "" ; then  install  -s -m 0644
 /usr/ports/lang/python27/work/stage/usr/local/bin;  else  install  -s -m
0644 libpython2.7.so
/usr/ports/lang/python27/work/stage/usr/local/lib/libpython2.7.so.1;  if
test libpython2.7.so != libpython2.7.so.1; then  (cd
/usr/ports/lang/python27/work/stage/usr/local/lib; ln -sf libpython2.7.so.1
libpython2.7.so)  fi  fi;  else true;  fi
warning: openssl 0x00000000 is too old for _hashlib
```
root@gw:/usr/ports/lang/python27 # /usr/local/bin/openssl version
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
root@gw:/usr/ports/lang/python27 # ls -al  /usr/local/bin/openssl
-rwxr-xr-x  1 root wheel 828656 May 14 11:22 /usr/local/bin/openssl
root@gw:/usr/ports/lang/python27 # ls -al /usr/bin/openssl
-r-xr-xr-x  1 root wheel 970624 Nov 25 14:13 /usr/bin/openssl
root@gw: /usr/ports/lang/python27  # /usr/bin/openssl version
OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

I have DEFAULT_VERSIONS+=ssl=openssl



-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
 In an Internet failure case, the #1 suspect is a constant: DNS.
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]