google / sagetv

SageTV is a cross-platform networked DVR and media management system
http://forums.sagetv.com/
Apache License 2.0
265 stars 174 forks source link

Difference in Sage.jar between Windows and Linux builds #468

Open jusjoken opened 2 years ago

jusjoken commented 2 years ago

I have been working on rebuilding the Unraid Docker solution and was running into an issue with the Java8 docker as SageTV would run but a placeshifter would not connect. The issue was related to a change in Java between 8 and 9 and Byte(ByteBuffer).

The odd thing is I often test using Java 8 on windows and had no issues connection a placeshifter...both builds were the latest 9.2.6 releases.

So I copied the Sage.jar from the windows release into the linux docker and restarted SageTV and now I was able to connect the placeshifter to this Java 8 docker.

In my research I find that you can build a jar using JDK9 with the --release=8 option and it will resolve the Byte/ByteBuffer compatibility issue.

So are we using this --release option for the Windows jar build and not the Linux build or what is different in the 2 build processes that makes the Linux build fail on Java 8 but the Windows build works?

Thoughts?

enternoescape commented 2 years ago

I obviously cannot speak for everyone, but this would allow the older docker container to work with Java 8 again which would address some compatibility issues with older plugins. On a side note, when I was building to fix an issue on Windows, I had to upgrade to Java 9 to be able to successfully compile the current code as it is on Github. I wasn't expecting that and spent a lot of time troubleshooting assuming I created the issue.

wnjj commented 2 years ago

I’m pretty sure I built the last windows version with JDK 8 which would explain the difference. JDK9 was a result of needing to update the distribution for the automated build on GitHub.

jusjoken commented 2 years ago

I currently do not have a build system for windows nor Linux but as time permits I will set one up again. If someone doesn't beat me to it I will test out the release=8 option under jdk9 and see what happens.

I think if we can support Java 8 as long as possible the better as we have many older in use plugins that could be affected. The Jetty issue may be the biggest but I am close to a jetty 9 release that works well on Java 8+

jusjoken commented 2 years ago

I found a resolution to this. I could not make it work with a build system that uses JDK9 as the --release option under Gradle is broken and Gradle does not plan to resolve it. So I built a build system as follows...

I manually uploaded the linux installer to my jusjoken/sagetv-linux forked repo and setup a Java 8 docker to use that as the sagetv install file and the docker works well.

If anyone want to try out the docker it is the one available in unraid and dockerhub under "sagetvopen/sagetv-server-java8"

I can create a PR for these changes but it would also force the github workflow process to be updated as in the end that is what is building the linux releases. I am not sure how to test those changes although in theory it should just be a matter of changing it to use ubuntu 20 and JDK 11. The --release flag is in the updated build.gradle file

Let me know your thoughts and I will clean up the changes from my testing and create a PR.

Ken

jusjoken commented 2 years ago

For record purposes on this issue I updated the PR to include the workflow changes needed to test build on ubuntu 20.04 and use JDK 11 and it passed the PR tests....good news. If the PR is accepted then the 9.2.7 build should run again on a java 8 docker (I guess I still need to change the version and push that too)

jusjoken commented 2 years ago

I did another PR to move the build process to use ubuntu 18.04 so the SageTV build would run on 18.04+. Although we could just expect users to update the linux os (that is what I did on the dockers), as 18.04 is under support for at least more than 1 more year I thought it better to also support 18.04.