obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.22k stars 7.72k forks source link

Unable to Build Debian Package #9736

Open ewhac opened 8 months ago

ewhac commented 8 months ago

Operating System Info

Other

Other OS

Debian Sid

OBS Studio Version

Git

OBS Studio Version (Other)

No response

OBS Studio Log URL

-na-

OBS Studio Crash Log URL

No response

Expected Behavior

The command make package or cpack should generate installable Debian package files.

Current Behavior

Package build fails in dpkg-shlibdeps:

$ cpack
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: obs-studio
CPack: - Install project: obs-studio []
CPack: Create package
CPackDeb: - Generating dependency list
CMake Error at /usr/share/cmake-3.27/Modules/Internal/CPack/CPackDeb.cmake:348 (message):
  CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: no dependency information
  found for usr/local/lib/libobs-frontend-api.so.0 (used by
  ./usr/local/lib/obs-scripting/_obspython.so)

  Hint: check if the library actually comes from a package.

  ';

  executed command: '/usr/bin/dpkg-shlibdeps -O
  ./usr/local/bin/obs;./usr/local/bin/obs-ffmpeg-mux;./usr/local/lib/libobs-frontend-api.so.30;./usr/local/lib/libobs-opengl.so.30;./usr/local/lib/libobs-scripting.so.30;./usr/local/lib/libobs.so.30;./usr/local/lib/obs-plugins/decklink-captions.so;./usr/local/lib/obs-plugins/decklink-output-ui.so;./usr/local/lib/obs-plugins/decklink.so;./usr/local/lib/obs-plugins/frontend-tools.so;./usr/local/lib/obs-plugins/image-source.so;./usr/local/lib/obs-plugins/linux-alsa.so;./usr/local/lib/obs-plugins/linux-capture.so;./usr/local/lib/obs-plugins/linux-pipewire.so;./usr/local/lib/obs-plugins/linux-pulseaudio.so;./usr/local/lib/obs-plugins/linux-v4l2.so;./usr/local/lib/obs-plugins/obs-ffmpeg.so;./usr/local/lib/obs-plugins/obs-filters.so;./usr/local/lib/obs-plugins/obs-outputs.so;./usr/local/lib/obs-plugins/obs-qsv11.so;./usr/local/lib/obs-plugins/obs-transitions.so;./usr/local/lib/obs-plugins/obs-vst.so;./usr/local/lib/obs-plugins/obs-websocket.so;./usr/local/lib/obs-plugins/obs-x264.so;./usr/local/lib/obs-plugins/rtmp-services.so;./usr/local/lib/obs-plugins/text-freetype2.so;./usr/local/lib/obs-plugins/vlc-video.so;./usr/local/lib/obs-scripting/_obspython.so;./usr/local/lib/obs-scripting/obslua.so';

[ ...4800 more lines of debug info... ]

The files that are claimed to have no dependency information change between runs. A run subsequent to the above reported:

CMake Error at /usr/share/cmake-3.27/Modules/Internal/CPack/CPackDeb.cmake:348 (message):
  CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: no dependency information
  found for usr/local/lib/libobs.so.0 (used by
  ./usr/local/lib/obs-plugins/rtmp-services.so)
[ ... ]

This same build environment worked fine up until about six weeks ago. Creating a new build directory from scratch did not help.

Steps to Reproduce

  1. git pull --recurse-submodules
  2. make -j11
  3. make package

Anything else we should know?

ENABLE_BROWSER is false. Full debug output from cpack available upon request (4800 lines, 163KB).

PatTheMav commented 8 months ago

CPack's DEB generator is not capable of generating Debian packages. IIRC it can only generate .deb files compatible with Ubuntu because it does not conform to Debian package standards.

To create Debian-compliant packages there is an entire separate project for it (https://gitlab.kitware.com/debian/dh-cmake) to somehow create them.

We officially only provide support for Ubuntu and Flatpak, so that's what the codebase will provide out of the box. Any adjustments/changes required for other distributions need to be done locally or provided by the specific packagers.

If you find an issue that makes it impossible to package OBS Studio for Debian manually, we can revisit those issues.

ewhac commented 8 months ago

We officially only provide support for Ubuntu and Flatpak, so that's what the codebase will provide out of the box. Any adjustments/changes required for other distributions need to be done locally or provided by the specific packagers.

make package was very convenient and, up until a couple of month ago, worked just fine even on a "vanilla" Debian system. If this is OBS's official position, then it should drop from the READMEs and CMakefiles the pretense of supporting building .deb or .rpm packages.

PatTheMav commented 8 months ago

We officially only provide support for Ubuntu and Flatpak, so that's what the codebase will provide out of the box. Any adjustments/changes required for other distributions need to be done locally or provided by the specific packagers.

make package was very convenient and, up until a couple of month ago, worked just fine even on a "vanilla" Debian system. If this is OBS's official position, then it should drop from the READMEs and CMakefiles the pretense of supporting building .deb or .rpm packages.

That's fair criticism - we've only just begun laying out some clearer rules and limitations for the project, so it's an ongoing process. It was clarified here:

https://github.com/obsproject/obs-studio/pull/9597#issuecomment-1721748505

We don't officially provide support outside of:

  • Windows 10 [1]
  • Windows 11 [1]
  • macOS 11+ [1]
  • Ubuntu 22.04+ [2]
  • Flatpak

[...]

As those are our primary concerns, we tend to align our code, CMake included, with that list. For other platforms, such as FreeBSD, Debian, CentOS, or Fedora, we tend to prefer having packagers patch on their build systems for their own platform requirements unless it is prohibitively difficult or impossible to do so. Otherwise, we're at the mercy of everyone needing their own changes upstreamed because of their constraints.

That obviously does not mean that use on other distributions will be intentionally broken, but in this specific case it means that we don't implement a package target for Linux outside of CMake's DEB generator (and it is that generator does not support Debian, which we have no power over).

We haven't changed any code related to the CPack generator in the 6-week timeframe you've mentioned though, so this could be related to any module we build.

Could you post the cmake invocation you used to build the project and upload a TXT file with the complete error output of cpack?

ewhac commented 8 months ago

Could you post the cmake invocation you used to build the project and upload a TXT file with the complete error output of cpack?

I usually use the interactive ccmake and tweak the build opts by hand. I've attached the output of cmake -L .. from the build directory, as well as the full output from cpack (version 3.27.7).

cmake-opts.txt cpack-output.txt

PatTheMav commented 8 months ago

From what I can tell the root cause is that ./usr/local/lib/obs-scripting/_obspython.so is looking for usr/local/lib/libobs-frontend-api.so.0, but what's actually installed is ./usr/local/lib/libobs-frontend-api.so.30.

I wonder how this could happen as the frontend api is built with the correct SOVERSION in the build tree and there should not be a version with version 0. Are you using a fresh build directory?

ewhac commented 7 months ago

Are you using a fresh build directory?

I tried creating a fresh build directory, but the result was the same.