From 19764014bea0e4ef491e5e4cc22686bf6eb7d609 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Wed, 25 Dec 2019 11:50:25 +0100 Subject: [PATCH] Increased mono dependency from 5.4 to 5.18 for debian # Conflicts: # docker/tests/run-all.sh --- distribution/debian/control | 6 +- distribution/debian/rules | 2 +- distribution/docker-build/Dockerfile | 2 +- docker/tests/mono/sonarr/Dockerfile | 1 + docker/tests/run-all.sh | 55 ++++++++++++------- .../Checks/DotnetVersionCheckFixture.cs | 10 ++-- .../Checks/MonoVersionCheckFixture.cs | 10 +++- .../HealthCheck/Checks/DotnetVersionCheck.cs | 23 +++++--- .../HealthCheck/Checks/MonoVersionCheck.cs | 16 +++--- 9 files changed, 75 insertions(+), 50 deletions(-) diff --git a/distribution/debian/control b/distribution/debian/control index ea7ba39f1..1ddefd5dd 100644 --- a/distribution/debian/control +++ b/distribution/debian/control @@ -7,8 +7,8 @@ Vcs-Git: git@github.com:Sonarr/Sonarr.git Vcs-Browser: https://github.com/Sonarr/Sonarr Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), - mono-devel (>= 5.4), - libmono-cil-dev (>= 5.4), + mono-devel (>= 5.18), + libmono-cil-dev (>= 5.18), cli-common-dev (>= 0.9+xamarin5) Package: sonarr @@ -16,7 +16,7 @@ Architecture: all Provides: nzbdrone Conflicts: nzbdrone Replaces: nzbdrone -Depends: adduser, libsqlite3-0 (>= 3.7), libmediainfo0v5 (>= 0.7.52) | libmediainfo0 (>= 0.7.52), mono-runtime (>= 5.4), ca-certificates-mono, libmono-system-net-http4.0-cil (>= 4.0.0~alpha1), ${cli:Depends}, ${misc:Depends} +Depends: adduser, libsqlite3-0 (>= 3.7), libmediainfo0v5 (>= 0.7.52) | libmediainfo0 (>= 0.7.52), mono-runtime (>= 5.18), ca-certificates-mono, libmono-system-net-http4.0-cil (>= 4.0.0~alpha1), ${cli:Depends}, ${misc:Depends} Recommends: libmediainfo0v5 (>= 18.03) | libmediainfo0 (>= 18.03) Suggests: sqlite3 (>= 3.7), mediainfo (>= 0.7.52) Description: Internet PVR diff --git a/distribution/debian/rules b/distribution/debian/rules index a00399f3d..babfa7e50 100644 --- a/distribution/debian/rules +++ b/distribution/debian/rules @@ -3,7 +3,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -EXCLUDE_MODULEREFS = crypt32 httpapi +EXCLUDE_MODULEREFS = crypt32 httpapi __Internal %: dh $@ --with=systemd --with=cli diff --git a/distribution/docker-build/Dockerfile b/distribution/docker-build/Dockerfile index 5998d6e51..5425e8c5c 100644 --- a/distribution/docker-build/Dockerfile +++ b/distribution/docker-build/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:xenial AS builder ENV DEBIAN_FRONTEND noninteractive -ENV MONO_VERSION 5.14 +ENV MONO_VERSION 5.18 RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ echo "deb http://download.mono-project.com/repo/debian stable-xenial/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-stable.list && \ diff --git a/docker/tests/mono/sonarr/Dockerfile b/docker/tests/mono/sonarr/Dockerfile index f43478af9..a8cb42cdc 100644 --- a/docker/tests/mono/sonarr/Dockerfile +++ b/docker/tests/mono/sonarr/Dockerfile @@ -16,6 +16,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E03280 RUN apt-get update && apt-get install -y \ libmono-system-runtime4.0-cil \ + libmono-system-net-http4.0-cil \ && rm -rf /var/lib/apt/lists/* COPY startup.sh /startup.sh diff --git a/docker/tests/run-all.sh b/docker/tests/run-all.sh index 3b65f85c9..21301e40f 100644 --- a/docker/tests/run-all.sh +++ b/docker/tests/run-all.sh @@ -2,16 +2,18 @@ opt_parallel= opt_version= opt_mode=both -while getopts 'pv:m:?h' c +while getopts 'pv:m:r?h' c do case $c in p) opt_parallel=1 ;; v) opt_version=$OPTARG ;; m) opt_mode=$OPTARG ;; + r) opt_report=1 ;; ?|h) printf "Usage: %s [-p] [-v mono-ver] [-m sonarr|complete]\n" $0 printf " -p run parallel\n" printf " -v run specified mono version\n" printf " -m run only mono-'complete' or 'sonarr' package variants\n" + printf " -r only report\n" exit 2 esac done @@ -20,17 +22,22 @@ done # make sure that the docker host has enough memory to handle about ~300 MB per container, so 2-3 GB total # excess goes to the swap and will slow down the entire system -# Preferred versions -MONO_VERSIONS="6.8 6.6 6.4 6.0 5.20 5.18" +MONO_VERSIONS="" # Future versions MONO_VERSIONS="$MONO_VERSIONS 6.10=preview-xenial" +# Semi-Supported versions +MONO_VERSIONS="$MONO_VERSIONS 6.8 6.6 6.4 6.0" + # Supported versions -MONO_VERSIONS="$MONO_VERSIONS 5.16 5.14 5.12 5.10 5.8 5.4" +MONO_VERSIONS="$MONO_VERSIONS 5.20 5.18" + +# Legacy unsupported versions (but appear to work) +MONO_VERSIONS="$MONO_VERSIONS 5.16 5.14 5.12" # Legacy unsupported versions -MONO_VERSIONS="$MONO_VERSIONS 5.0" +MONO_VERSIONS="$MONO_VERSIONS 5.10 5.8 5.4 5.0" #MONO_VERSIONS="$MONO_VERSIONS 4.8=stable-wheezy/snapshots/4.8" if [ "$opt_version" != "" ]; then @@ -86,23 +93,29 @@ runOne() { echo "Finished Test Docker for mono $MONO_VERSION" } -if [ "$opt_parallel" == "1" ]; then +if [ "$opt_report" != "1" ]; then + + if [ "$opt_parallel" == "1" ]; then + for MONO_VERSION_PAIR in $MONO_VERSIONS; do + prepOne "$MONO_VERSION_PAIR" + done + fi + for MONO_VERSION_PAIR in $MONO_VERSIONS; do - prepOne "$MONO_VERSION_PAIR" + if [ "$opt_parallel" == "1" ]; then + runOne "$MONO_VERSION_PAIR" & + else + prepOne "$MONO_VERSION_PAIR" + runOne "$MONO_VERSION_PAIR" + fi done + + if [ "$opt_parallel" == "1" ]; then + echo "Waiting for all runs to finish" + wait + echo "Finished all runs" + fi + fi -for MONO_VERSION_PAIR in $MONO_VERSIONS; do - if [ "$opt_parallel" == "1" ]; then - runOne "$MONO_VERSION_PAIR" & - else - prepOne "$MONO_VERSION_PAIR" - runOne "$MONO_VERSION_PAIR" - fi -done - -if [ "$opt_parallel" == "1" ]; then - echo "Waiting for all runs to finish" - wait - echo "Finished all runs" -fi \ No newline at end of file +grep "() .SetupGet(v => v.Version) @@ -63,7 +63,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks GivenOutput("4.6.2"); - Subject.Check().ShouldBeOk(); + Subject.Check().ShouldBeError(); } } } diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs index e33402e41..613eca188 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs @@ -20,6 +20,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks [TestCase("5.18")] [TestCase("5.20")] + [TestCase("6.4")] public void should_return_ok(string version) { GivenOutput(version); @@ -27,7 +28,6 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks Subject.Check().ShouldBeOk(); } - [TestCase("5.16")] public void should_return_notice(string version) { GivenOutput(version); @@ -35,8 +35,6 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks Subject.Check().ShouldBeNotice(); } - [TestCase("5.4")] - [TestCase("5.8")] public void should_return_warning(string version) { GivenOutput(version); @@ -57,6 +55,12 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks [TestCase("4.2")] [TestCase("4.4.0")] [TestCase("4.4.1")] + [TestCase("5.4")] + [TestCase("5.8")] + [TestCase("5.10")] + [TestCase("5.12")] + [TestCase("5.14")] + [TestCase("5.16")] public void should_return_error(string version) { GivenOutput(version); diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DotnetVersionCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DotnetVersionCheck.cs index 4736e670b..f261a9425 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DotnetVersionCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DotnetVersionCheck.cs @@ -28,12 +28,6 @@ namespace NzbDrone.Core.HealthCheck.Checks // Target .Net version, which would allow us to increase our target framework var targetVersion = new Version("4.7.2"); - if (Version.TryParse(_osInfo.Version, out var osVersion) && osVersion < new Version("10.0.14393")) - { - // Windows 10 LTSB 1511 and before do not support 4.7.x - targetVersion = new Version("4.6.2"); - } - if (dotnetVersion >= targetVersion) { _logger.Debug("Dotnet version is {0} or better: {1}", targetVersion, dotnetVersion); @@ -41,7 +35,7 @@ namespace NzbDrone.Core.HealthCheck.Checks } // Supported .net version but below our desired target - var stableVersion = new Version("4.6.2"); + var stableVersion = new Version("4.7.2"); if (dotnetVersion >= stableVersion) { _logger.Debug("Dotnet version is {0} or better: {1}", stableVersion, dotnetVersion); @@ -50,6 +44,21 @@ namespace NzbDrone.Core.HealthCheck.Checks "#currently-installed-net-framework-is-supported-but-upgrading-is-recommended"); } + if (Version.TryParse(_osInfo.Version, out var osVersion) && osVersion < new Version("10.0.14393")) + { + return new HealthCheck(GetType(), HealthCheckResult.Error, + $"Currently installed .Net Framework {dotnetVersion} is no longer supported. However your Operating System cannot be upgraded to {targetVersion}.", + "#currently-installed-net-framework-is-old-and-unsupported"); + } + + var oldVersion = new Version("4.6.2"); + if (dotnetVersion >= oldVersion) + { + return new HealthCheck(GetType(), HealthCheckResult.Error, + $"Currently installed .Net Framework {dotnetVersion} is no longer supported. Please upgrade the .Net Framework to at least {targetVersion}.", + "#currently-installed-net-framework-is-old-and-unsupported"); + } + return new HealthCheck(GetType(), HealthCheckResult.Error, $"Currently installed .Net Framework {dotnetVersion} is old and unsupported. Please upgrade the .Net Framework to at least {targetVersion}.", "#currently-installed-net-framework-is-old-and-unsupported"); diff --git a/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs index d79f4c181..54ab89e74 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Core.HealthCheck.Checks } // Stable Mono versions - var stableVersion = new Version("5.16"); + var stableVersion = new Version("5.18"); if (monoVersion >= stableVersion) { _logger.Debug("Mono version is {0} or better: {1}", stableVersion, monoVersion); @@ -51,15 +51,13 @@ namespace NzbDrone.Core.HealthCheck.Checks $"Currently installed Mono version {monoVersion} is supported but upgrading to {bestVersion} is recommended.", "#currently-installed-mono-version-is-supported-but-upgrading-is-recommended"); } - - // Old but supported Mono versions, there are known bugs - var supportedVersion = new Version("5.4"); - if (monoVersion >= supportedVersion) + + var oldVersion = new Version("5.4"); + if (monoVersion >= oldVersion) { - _logger.Debug("Mono version is {0} or better: {1}", supportedVersion, monoVersion); - return new HealthCheck(GetType(), HealthCheckResult.Warning, - $"Currently installed Mono version {monoVersion} is supported but has some known issues. Please upgrade Mono to version {bestVersion}.", - "#currently-installed-mono-version-is-supported-but-upgrading-is-recommended"); + return new HealthCheck(GetType(), HealthCheckResult.Error, + $"Currently installed Mono version {monoVersion} is no longer supported. Please upgrade Mono to version {bestVersion}.", + "#currently-installed-mono-version-is-old-and-unsupported"); } return new HealthCheck(GetType(), HealthCheckResult.Error,