Bug 270814 - Samba416 build error because newer version of tevent
Summary: Samba416 build error because newer version of tevent
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-13 13:26 UTC by rachid
Modified: 2023-09-06 09:05 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rachid 2023-04-13 13:26:40 UTC
The upgrade of Samba416 is failing on tevent version.

Checking for system tevent (>=0.11.0)                                                           : yes
ERROR: Python module pytevent of version 0.11.0 not found, and bundling disabled
===>  Script "configure" failed unexpectedly.
Please report the problem to timur@FreeBSD.org [maintainer] and attach the
"/usr/ports/net/samba416/work/samba-4.16.10/bin/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net/samba416
*** Error code 1

Stop.
make: stopped in /usr/ports/net/samba416
egrep: empty (sub)expression
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20230413-10133-ok0r4o env UPGRADE_TOOL=portupgrade UPGRADE_PORT=samba416-4.16.8 UPGRADE_PORT_VER=4.16.8 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! net/samba416 (samba416-4.16.8)        (unknown build error)

The version tevent-0.13.0_1 is installed.
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2023-04-13 21:14:36 UTC
Can't repoduce this on my box but I don't use portupgrade
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2023-04-16 15:31:54 UTC
(In reply to rachid from comment #0)
Show build options for tevent: pkg info tevent.
Comment 3 rachid 2023-04-16 21:03:19 UTC
the print give the following output:

pkg info tevent
tevent-0.13.0_1
Name           : tevent
Version        : 0.13.0_1
Installed on   : Thu Apr 13 10:12:57 2023 CEST
Origin         : devel/tevent
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : devel
Licenses       : LGPL3
Maintainer     : timur@FreeBSD.org
WWW            : https://tevent.samba.org/
Comment        : Talloc based event loop library
Options        :
        DEBUG          : off
        MANPAGES       : off
        PYTHON         : on
Shared Libs required:
        libtalloc.so.2
        libintl.so.8
Shared Libs provided:
        libtevent.so.0
Annotations    :
        FreeBSD_version: 1301000
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 199KiB
Description    :
tevent is a simple library that can handle the main event loop for an
application. It supports three kinds of events: timed events, file
descriptors becoming readable or writable and signals.

Talloc is used for memory management, both internally and for private
data provided by users of the library.


I have tried to recomplile tevent and it give the error:
+ install /usr/ports/devel/tevent/work/stage/usr/local/lib/python3.11/site-packages/talloc.cpython-311.so (from bin/default/lib/talloc/pytalloc.inst.cpython-311.so)
+ install /usr/ports/devel/tevent/work/stage/usr/local/lib/tevent/libcmocka-tevent.so (from bin/default/third_party/cmocka/libcmocka-tevent.so)
+ install /usr/ports/devel/tevent/work/stage/usr/local/lib/libtevent.so.0 (from bin/default/libtevent.so)
+ install /usr/ports/devel/tevent/work/stage/usr/local/lib/python3.11/site-packages/_tevent.cpython-311.so (from bin/default/-tevent.cpython-311.so)
+ install /usr/ports/devel/tevent/work/stage/usr/local/include/tevent.h (from tevent.h)
Waf: Leaving directory `/usr/ports/devel/tevent/work/tevent-0.13.0/bin/default'
'install' finished successfully (0.340s)
/bin/rm -f /usr/ports/devel/tevent/work/stage/usr/local/lib/tevent/libcmocka-tevent.so
/bin/rmdir /usr/ports/devel/tevent/work/stage/usr/local/lib/tevent
rmdir: /usr/ports/devel/tevent/work/stage/usr/local/lib/tevent: Directory not empty
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/tevent
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/tevent

In that folder I see that one file is not removed.
/usr/ports/devel/tevent/work/stage/usr/local/lib/tevent # ls
libpytalloc-util.cpython-311-tevent.so
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2023-04-16 21:26:45 UTC
(In reply to rachid from comment #3)
Do you set default python to 3.11?
pkg info | grep python

Did you rebuild all depended from python ports?
And ofc talloc, tdb and tevent.
Comment 5 rachid 2023-04-17 02:30:24 UTC
Yes, python 3.11 is default

All packages are rebuilded after that.
Comment 6 rachid 2023-04-17 08:30:37 UTC
The problem is solved after removing /usr/ports and started a new fresh git clone.
Comment 7 Michael Osipov 2023-04-20 13:05:40 UTC
I have the same. Purging tree and retrying...
Comment 8 Michael Osipov 2023-04-20 13:27:08 UTC
I have upgraded from Python 3.7 to 3.10, exactly same issue even with fresh 2023Q2 tree. I have disabled Python support in devel/tevent, devel/talloc, databases/tdb for now. Will set up a jail to reproduce the issue.
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2023-04-20 19:16:44 UTC
Weird. I have default python 3.10 almost one year, talloc, tdb and tevent from ports with python support. And build samba416 with python support several days ago without errors.
13.1, 13.2 amd64.
Comment 10 Michael Osipov 2023-04-21 09:47:08 UTC
I followed this guide: https://forums.FreeBSD.org/threads/upgrading-python-from-3-7-to-3-8-from-ports-using-portmaster.80090/post-508427 and updated for my case:
> * modify make.conf
> # portmaster -o lang/python310 python37
> # make -C /usr/ports/lang/python reinstall clean && make -C /usr/ports/lang/python3 reinstall clean
> # REINSTALL="$(pkg info -o py37-\* | awk '{printf "%s ", $2}')"
> # pkg delete -f py37-\*
> # portmaster $REINSTALL
> # REBUILD=$(pkg query -g "%n:%dn" '*' | grep py3 | grep -v py310 | cut -d : -f 1 | sort -u)
> # portmaster $REBUILD
> # REBUILD2=$(pkg list | grep python-37 | xargs pkg which | awk '{print $6}' | sort -u)
> # portmaster $REBUILD2

Only tevent appears in REBUILD*.

This is how it looks like in a clean Bastille jail when migrating from Python 3.7 to Python 3.10. Of course, the rmdir fails here.

> root@deblndw013x10j:/usr/ports/devel/tevent
> # tree work/stage/usr/local/lib
> work/stage/usr/local/lib
> ├── debug
> ├── libtevent.so -> libtevent.so.0
> ├── libtevent.so.0
> ├── python3.7
> │   └── site-packages
> │       ├── __pycache__
> │       │   └── tevent.cpython-37.pyc
> │       ├── _tevent.so
> │       └── tevent.py
> ├── tevent
> └── X11
>     └── app-defaults
> 
> 8 directories, 5 files
> root@deblndw013x10j:/usr/ports/devel/tevent
> # tree work/stage/usr/local/lib
> work/stage/usr/local/lib
> ├── debug
> ├── libtevent.so -> libtevent.so.0
> ├── libtevent.so.0
> ├── python3.10
> │   └── site-packages
> │       ├── __pycache__
> │       │   └── tevent.cpython-310.pyc
> │       ├── _tevent.cpython-310.so
> │       ├── talloc.cpython-310.so
> │       └── tevent.py
> ├── tevent
> │   └── libpytalloc-util.cpython-310-tevent.so
> └── X11
>     └── app-defaults
> 
> 8 directories, 7 files
> root@deblndw013x10j:/usr/ports/devel/tevent
> # cat pkg-plist
> include/tevent.h
> lib/libtevent.so
> lib/libtevent.so.0
> %%PYTHON%%%%PYTHON_SITELIBDIR%%/__pycache__/tevent.cpython-%%PYTHON_SUFFIX%%.pyc
> %%PYTHON%%%%PYTHON_SITELIBDIR%%/_tevent%%PYTHON_EXT_SUFFIX%%.so
> %%PYTHON%%%%PYTHON_SITELIBDIR%%/tevent.py
> %%PKGCONFIGDIR%%/tevent.pc

Then in a poudriere jail with: "poudriere testport -j 124-release-amd64 -z python310 devel/tevent"
> nobody@124-release-amd64-default-python310:/wrkdirs/usr/ports/devel/tevent % ls -R work/stage/usr/local/lib
> X11             debug           libtevent.so    libtevent.so.0  python3.10
> 
> work/stage/usr/local/lib/X11:
> app-defaults
> 
> work/stage/usr/local/lib/X11/app-defaults:
> 
> work/stage/usr/local/lib/debug:
> 
> work/stage/usr/local/lib/python3.10:
> site-packages
> 
> work/stage/usr/local/lib/python3.10/site-packages:
> __pycache__             _tevent.cpython-310.so  tevent.py
> 
> work/stage/usr/local/lib/python3.10/site-packages/__pycache__:
> tevent.cpython-310.pyc


So what is wrong here? If you look into the Makefile of tevent you'll see that the bundled talloc is disabled. Since we know that we have switched Python and all:
devel/tevent
devel/talloc
databases/tdb

have Python binding by default, none of the has been rebuild with 3.10, therefore tevent does not find talloc for 3.10, only 3.7 is present. After a rebuild of talloc this is how it looks like:

> root@deblndw013x10j:/usr/ports/devel/tevent
> # tree work/stage/usr/local/lib
> work/stage/usr/local/lib
> ├── debug
> ├── libtevent.so -> libtevent.so.0
> ├── libtevent.so.0
> ├── python3.10
> │   └── site-packages
> │       ├── __pycache__
> │       │   └── tevent.cpython-310.pyc
> │       ├── _tevent.cpython-310.so
> │       └── tevent.py
> ├── tevent
> └── X11
>     └── app-defaults
> 
> 8 directories, 5 files

The the other two aren't in REBUILD* I haven't investigated, but that's the reason. Rebuild here from bottom to top.

HTH
Comment 11 Michael Osipov 2023-04-21 10:36:50 UTC
Just reinstalled Python on a production host according to my findings and required order and "pkg check -d" is happy, not issues so far.
Comment 12 Michael Osipov 2023-09-06 09:05:35 UTC
Has this been resolved with my explanation?