Bug 277433 - x11-toolkits/py-fltk 1.3.9 raises exception on import
Summary: x11-toolkits/py-fltk 1.3.9 raises exception on import
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on: 277439
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-02 11:56 UTC by Hiroo Ono
Modified: 2024-12-26 18:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroo Ono 2024-03-02 11:56:43 UTC
On 14-STABLE (amd64), importing py-fltk-1.3.9 emits the following exception.

----
>>> import fltk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/fltk/__init__.py", line 9, in <module>
    from .fltk import *
  File "/usr/local/lib/python3.9/site-packages/fltk/fltk.py", line 17, in <module>
    from . import _fltk
ImportError: /usr/local/lib/python3.9/site-packages/fltk/_fltk.cpython-39.so: Undefined symbol "_ZN18Fl_XFont_On_Demand5valueEv"
----

Did poudriere options -r ... x11-toolkits/py-fltk, rebuilt the packages and reinstalled them. So the port options should be default.
The system was upgraded from 13-STABLE recently, and py39-fltk which was built around the middle of 2023 worked there.
Comment 1 Hiroo Ono 2024-03-02 16:55:08 UTC
It turned out that fltk-1.3.9's libfltk.so.1.3 does not have the symbol _ZN18Fl_XFont_On_Demand5valueEv.
The library file from https://pkg.freebsd.org/FreeBSD:14:amd64/latest/All/fltk-1.3.9_1.pkg is same, while the library file from https://pkg.freebsd.org/FreeBSD:13:amd64/release_2/All/fltk-1.3.8.pkg has the symbol.
I checked the library file from Arch Linux's fltk-1.3.9 package and it had the symbol.
So, there should be something wrong with the build of ports' fltk-1.3.9.
Cc'ing to the maintainer of x11-toolkits/fltk.
Comment 2 Hiroo Ono 2024-03-02 21:37:07 UTC
doing poudriere testport -i ... x11-toolkits/fltk and see the intermediate data,

readelf -a lib/libfltk.a emits the following:
118: 0000000000000000  1010 FUNC    GLOBAL HIDDEN    21 _ZN18Fl_XFont_On_Demand5valueEv

and readelf -a src/libfltk.so emits the following:
909: 0000000000100a10  1010 FUNC    LOCAL  HIDDEN    14 _ZN18Fl_XFont_On_Demand5valueEv

I think it should be DEFAULT instead of HIDDEN, but currently I have no idea why it became so.
Comment 3 Hiroo Ono 2024-03-02 22:59:44 UTC
Reported the fix to x11-toolkits/fltk in bug 277439.
Maybe, PORTREVISION should be bumped after it gets fixed.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-12-26 18:49:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b603333e3d4c2e74e2404b1d75f776cb46b15216

commit b603333e3d4c2e74e2404b1d75f776cb46b15216
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2024-12-26 18:47:36 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2024-12-26 18:47:36 +0000

    x11-toolkits/fltk: update this port to the latest version 1.3.10

    FLTK 1.3.10 is a maintenance release with minor enhancements and
    bug fixes.  Particularly, Fl_XFont_On_Demand class was previously
    not labeled FL_EXPORT, which made it not exposed in the library,
    in turn breaking `x11-toolkits/py-fltk' port and other consumers.

    There are no new ABI features and thus it is 100% compatible with
    releases 1.3.5-1.3.9.  This is intended to be the last release of
    the 1.3.x series.

    PR:     277433, 277439

 x11-toolkits/fltk/Makefile | 4 +---
 x11-toolkits/fltk/distinfo | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)
Comment 5 Alexey Dokuchaev freebsd_committer freebsd_triage 2024-12-26 18:57:59 UTC
(In reply to Hiroo Ono from comment #3)
> Maybe, PORTREVISION should be bumped after it gets fixed.
No, it shouldn't: existing (pre-installed) package is fine, i.e. broken "import fltk" succeeds after fixing/updating the main FLTK port.