From 4eaf8ab130537ebb1a021d412ed86f89882dc78a Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Tue, 2 Nov 2021 08:52:17 -0500 Subject: [PATCH 1/3] Merge pull request #12562 from MichaelSimons/ci-improvements Enable offline build and capture artifacts in PR validation --- .../job/source-build-run-tarball-build.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml index 328623660..138e0c7db 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml @@ -27,13 +27,9 @@ jobs: Fedora33-Online: _runOnline: true _Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2 - - # TODO: Don't run offline in Pr validation until prebuilts are stabilized/removed, otherwise dependency flow continuously breaks PR validation. - # https://github.com/dotnet/source-build/issues/2490 - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - Fedora33-Offline: - _runOnline: false - _Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2 + Fedora33-Offline: + _runOnline: false + _Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2 timeoutInMinutes: 210 variables: _TarballDir: $(Build.StagingDirectory)/tarball @@ -85,10 +81,9 @@ jobs: docker run --rm -v $(_TarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh ${customBuildArgs} -- /p:CleanWhileBuilding=true displayName: Build Tarball - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - publish: '$(_TarballDir)/artifacts/$(_BuildArch)/$(_BuildConfig)/' - artifact: $(Agent.JobName)_Artifacts_Attempt$(System.JobAttempt) - displayName: Publish Source Build Artifacts + - publish: '$(_TarballDir)/artifacts/$(_BuildArch)/$(_BuildConfig)/' + artifact: $(Agent.JobName)_Artifacts_Attempt$(System.JobAttempt) + displayName: Publish Source Build Artifacts - script: | set -x From c603008d19c19ecfbdbbd7449c8e9639b9da7cf9 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Tue, 2 Nov 2021 10:00:09 -0400 Subject: [PATCH 2/3] [release/6.0.1xx] [ArPow] Add smoke test for OmniSharp (#12251) * [ArPow] Add smoke test for OmniSharp * Try setting PATH for tests Hopefully, this helps omnisharp find the SDK. * edits necessary for 6.0 GA status Co-authored-by: MichaelSimons --- src/SourceBuild/tarball/content/smoke-test.sh | 57 +++++++++- ...-Fix-Omnisharp-add-needed-extra-TFMs.patch | 106 ------------------ 2 files changed, 53 insertions(+), 110 deletions(-) delete mode 100644 src/SourceBuild/tarball/patches/runtime/0001-Fix-Omnisharp-add-needed-extra-TFMs.patch diff --git a/src/SourceBuild/tarball/content/smoke-test.sh b/src/SourceBuild/tarball/content/smoke-test.sh index e6b6e5ae6..fc034fecc 100755 --- a/src/SourceBuild/tarball/content/smoke-test.sh +++ b/src/SourceBuild/tarball/content/smoke-test.sh @@ -602,6 +602,56 @@ function runXmlDocTests() { fi } +function runOmniSharpTests() { + dotnetCmd=${dotnetDir}/dotnet + + rm -rf workdir + mkdir workdir + pushd workdir + + curl -sSLO "https://github.com/OmniSharp/omnisharp-roslyn/releases/latest/download/omnisharp-linux-x64.tar.gz" + + mkdir omnisharp + pushd omnisharp + tar xf "../omnisharp-linux-x64.tar.gz" + popd + + # 'blazorwasm' requires prereqs (non-source-built packages) - re-enable with https://github.com/dotnet/source-build/issues/2550 + for project in blazorserver classlib console mstest mvc nunit web webapp webapi worker xunit ; do + + mkdir hello-$project + pushd hello-$project + + "${dotnetCmd}" new $project + popd + + ./omnisharp/run -s "$(readlink -f hello-$project)" > omnisharp.log & + + sleep 5 + + pkill -P $$ + + # Omnisharp spawns off a number of processes. They all include the + # current directory as a process argument, so use that to identify and + # kill them. + pgrep -f "$(pwd)" + + kill "$(pgrep -f "$(pwd)")" + + cat omnisharp.log + + if grep ERROR omnisharp.log; then + echo "test failed" + exit 1 + else + echo "OK" + fi + + done + + popd +} + function resetCaches() { rm -rf "$testingHome" mkdir "$testingHome" @@ -684,10 +734,7 @@ echo SDK under test is: export NUGET_PACKAGES="$restoredPackagesDir" SOURCE_BUILT_PKGS_PATH="$SCRIPT_ROOT/artifacts/obj/$buildArch/$configuration/blob-feed/packages/" export DOTNET_ROOT="$dotnetDir" -# OSX also requires DOTNET_ROOT to be on the PATH -if [ "$(uname)" == 'Darwin' ]; then - export PATH="$dotnetDir:$PATH" -fi +export PATH="$dotnetDir:$PATH" # Run all tests, local restore sources first, online restore sources second if [ "$excludeLocalTests" == "false" ]; then @@ -728,4 +775,6 @@ fi runXmlDocTests +runOmniSharpTests + echo "ALL TESTS PASSED!" diff --git a/src/SourceBuild/tarball/patches/runtime/0001-Fix-Omnisharp-add-needed-extra-TFMs.patch b/src/SourceBuild/tarball/patches/runtime/0001-Fix-Omnisharp-add-needed-extra-TFMs.patch deleted file mode 100644 index 9072fbd50..000000000 --- a/src/SourceBuild/tarball/patches/runtime/0001-Fix-Omnisharp-add-needed-extra-TFMs.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 827f1e036db2082b56b003f870f5ff8dabc9b1ed Mon Sep 17 00:00:00 2001 -From: Chris Rummel -Date: Tue, 12 Oct 2021 14:04:27 -0500 -Subject: [PATCH] Fix Omnisharp: Add needed extra TFMs. - -Omnisharp requires the net46 TFMs of this files explictly and we don't build them by default. This patch adds net46 to the relevant projects. The original issue for this was https://github.com/OmniSharp/omnisharp-vscode/issues/4610 and the long-term fix of switching to net>4 TFM is tracked in https://github.com/OmniSharp/omnisharp-vscode/issues/4360. - ---- - src/libraries/Directory.Build.props | 2 +- - .../ref/System.Resources.Extensions.csproj | 4 ++-- - .../src/System.Resources.Extensions.csproj | 2 +- - .../ref/System.Runtime.CompilerServices.Unsafe.csproj | 4 ++-- - .../src/System.Runtime.CompilerServices.Unsafe.ilproj | 6 +++++- - 5 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props -index a03b334346a..30418e38a2a 100644 ---- a/src/libraries/Directory.Build.props -+++ b/src/libraries/Directory.Build.props -@@ -20,7 +20,7 @@ - false - $(RepositoryEngineeringDir)LicenseHeader.txt - -- net461;net462;net47;net471;net472 -+ net46;net461;net462;net47;net471;net472 - - - -diff --git a/src/libraries/System.Resources.Extensions/ref/System.Resources.Extensions.csproj b/src/libraries/System.Resources.Extensions/ref/System.Resources.Extensions.csproj -index 99037ae459c..848be41690c 100644 ---- a/src/libraries/System.Resources.Extensions/ref/System.Resources.Extensions.csproj -+++ b/src/libraries/System.Resources.Extensions/ref/System.Resources.Extensions.csproj -@@ -1,6 +1,6 @@ - - -- $(NetCoreAppCurrent);netstandard2.0;net461 -+ $(NetCoreAppCurrent);netstandard2.0;net46;net461 - enable - - -@@ -11,4 +11,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj -index a0a79e45adf..29c9b123ce5 100644 ---- a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj -+++ b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj -@@ -1,7 +1,7 @@ - - - true -- $(NetCoreAppCurrent);netstandard2.0;net461 -+ $(NetCoreAppCurrent);netstandard2.0;net46;net461 - $(DefineConstants);RESOURCES_EXTENSIONS - enable - true -diff --git a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj -index 766ea9a8ae7..5324c85404b 100644 ---- a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj -+++ b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj -@@ -3,7 +3,7 @@ - true - false - enable -- $(NetCoreAppCurrent);netcoreapp3.1;netstandard2.1;netstandard2.0;net461 -+ $(NetCoreAppCurrent);netcoreapp3.1;netstandard2.1;netstandard2.0;net46;net461 - - - -@@ -14,4 +14,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj b/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj -index a9e3de0c454..75467734292 100644 ---- a/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj -+++ b/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj -@@ -1,6 +1,6 @@ -  - -- $(NetCoreAppCurrent);netcoreapp3.1;netstandard2.0;net461 -+ $(NetCoreAppCurrent);netcoreapp3.1;netstandard2.0;net46;net461 - - IMPL - OPT -@@ -20,6 +20,10 @@ System.Runtime.CompilerServices.Unsafe - - netstandard - -+ -+ mscorlib -+ #define $(TargetFramework) -+ - - mscorlib - #define $(TargetFramework) --- -2.18.0 - From 9a65036f1eb18a3817fbe97de67712948b0db9b2 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Tue, 2 Nov 2021 13:53:51 -0500 Subject: [PATCH 3/3] Enable public tarball CI (#12586) --- eng/source-build-tarball-build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eng/source-build-tarball-build.yml b/eng/source-build-tarball-build.yml index 2c7a9ae59..036c285f7 100644 --- a/eng/source-build-tarball-build.yml +++ b/eng/source-build-tarball-build.yml @@ -3,8 +3,11 @@ pr: none resources: pipelines: - pipeline: installer-build-resource - source: dotnet-installer-official-ci - trigger: true # Run pipeline when any run of dotnet-installer-official-ci completes + ${{ if eq(variables['System.TeamProject'], 'public') }}: + source: installer + ${{ if ne(variables['System.TeamProject'], 'public') }}: + source: dotnet-installer-official-ci + trigger: true # Run pipeline when any run of installer CI completes stages: - stage: build