jellyfin / jellyfin-server-windows

The Windows tray app and installer for Jellyfin Server on Windows.
https://jellyfin.org
MIT License
80 stars 27 forks source link

Errors when building jellyfin installation from source #74

Closed Sky-High closed 4 months ago

Sky-High commented 1 year ago

I am trying to build the jellyfin package from source following the steps in README.md, but that does not work out of the box. What am I doing wrong?

Used sources:

  1. Running "dotnet build -c Release" yields a bunch of CS8601, CS8618 and CS8625 warnings (about non-nullable fields). These do seem warnings, but as warnings are treated as error in the .csproj, the build fails. Setting TreatWarningsAsErrors=false in .csproj does work around this and yield a successful build. But is that the intended solution?

  2. The powershell build with build-jellyfin.ps1 fails with error:

     CSC : error SA0001: XML comment analysis is disabled due to project configuration
     [C:\git\jellyfin\src\Jellyfin.MediaEncoding.Keyframes\Jellyfin.MediaEncoding.Keyframes.csproj]
    • for the 3 projects in the src directory: Jellyfin.Extensions, Jellyfin.MediaEncoding.Hls, Jellyfin.MediaEncoding.Keyframes This appears due to the parent projects Jellyfin.Server.csproj, Emby.Server.Implementations.csproj and Jellyfin.Api.csproj having the Code Analyzer group conditional for Debug, so suppressed for Release:
       <!-- Code Analyzers-->
       <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
    • while the projects in "src" have the ItemGroup unconditional, contradicting their parent projects for Release, which results in said errors. This is easily worked around by changing the ItemGroups in the .csproj's in src to conditional as well. But is that the intended solution?
  3. Installing jellyfin from jellyfin_10.8.7_windows-x64.exe creates the XML documentation files C:\Program Files\Jellyfin\Server\jellyfin.xml etc. The build with build-jellyfin.ps1 does not, as it contains the option -p:GenerateDocumentationFile=false in the "dotnet publish" command. What is the preferred solution for this?

anthonylavado commented 1 year ago

Do you want to build everything from source, or just certain portions? There are a few different parts involved:

  1. Jellyfin Server
  2. Jellyfin Web
  3. jellyfin-ffmpeg, jellyfin-ffprobe
  4. Windows Tray App
  5. Installer

The instructions in the readme really only cover those last two. In fact, what we do with the releases in this repository are grab the output of the server release, which already includes the first three, and extract those into the right places.

There is a reason the build PS1 isn't mentioned in the README, and though it's in the docs, that needs to be fixed up (apologies for missing it).

Sky-High commented 1 year ago

Thanks for responding so quickly.

As to your question: jellyfin seems like a nice project to me, and I am looking into the git's and documentation for trying to understand if I could contribute with some development matching my skills and interests.

My current focus is on Jellyfin Server and Jellyfin Web, so indeed not as much the other parts. My attempt to build the Jellyfin installer from the very sources is mainly for better understanding the architecture, but also the development, documentation and release process.

After all, quite some people are developing on this project, and I assume that most of them have some kind of development environment set up. And would execute the steps of this README to generate a Windows Jellyfin installer if it where only for testing the whole process. But maybe I am wrong about that, so that I should not worry about the issues arising from simply following the steps in the README. Anyway, I was just wondering what the relevance of those issues are though they are not bothering me a lot as I have the workarounds and I can perform tests if I want to.

I found out about these steps via https://jellyfin.org/docs/general/administration/building/#windows which lead me to https://github.com/jellyfin/jellyfin-server-windows. Perusing that documentation indeed taught me a lot about Jellyfin development.

To summarize, do you feel that generally there is no need to build the Windows installer following this documentation? That would explain to me why the issues have not been raised earlier. Or can I help out in improving this scripts and/or documentation?

anthonylavado commented 4 months ago

I apologize for not responding in a very, very long time.

Generally for most development purposes, no one will need to build the installer or the tray app. Some things (like the data folder) will also usually end up in a different system path, just due to the default behaviours for system directories. In the installer/tray app, we deliberately set those to be more "Windows" specific.

Anyway, now that 10.9 is finally out, there have been a lot of changes to the build process. That entire page in our documentation will need to be re-written or replaced, and the Windows repo readme is due for several updates as well. As an example, I'll likely be removing the Powershell script in favour of documenting the exact build steps.