openvpn3-linux icon indicating copy to clipboard operation
openvpn3-linux copied to clipboard

openvpn3 FTBFS on fedora-39[beta]

Open ojab opened this issue 2 years ago • 7 comments

My fork of dsommers/openvpn3 copr (here) fails with

make[4]: Entering directory '/builddir/build/BUILD/openvpn3-linux-20/src/python'
 /usr/bin/mkdir -p '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/bin'
 /usr/bin/install -p openvpn2 openvpn3-as '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/bin'
 /usr/bin/mkdir -p '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/sbin'
 /usr/bin/install -p openvpn3-autoload '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/sbin'
  GEN      openvpn3/constants.py
touch --reference=../../src/python/openvpn3/gen-python-constants.cpp openvpn3/constants.py
 /usr/bin/mkdir -p '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/lib/python3.12/site-packages/openvpn3'
 /usr/bin/install -p -m 644 openvpn3/constants.py '/builddir/build/BUILDROOT/openvpn3-20-2.fc39.x86_64/usr/lib/python3.12/site-packages/openvpn3'
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
make[4]: *** [Makefile:568: install-nodist_pkgopenvpn3PYTHON] Error 1
make[4]: Leaving directory '/builddir/build/BUILD/openvpn3-linux-20/src/python'
make[3]: *** [Makefile:753: install-am] Error 2
make[3]: Leaving directory '/builddir/build/BUILD/openvpn3-linux-20/src/python'
make[2]: *** [Makefile:746: install] Error 2
make[2]: Leaving directory '/builddir/build/BUILD/openvpn3-linux-20/src/python'
make[1]: *** [Makefile:4291: install-recursive] Error 1
make[1]: Leaving directory '/builddir/build/BUILD/openvpn3-linux-20'
make: *** [Makefile:4770: install] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.usLVnq (%install)
    %patchN is deprecated (1 usages found), use %patch N (or %patch -P N)
    Bad exit status from /var/tmp/rpm-tmp.usLVnq (%install)

imp module is deprecated in Python-3.4 in favor of importlib and was removed in Python-3.12, which is used in Fedora-39 (beta is going to be released next week or following week).

ojab avatar Sep 08 '23 14:09 ojab

The fix https://gitlab.com/ojab/copr-openvpn3/-/compare/master...master?from_project_id=5398816 (I can't find a button to make a merge request there), test run https://copr.fedorainfracloud.org/coprs/ojab/openvpn3/build/6393948/

ojab avatar Sep 11 '23 11:09 ojab

This is quite surprising, but I see that the autotools' provided py-compile pulls in the imp module.

Perhaps it's time to redo the Python packaging completely. I can plan that for a coming v22_dev which will be targeting non-stable/LTS distros (basically Fedora, Ubuntu 23.04/23.10, etc). The next v21 release will be only be stable/LTS distros (Debian, Ubuntu LTS 22.04, RHEL with clones). This split is due to issues related glib2-2.76 (tracked in issue #171) and newer.

For some time I have pondered on moving the ./src/python code into a separate git repository, using the standard python tool chain for building, packaging and distribution. The .deb and .rpm packaging can pull in both releases when doing the build, so we can still have the distribution somewhat like it is today.

If anyone is willing to look into this, reach out to me (you'll find my e-mail address in the git log) and we find a way going forward.

dsommers avatar Sep 12 '23 08:09 dsommers

The fix https://gitlab.com/ojab/copr-openvpn3/-/compare/master...master?from_project_id=5398816 (I can't find a button to make a merge request there), test run https://copr.fedorainfracloud.org/coprs/ojab/openvpn3/build/6393948/

@ojab Thanks for that patch! I'll pull that in for the copr repos, but that will be tied to the v22_dev release if we don't don't split out the python code into a separate project.

dsommers avatar Sep 12 '23 09:09 dsommers

@dsommers

This split is due to issues related glib2-2.76 (tracked in issue https://github.com/OpenVPN/openvpn3-linux/issues/171) and newer.

TBH I don't get what's the issue, package from my copr fork works here (Fedora-39, glib2-2.77.3-2.fc39.x86_64, openvpn3 session-start --config xx.ovpn connects fine w/ CloudConnexa and I can use the VPN), worked on Fedora-38 before the update as well.

Thanks for that patch! I'll pull that in for the copr repos, but that will be tied to the v22_dev release if we don't don't split out the python code into a separate project.

Does it mean that there wouldn't be v20/v21 packages for Fedora-39? As I wrote, it works fine here, so I could proceed using my copr fork, but would prefer to have more upstream solution (i. e. your copr) for sure.

ojab avatar Sep 12 '23 09:09 ojab

TBH I don't get what's the issue, package from my copr fork works here

Some VPN profiles works, but many configuration profiles makes openvpn3-service-client and openvpn3-service-sessionmgr segfault. It is a higher chance that it works well if the profile does not request any user credentials by the user. If web-based authentication is used, it might work somewhat better too - but not always.

Does it mean that there wouldn't be v20/v21 packages for Fedora-39?

v22_dev is the first planned update for Fedora. The refactored glib2 integration was long over due, and that it might work with the current implementation is no guarantee it will be stable any more. The glib2 libraries has also been through some larger changes since 2.76, which is what triggered the misbehaviour in OpenVPN 3 Linux.

As the refactoring for OpenVPN 3 Linux moved forward, several implementation errors and ugly hacks has been discovered and cleaned up - which also fixes some stray memory pointers and hard to catch memory leaks (some of it may be glib2 internals which valgrind might not quite grasp, but not all of it). It also improves the data passing between the C++ to C to C++ layers using safer mechanisms, and most of the valgrind complaints have improved as well. Performance wise, several locking situations are avoided too.

I understand this waiting is painful. But as I started digging into these issues, it was either to spend lots of time adding more hacks and workarounds where the outcome was not that predictable - or to clean it up more properly. Even though lots of time is spent adding a better C++ API for D-Bus integration, I'm also trying to restrict it to what is really needed to do now to not delay the wait for too long.

dsommers avatar Sep 12 '23 20:09 dsommers

just want to confirm the packages from @ojab work for me on Fedora 39. Thank you. Looking forward to the improved version in the dsommers repo, but great to have working openvpn3!

VGerris avatar Dec 03 '23 21:12 VGerris

Realised this one has gone a bit under the radar, and there has been made some progress. But still quite a bit from ready to close it. Most of the related discussions happens in #171.

To summarize:

  • The OpenVPN 3 Linux v22_dev will switch to using Meson as build system instead of autotools
  • The Python code in OpenVPN 3 Linux (essentially the src/python/ directory) will probably be switching to use Python packaging tools (setup/dist tools - I always forget which one is the right one).
  • It is still an open question if the Python code should be moved to a separate sub-project.
  • There are now development builds available for Fedora with code which will end up in the v22_dev release: https://copr.fedorainfracloud.org/coprs/dsommers/openvpn3-devsnapshots/

dsommers avatar Feb 01 '24 09:02 dsommers

This issue should be resolved with the v22_dev release. Closing this issue ticket.

dsommers avatar Jun 17 '24 16:06 dsommers