Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jellyfin: add bundled libraries to LD_LIBRARY_PATH #61668

Merged
merged 1 commit into from Jun 8, 2019

Conversation

minijackson
Copy link
Member

Motivation for this change
  • Jellyfin uses the Skia library to do some image processing.
  • Jellyfin bundles the library.

Without this, we have this error:

[10:51:42] [INF] Skia not available. Will fallback to NullIMageEncoder. {0}
System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared >
   at SkiaSharp.SkiaApi.sk_color_premultiply(SKColor color)
   at SkiaSharp.SKPMColor.PreMultiply(SKColor color)
   at Jellyfin.Drawing.Skia.SkiaEncoder.LogVersion()
   at Jellyfin.Server.Program.GetImageEncoder(IFileSystem fileSystem, IApplicationPaths appPaths, ILocalizationManager localizationManager)
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build nixosTests.jellyfin

@@ -28,8 +44,8 @@ stdenv.mkDerivation rec {

makeWrapper "${dotnet-sdk}/bin/dotnet" $out/bin/jellyfin \
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
sqlite
]}" \
sqlite fontconfig freetype stdenv.cc.cc.lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure these are needed? I would think it should at least link to the cc lib correctly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue isn't with the dotnet executable per-se, but with a bundled library which, because we download the pre-compiled version, isn't properly linked. Here's what I get when I do ldd opt/jellyfin/runtimes/linux-x64/native/libSkiaSharp.so from a pure nix-shell:

linux-vdso.so.1 (0x00007ffe6fd6b000)
libpthread.so.0 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libpthread.so.0 (0x00007f2208f48000)
libdl.so.2 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libdl.so.2 (0x00007f2208f43000)
libfreetype.so.6 => not found
libfontconfig.so.1 => not found
libstdc++.so.6 => not found
libm.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libm.so.6 (0x00007f2208dad000)
libgcc_s.so.1 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libgcc_s.so.1 (0x00007f2208b95000)
libc.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6 (0x00007f22089df000)
/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f220995c000)

@matthewbauer matthewbauer merged commit 70de27b into NixOS:master Jun 8, 2019
@minijackson minijackson deleted the jellyfin-skia branch February 26, 2022 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants