Bug 282850

Summary: cad/opencascade: bump PORTREVISION after devel/onetbb update
Product: Ports & Packages Reporter: John Hein <jcfyecrayz>
Component: Individual Port(s)Assignee: Ganael LAPLANCHE <martymac>
Status: Closed FIXED    
Severity: Affects Some People CC: martymac, thierry
Priority: --- Flags: thierry: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description John Hein 2024-11-18 16:27:55 UTC
cad/opencascade installs .cmake files that have entries like so:

usr/local/lib/cmake/OpenCASCADE/OpenCASCADEDrawTargets.cmake:  INTERFACE_LINK_LIBRARIES "TKernel;TKG2d;TKGeomBase;TKG3d;TKMath;TKBRep;TKGeomAlgo;TKShHealing;TKMesh;TKService;TKHLR;TKTopAlgo;/usr/local/lib/libtcl86.so;/usr/local/lib/libtk86.so;X11;/usr/local/lib/libtbb.so.12.13;/usr/local/lib/libtbbmalloc.so.2.13;pthread;rt;stdc++"

cad/FreeCAD uses those files during its build.

devel/onetbb recently updated from 2021.13.0 to 2022.0.0 (ports 2e1a63a2de24a87ec52e05335006143dcf6a5a1a).  In that update, it changed some .so lib file versions, like:

lib/libtbb.so.12.13 -> lib/libtbb.so.12.14

But cad/opencascade was not bumped, so the .cmake files did not get updated and still refer to libtbb*.so.12.13

Either:
 - we should bump PORTREVISION for opencascade
 - or change the .cmake files to not be so specific in the .so version if the API/ABI between minor version updates is expected to be compatible (e.g., refer to libtbb.so.12 instead of libtbb.so.12.13).  That would require understanding onetbb's upstreadm API/ABI guarantees on minor (or major) shared lib version updates, which may or may not include plans for symbol versioning (at a guess, I suspect it does not, but I have not yet looked).

The PORTREVISION bump is easiest (although not having to rebuild opencascade is a useful goal since it is not a particularly lightweight build).

This problem results in cad/FreeCAD builds failing if you have an opencascade installed that was built against the older devel/onetbb:

gmake[2]: *** No rule to make target '/usr/local/lib/libtbb.so.12.13', needed by 'lib/libSMDS.so'.  Stop.

The devel/onetbb update occurred on Nov 8, 2024.
The most recent update for cad/opencascade was committed Sep 17, 2024.

Locally, I edited the cmake files manually to change the .13 -> .14.  FreeCAD build now completes, and run-time seems to be working fine in short testing.
Comment 1 Ganael LAPLANCHE freebsd_committer freebsd_triage 2024-11-18 17:25:01 UTC
Hello,

OneTBB's libtbb.so.12.14 is binary compatible with libtbb.so.12.13, that's why I did not bump dependent ports' revisions. Sorry, I did not think about those hardcoded stuff in Opencascade CMake files.

As you suggest, the easiest fix is probably just to bump Opencascade revision. Thierry, can you handle that ?

Cheers,

Ganael.
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-11-19 11:46:39 UTC
A commit in branch main references this bug:

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

commit be4d14c34c09e842a24db73178f5b48d75910472
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2024-11-19 11:36:31 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2024-11-19 11:45:30 +0000

    cad/opencascade: Chase oneTBB update

    Opencascade hardcodes oneTBB library version in file:
    lib/cmake/OpenCASCADE/OpenCASCADEDrawTargets.cmake

    Commit 2e1a63a ('devel/onetbb: Update to 2022.0.0') made the library
    bump, so bump PORTREVISION to chase the new version.

    PR:     282850
    Reported by:    John Hein <jcfyecrayz@liamekaens.com>
    Approved by:    portmgr (blanket)

 cad/opencascade/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Ganael LAPLANCHE freebsd_committer freebsd_triage 2024-11-19 11:48:16 UTC
Hello, John, Thierry,

I've bumped Opencascade's revision.

Thanks again John for your bug report!

Best regards,

Ganael.