Fix builds for dotnet6 (#6595)

* Target net6.0

* Use new Enum.TryParse(ReadOnlySpan<char>) overload

* Replace RNGCryptoServiceProvider with RandomNumberGenerator

* ci - target net6.0 (#6594)

* Update deployment for dotnet6

* Use generic 6.0.x preview for CI

* Update direct dotnet download links

Co-authored-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
Cody Robibero
2021-09-25 05:21:48 -07:00
committed by GitHub
parent e627b1b154
commit 4fc3de9b75
35 changed files with 98 additions and 65 deletions

View File

@@ -2,7 +2,6 @@ FROM centos:7
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
ARG SDK_VERSION=5.0
# Docker run environment
ENV SOURCE_DIR=/jellyfin
ENV ARTIFACT_DIR=/dist
@@ -11,12 +10,13 @@ ENV IS_DOCKER=YES
# Prepare CentOS environment
RUN yum update -yq \
&& yum install -yq epel-release \
&& yum install -yq @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git
&& yum install -yq @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git wget
# Install DotNET SDK
RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \
&& rpmdev-setuptree \
&& yum install -yq dotnet-sdk-${SDK_VERSION}
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
# Create symlinks and directories
RUN ln -sf ${SOURCE_DIR}/deployment/build.centos.amd64 /build.sh \

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
@@ -18,16 +18,16 @@ RUN apt-get update -yqq \
RUN dpkg --add-architecture arm64 \
&& apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends cross-gcc-dev \
&& TARGET_LIST="arm64" cross-gcc-gensource 8 \
&& cd cross-gcc-packages-amd64/cross-gcc-8-arm64 \
&& TARGET_LIST="arm64" cross-gcc-gensource 9 \
&& cd cross-gcc-packages-amd64/cross-gcc-9-arm64 \
&& apt-get install -yqq --no-install-recommends \
gcc-8-source libstdc++-8-dev-arm64-cross \
gcc-9-source libstdc++-9-dev-arm64-cross \
binutils-aarch64-linux-gnu bison flex libtool \
gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev \
systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip \
libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 \
libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 \
libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-8-dev:arm64
libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-9-dev:arm64
# Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.arm64 /build.sh

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
@@ -18,17 +18,17 @@ RUN apt-get update -yqq \
RUN dpkg --add-architecture armhf \
&& apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends cross-gcc-dev \
&& TARGET_LIST="armhf" cross-gcc-gensource 8 \
&& cd cross-gcc-packages-amd64/cross-gcc-8-armhf \
&& TARGET_LIST="armhf" cross-gcc-gensource 9 \
&& cd cross-gcc-packages-amd64/cross-gcc-9-armhf \
&& apt-get install -yqq --no-install-recommends\
gcc-8-source libstdc++-8-dev-armhf-cross \
gcc-9-source libstdc++-9-dev-armhf-cross \
binutils-aarch64-linux-gnu bison flex libtool gdb \
sharutils netbase libmpc-dev libmpfr-dev libgmp-dev \
systemtap-sdt-dev autogen expect chrpath zlib1g-dev \
zip binutils-arm-linux-gnueabihf libc6-dev:armhf \
linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf \
libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf \
liblttng-ust0:armhf libstdc++-8-dev:armhf
liblttng-ust0:armhf libstdc++-9-dev:armhf
# Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh

View File

@@ -1,6 +1,4 @@
ARG DOTNET_VERSION=5.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
ARG SOURCE_DIR=/src
ARG ARTIFACT_DIR=/jellyfin

View File

@@ -1,6 +1,4 @@
ARG DOTNET_VERSION=5.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
ARG SOURCE_DIR=/src
ARG ARTIFACT_DIR=/jellyfin

View File

@@ -1,6 +1,4 @@
ARG DOTNET_VERSION=5.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
ARG SOURCE_DIR=/src
ARG ARTIFACT_DIR=/jellyfin

View File

@@ -2,7 +2,6 @@ FROM fedora:33
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
ARG SDK_VERSION=5.0
# Docker run environment
ENV SOURCE_DIR=/jellyfin
ENV ARTIFACT_DIR=/dist
@@ -10,10 +9,14 @@ ENV IS_DOCKER=YES
# Prepare Fedora environment
RUN dnf update -yq \
&& dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd
&& dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd wget
# Install DotNET SDK
RUN dnf install -yq dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION}
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
# Create symlinks and directories
RUN ln -sf ${SOURCE_DIR}/deployment/build.fedora.amd64 /build.sh \

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -2,7 +2,6 @@ FROM ubuntu:bionic
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
ARG SDK_VERSION=5.0
# Docker run environment
ENV SOURCE_DIR=/jellyfin
ENV ARTIFACT_DIR=/dist
@@ -18,8 +17,7 @@ RUN apt-get update -yqq \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
# Install dotnet repository
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5972698f-ba44-4664-9c50-bdc69ca70fb7/1cf7d94425d8dd4d5789dfa978d61475/dotnet-sdk-5.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@@ -2,7 +2,6 @@ FROM ubuntu:bionic
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
ARG SDK_VERSION=5.0
# Docker run environment
ENV SOURCE_DIR=/jellyfin
ENV ARTIFACT_DIR=/dist
@@ -17,8 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5972698f-ba44-4664-9c50-bdc69ca70fb7/1cf7d94425d8dd4d5789dfa978d61475/dotnet-sdk-5.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@@ -2,7 +2,6 @@ FROM ubuntu:bionic
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist
ARG SDK_VERSION=5.0
# Docker run environment
ENV SOURCE_DIR=/jellyfin
ENV ARTIFACT_DIR=/dist
@@ -17,8 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5972698f-ba44-4664-9c50-bdc69ca70fb7/1cf7d94425d8dd4d5789dfa978d61475/dotnet-sdk-5.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG ARTIFACT_DIR=/dist

View File

@@ -8,6 +8,16 @@ set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove BuildRequires for dotnet-sdk-6.0, since it's installed manually
pushd fedora
cp -a jellyfin.spec /tmp/spec.orig
sed -i 's/BuildRequires: dotnet/# BuildRequires: dotnet/' jellyfin.spec
popd
fi
# Modify changelog to unstable configuration if IS_UNSTABLE
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
pushd fedora
@@ -37,4 +47,13 @@ fi
rm -f fedora/jellyfin*.tar.gz
if [[ ${IS_DOCKER} == YES ]]; then
pushd fedora
cp -a /tmp/spec.orig jellyfin.spec
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
popd
fi
popd

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE

View File

@@ -8,6 +8,16 @@ set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove BuildRequires for dotnet-sdk-6.0, since it's installed manually
pushd fedora
cp -a jellyfin.spec /tmp/spec.orig
sed -i 's/BuildRequires: dotnet/# BuildRequires: dotnet/' jellyfin.spec
popd
fi
# Modify changelog to unstable configuration if IS_UNSTABLE
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
pushd fedora
@@ -37,4 +47,13 @@ fi
rm -f fedora/jellyfin*.tar.gz
if [[ ${IS_DOCKER} == YES ]]; then
pushd fedora
cp -a /tmp/spec.orig jellyfin.spec
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
popd
fi
popd

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE

View File

@@ -9,9 +9,9 @@ set -o xtrace
pushd ${SOURCE_DIR}
if [[ ${IS_DOCKER} == YES ]]; then
# Remove build-dep for dotnet-sdk-5.0, since it's installed manually
# Remove build-dep for dotnet-sdk-6.0, since it's installed manually
cp -a debian/control /tmp/control.orig
sed -i '/dotnet-sdk-5.0,/d' debian/control
sed -i '/dotnet-sdk-6.0,/d' debian/control
fi
# Modify changelog to unstable configuration if IS_UNSTABLE