labstreaminglayer / App-LabRecorder

An application for streaming one or more LSL streams to disk in XDF file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asking for feedback on LabRecorder distribution

cboulay opened this issue · comments

Now that liblsl is available via homebrew (brew install labstreaminglayer/tap/lsl), I'm about to make LabRecorder and other LSL Apps available via homebrew as well.

There are some obvious wins here, but the biggest is that it'll be a very easy way for users to "build from source", so users who don't have whatever version of MacOS was used by me or the CI runner will still have an easy way to get the app, as long as their system is compatible with the dependencies (Qt6).

There are some implementation details that are attractive but have some consequences, so I'm asking for feedback.

Can I change it so that LabRecorder links to the homebrew-installed dependencies instead of dependencies packaged inside the app folder?

One of the most annoying parts about using cmake to build cross-platform qt-based apps is packaging the dependencies for the MacOS app. It doesn't work properly all the time, it's different on different computers, and it seems to break with every update.

If I can instead link to the homebrew-provided libraries, it becomes much simpler and we can ditch about 50 lines of CMake code.

The main disadvantage is that we will no longer have a all-in-one file that a user can download on one computer and bring to a different computer. Even if they download the bottle, they will still need the bottles for the dependencies, and I don't know how to do that for Qt. So this means users on not-internet-connected computers are left behind, or they have to download an offline installer for qt and do a manual build.

Thoughts?

I now have LabRecorder building both the library-bundled version that gets deployed to the GitHub release page, as well as the slimmer version that gets deployed as a bottle. For now it's easy to have both, but I'd rather get rid of the former as it seems harder to maintain.

If you already have homebrew installed, labrecorder installs very quickly with brew install labstreaminglayer/tap/labrecorder. I haven't yet figured out how to make a Cask out of this so it can automatically be installed into Applications, so for now it has to be opened with open /usr/local/opt/labrecorder/LabRecorder/LabRecorder.app

I managed to get LSL, LabRecorder and SigViewer working properly on a MacBook M1Pro running OSX 12.3.2 (Monterey)... but it took some effort ;-)
Having a working brew install --cask LabRecorder script would be a real plus!

What I did (on a brand new computer):

  • brew install labstreaminglayer/tap/labrecorder properly installs the dependencies and the LSL stuff
  • open /usr/local/opt/labrecorder/LabRecorder/LabRecorder.app complains that: The file /usr/local/opt/labrecorder/LabRecorder/LabRecorder.app does not exist.
  • Digging into the installation, I get :
~ % brew --prefix labrecorder  
/opt/homebrew/opt/labrecorder
~ % brew --prefix lsl
/opt/homebrew/opt/lsl

~ % open  /opt/homebrew/opt/labrecorder/LabRecorder/LabRecorder.app

And I get the following (extract of the) crash dump (full version):

Process:               LabRecorder [57725]
Path:                  /opt/homebrew/*/LabRecorder.app/Contents/MacOS/LabRecorder

...

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: @loader_path/libbrotlicommon.1.dylib
Referenced from: /opt/homebrew/*/LabRecorder.app/Contents/Frameworks/libbrotlidec.1.dylib
Reason: tried: '/opt/homebrew/Cellar/labrecorder/1.14.2/LabRecorder/LabRecorder.app/Contents/Frameworks/libbrotlicommon.1.dylib' (no such file), '/usr/local/lib/libbrotlicommon.1.dylib' (no such file), '/usr/lib/libbrotlicommon.1.dylib' (no such file)
(terminated at launch; ignore backtrace)

Maybe I should rebuild LabRecorder from source...

 ~ % brew reinstall --build-from-source labstreaminglayer/tap/labrecorder
==> Downloading https://github.com/labstreaminglayer/App-LabRecorder/archive/refs/tags/v1.14.2.tar.gz
Already downloaded: /Users/denismottet/Library/Caches/Homebrew/downloads/4f4f5eff1932f13a3ec5af8a7e07f8a24a40a7f0fba74941702bb6f857afed5b--App-LabRecorder-1.14.2.tar.gz
==> Reinstalling labstreaminglayer/tap/labrecorder 
==> cmake -S . -B build -DLSL_DEPLOYAPPLIBS=OFF
==> cmake --build build --target install --config Release -j
🍺  /opt/homebrew/Cellar/labrecorder/1.14.2: 93 files, 64.5MB, built in 8 seconds
==> Running `brew cleanup labrecorder`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

Still not working, with the same crash reason LabRecorder-2022-04-08-183420.txt

That's great information. Thank you.
I'll be getting a MBP M1Pro sometime next week or the week after and this will be a top priority.
I'm going to prioritize a build-from-source path because I'm guessing that providing prebuilt binaries will have some requirements on signing and certification.

Hi @DenisMot , just got a new MBP and I'm digging in.

QtNetwork depends on libbrotlidec.1.dylib so this library gets properly bundled by macdeployqt. However, the transient dependency libbrotlicommon.1.dylib does not get bundled, presumably because its search path begins with @loader_path.

This appears to be a known solution bug with macdeployqt: https://bugreports.qt.io/browse/QTBUG-100686

The short-term solution is to copy libbrotlicommon.1.dylib into /opt/homebrew/Cellar/labrecorder/1.16.1_1/LabRecorder/LabRecorder.app/Contents/Frameworks. A better solution is to force macdeployqt to bundle this lib, or maybe have cmake copy it after build. I'm looking into it.