mcallegari / qlcplus

Q Light Controller Plus (QLC+) is a free and cross-platform software to control DMX or analog lighting systems like moving heads, dimmers, scanners etc. This project is a fork of the great QLC project written by Heikki Junnila that aims to continue the QLC development and to introduce new features.
Apache License 2.0
918 stars 349 forks source link

Issue with dylib linking on macOS #1578

Closed second-string closed 1 month ago

second-string commented 1 month ago

Template text

This area is reserved to developers.
If you are not a developer, you are in the wrong place and your issue will be closed.

For discussions, feedbacks, ideas and new fixtures, go to:
http://www.qlcplus.org/forum/index.php
and provide as many details as possible regarding your findings.

Before reporting new issue, please discuss it on the forum. Let's keep the issues tidy!

If you are a developer, you are supposed to have built QLC+ from sources, and started to debug the issue you have found.

Therefore, please provide a crash log or references to the code that are supposed to help the QLC+ developers to resolve the issue.
Also, if your issue concerns a specific platform, please indicate it in the issue title like [platform] description.

Specs

Issue

qmake and make execution in the repo are both successful, the issue arises when make install is executed. The issue comes from executing targets in the 'platforms/macos/Makefile' file. Here is the log section where it cds to that directory and fails:

cd macos/ && ( test -e Makefile || /opt/homebrew/opt/qt@5/bin/qmake -o Makefile /Users/user/Developer/qlcplus/platforms/macos/macos.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile install
install_name_tool -id @executable_path/../Frameworks/libqlcplusui.1.dylib ~/QLC+.app/Contents/Frameworks/libqlcplusui.1.dylib
install_name_tool -id @executable_path/../Frameworks/libqlcpluswebaccess.1.dylib ~/QLC+.app/Contents/Frameworks/libqlcpluswebaccess.1.dylib
install_name_tool -id @executable_path/../Frameworks/libqlcplusengine.1.dylib ~/QLC+.app/Contents/Frameworks/libqlcplusengine.1.dylib
/opt/homebrew/opt/qt@5/bin/qmake -install qinstall /opt/homebrew/Cellar/libusb/1.0.26/lib/libusb-1.0.0.dylib /Users/user/QLC+.app/Contents/Frameworks/libusb-1.0.0.dylib
install_name_tool -id @executable_path/../Frameworks/libusb-1.0.0.dylib ~/QLC+.app/Contents/Frameworks/libusb-1.0.0.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Users/user/QLC+.app/Contents/Frameworks/libusb-1.0.0.dylib
/opt/homebrew/opt/qt@5/bin/qmake -install qinstall /opt/homebrew/Cellar/libftdi/1.5_2/lib/libftdi1.2.dylib /Users/user/QLC+.app/Contents/Frameworks/libftdi1.2.dylib
install_name_tool -id @executable_path/../Frameworks/libftdi1.2.dylib ~/QLC+.app/Contents/Frameworks/libftdi1.2.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Users/user/QLC+.app/Contents/Frameworks/libftdi1.2.dylib (No such file or directory)
make[2]: *** [install_LIBFTDI_ID] Error 1
make[1]: *** [sub-macos-install_subtargets] Error 2
make: *** [sub-platforms-install_subtargets-ordered] Error 2

You can see the initial warning about invalidating the code signature in the libusb dylib, then it fully fails claiming it can't find the libftdi dylib that it copied to the app Frameworks dir. I have confirmed that the dylib is properly copied there. From my googling, it seems like both of these outputs are the result of some stuff getting mismatched during initial source compilation and the linker link step (source).

I found where a few libraries are being called with install_name_tool -change above in the full log output:

install_name_tool -change /opt/homebrew/Cellar/libusb/1.0.26/lib/libusb-1.0.0.dylib @executable_path/../Frameworks/libusb-1.0.0.dylib libdmxusb.dylib && install_name_tool -change /opt/homebrew/Cellar/libftdi/1.5_2/lib/libftdi1.2.dylib @executable_path/../Frameworks/libftdi1.2.dylib libdmxusb.dylib

Here's the output of otool -L /opt/homebrew/opt/libftdi/lib/libftdi1.2.dylib:

/opt/homebrew/Cellar/libftdi/1.5_2/lib/libftdi1.2.dylib:
        /opt/homebrew/opt/libftdi/lib/libftdi1.2.dylib (compatibility version 2.0.0, current version 2.5.0)
        /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

Here's all the available dylibs:

Bildschirmfoto 2024-05-30 um 19 07 03

Even if I comment out the install_name_tool -id call for the ftdi make target, there's another failure shortly after with a different library. I don't have too much experience with all of this dynamic linking on full-blown operating systems - is there something easy I'm missing here with fixing the link paths?

mcallegari commented 1 month ago

Homebrew is not yet supported. Closing, sorry