diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml new file mode 100644 index 000000000..7ce2ad732 --- /dev/null +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml @@ -0,0 +1,203 @@ +# Builds a source-build tarball + +parameters: + # Architecture to build + architecture: + + # Custom condition to apply to the job + condition: + + # Dependent jobs that must be completed before this job will run + dependsOn: + + # Skip running the SDK content smoke-tests + excludeSdkContentTests: false + + # Resource id of the installer build to retrieve source/product tarball's from + installerBuildResourceId: + + # Matrix to run jobs over + matrix: + + # Job name + name: + + # Agent pool to use + pool: + + # Build using the previous source-build artifacts + usePreviousArtifacts: false + +jobs: +- job: ${{ parameters.name }} + condition: ${{ parameters.condition }} + dependsOn: ${{ parameters.dependsOn }} + pool: ${{ parameters.pool }} + strategy: + matrix: ${{ parameters.matrix }} + timeoutInMinutes: 300 + variables: + - ${{ if ne(variables['System.TeamProject'], 'public') }}: + - group: AzureDevOps-Artifact-Feeds-Pats + - ${{ if eq(parameters.usePreviousArtifacts, 'true') }}: + - name: additionalBuildArgs + value: --with-sdk /tarball/.dotnet + - name: tarballDir + value: $(Build.StagingDirectory)/tarball + workspace: + clean: all + + steps: + - checkout: self + clean: true + + - ${{ if ne(variables['System.TeamProject'], 'public') }}: + - task: Bash@3 + displayName: Setup Private Feeds Credentials + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh + arguments: $(Build.SourcesDirectory)/NuGet.config $Token + env: + Token: $(dn-bot-dnceng-artifact-feeds-rw) + + - download: ${{ parameters.installerBuildResourceId }} + artifact: BlobArtifacts + patterns: '**/dotnet-sdk-source*.tar.gz' + displayName: Download Source Tarball + + - ${{ if ne(parameters.excludeSdkContentTests, 'true') }}: + - download: ${{ parameters.installerBuildResourceId }} + artifact: BlobArtifacts + patterns: '**/dotnet-sdk-!(*-*)-linux-${{ parameters.architecture }}.tar.gz' + displayName: Download MSFT sdk Tarball + + - ${{ if eq(parameters.usePreviousArtifacts, 'true') }}: + - download: current + artifact: $(_PreviousSourceBuildArtifact) + patterns: '*.tar.gz' + displayName: Download Previous Source Build Artifacts + + - task: CopyFiles@2 + displayName: Copy Previous Source Build Artifacts + inputs: + SourceFolder: $(PIPELINE.WORKSPACE)/$(_PreviousSourceBuildArtifact) + Contents: '*.tar.gz' + TargetFolder: $(tarballDir)/packages/archive/ + + - script: | + set -x + + resourceIdPathSegment= + if [[ '${{ parameters.installerBuildResourceId }}' != 'current' ]]; then + resourceIdPathSegment='${{ parameters.installerBuildResourceId }}/' + fi + + mkdir -p "$(tarballDir)" + tarballFilePath="$(PIPELINE.WORKSPACE)/${resourceIdPathSegment}BlobArtifacts/dotnet-sdk-source*.tar.gz" + eval tar -ozxf "$tarballFilePath" -C "$(tarballDir)" + eval rm -f "$tarballFilePath" + displayName: Extract Tarball + + - script: | + set -x + + if [[ '${{ parameters.usePreviousArtifacts }}' != 'true' ]]; then + customPrepArgs= + if [[ '$(_BootstrapPrep)' == 'true' ]]; then + customPrepArgs='--bootstrap' + fi + + docker run --rm -v $(tarballDir):/tarball -w /tarball $(_Container) ./prep.sh ${customPrepArgs} + else + mkdir $(tarballDir)/.dotnet + tarballFilePath="$(tarballDir)/packages/archive/dotnet-sdk-*.tar.gz" + eval tar -ozxf "$tarballFilePath" -C "$(tarballDir)/.dotnet" + eval rm -f "$tarballFilePath" + fi + displayName: Prep Tarball + + - script: | + set -x + df -h + + networkArgs= + customBuildArgs= + if [[ '$(_RunOnline)' == 'true' ]]; then + customBuildArgs='--online' + else + networkArgs='--network none' + fi + + if [[ '$(_EnablePoison)' == 'true' ]]; then + customBuildArgs="$customBuildArgs --poison" + fi + + docker run --rm -v $(tarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh ${customBuildArgs} $(additionalBuildArgs) -- /p:CleanWhileBuilding=true + displayName: Build Tarball + + - script: | + set -x + + # Use installer repo's NuGet.config during online testing to utilize internal feeds + rm -f $(tarballDir)/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/online.NuGet.Config + cp $(Build.SourcesDirectory)/NuGet.config $(tarballDir)/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/online.NuGet.Config + + dockerVolumeArgs="-v $(tarballDir):/tarball" + dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=$(_ExcludeOmniSharpTests) -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true" + poisonArg='' + + if [[ '${{ parameters.excludeSdkContentTests}}' != 'true' && '${{ parameters.installerBuildResourceId }}' != 'current' ]]; then + dockerVolumeArgs+=" -v $(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/:/BlobArtifacts" + msftSdkTarballName=$(find "$(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/" -name "dotnet-sdk-*-linux-${{ parameters.architecture }}.tar.gz" -exec basename {} \;) + dockerEnvArgs+=" -e SMOKE_TESTS_MSFT_SDK_TARBALL_PATH=/BlobArtifacts/$msftSdkTarballName" + fi + + if [[ '$(_EnablePoison)' == 'true' ]]; then + poisonArg='--poison' + dockerEnvArgs+=" -e SMOKE_TESTS_WARN_POISON_DIFFS=true" + fi + + docker run --rm $dockerVolumeArgs -w /tarball $dockerEnvArgs $(_Container) ./build.sh $poisonArg --run-smoke-test $(additionalBuildArgs) -- /p:SmokeTestConsoleVerbosity=detailed + displayName: Run Tests + + # Don't use CopyFiles@2 as it encounters permissions issues because it indexes all files in the source directory graph. + - script: | + set -x + + targetFolder=$(Build.StagingDirectory)/BuildLogs/ + mkdir -p ${targetFolder} + + cd "$(tarballDir)" + find artifacts/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; + find artifacts/ -type f -name "*.log" -exec cp {} --parents -t ${targetFolder} \; + find artifacts/prebuilt-report/ -exec cp {} --parents -t ${targetFolder} \; + find src/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; + find src/ -type f -name "*.log" -exec cp {} --parents -t ${targetFolder} \; + find test/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; + displayName: Prepare BuildLogs staging directory + continueOnError: true + condition: succeededOrFailed() + + - publish: '$(Build.StagingDirectory)/BuildLogs' + artifact: $(Agent.JobName)_BuildLogs_Attempt$(System.JobAttempt) + displayName: Publish BuildLogs + continueOnError: true + condition: succeededOrFailed() + + - task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + continueOnError: true + inputs: + testRunner: vSTest + testResultsFiles: 'test/**/*.trx' + searchFolder: $(tarballDir) + mergeTestResults: true + publishRunAttachments: true + testRunTitle: SourceBuild_SmokeTests_$(Agent.JobName) + + - publish: '$(tarballDir)/artifacts/${{ parameters.architecture}}/Release/' + artifact: $(Agent.JobName)_Artifacts + displayName: Publish Artifacts + condition: succeededOrFailed() + continueOnError: true 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 b6fd560d6..d9651229b 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 @@ -12,170 +12,113 @@ parameters: # The following parameters aren't expected to be passed in rather they are used for encapsulation # ----------------------------------------------------------------------------------------------- - buildJobTimeout: 300 centOS7Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-source-build-20210714125450-5d87b80 centOS8Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-source-build-20211118190102-9355e7b centOSStream9Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-20220107135047-4cd394c debian9Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-20211001171226-047508b + debian9Arm64Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-9-arm64v8-20220405201138-a251961 fedora33Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2 ubuntu1804Container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20210924170306-047508b - poolInternal: + poolInternalAmd64: name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 - poolPublic: + poolInternalArm64: + name: Docker-Linux-Arm-Internal + poolPublicAmd64: name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open - tarballDir: $(Build.StagingDirectory)/tarball jobs: -- job: Build_Tarball - condition: ${{ parameters.condition }} - displayName: Build Tarball - dependsOn: ${{ parameters.dependsOn }} - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - ${{ parameters.poolPublic }} - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ parameters.poolInternal }} - strategy: +- template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml + parameters: + architecture: x64 + condition: ${{ parameters.condition }} + dependsOn: ${{ parameters.dependsOn }} + installerBuildResourceId: ${{ parameters.installerBuildResourceId }} matrix: CentOS7-Online: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.centOS7Container }} _EnablePoison: false _ExcludeOmniSharpTests: true - _Platform: linux _RunOnline: true CentOS7-Offline: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.centOS7Container }} _EnablePoison: false _ExcludeOmniSharpTests: true - _Platform: linux _RunOnline: false ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: CentOS8-Offline: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.centOS8Container }} _EnablePoison: false _ExcludeOmniSharpTests: false - _Platform: linux _RunOnline: false CentOSStream9-Offline: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.centOSStream9Container }} _EnablePoison: false _ExcludeOmniSharpTests: false - _Platform: linux _RunOnline: false Fedora33-Offline: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.fedora33Container }} _EnablePoison: true _ExcludeOmniSharpTests: false - _Platform: linux _RunOnline: false Ubuntu1804-Offline: _BootstrapPrep: false - _BuildArch: x64 _Container: ${{ parameters.ubuntu1804Container }} _EnablePoison: false _ExcludeOmniSharpTests: false - _Platform: linux _RunOnline: false - timeoutInMinutes: ${{ parameters.buildJobTimeout }} - variables: - - ${{ if ne(variables['System.TeamProject'], 'public') }}: - - group: AzureDevOps-Artifact-Feeds-Pats - workspace: - clean: all - - steps: - - checkout: self - clean: true - - - template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml - parameters: - buildArch: $(_BuildArch) - container: $(_Container) - enablePoison: $(_EnablePoison) - excludeOmniSharpTests: $(_ExcludeOmniSharpTests) - installerBuildResourceId: ${{ parameters.installerBuildResourceId }} - platform: $(_Platform) - prepScript: | - set -x - - customPrepArgs= - if [[ '$(_BootstrapPrep)' == 'true' ]]; then - customPrepArgs='--bootstrap' - fi - - docker run --rm -v ${{ parameters.tarballDir }}:/tarball -w /tarball $(_Container) ./prep.sh ${customPrepArgs} - runOnline: $(_RunOnline) - tarballDir: ${{ parameters.tarballDir }} - -- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - - job: Rebuild_Tarball - displayName: Rebuild Tarball With Previous - dependsOn: Build_Tarball - # Always attempt to run the bootstrap leg (e.g. even when stage 1 tests fail) in order to get a complete accessment of the build status. - # The bootstrap build will shortcut if the stage 1 build failed. - condition: and(${{ parameters.condition }}, succeededOrFailed()) + name: Build_Tarball_x64 pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - ${{ parameters.poolPublic }} + ${{ parameters.poolPublicAmd64 }} ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ parameters.poolInternal }} - strategy: + ${{ parameters.poolInternalAmd64 }} + +- ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml + parameters: + architecture: arm64 + condition: ${{ parameters.condition }} + dependsOn: ${{ parameters.dependsOn }} + installerBuildResourceId: ${{ parameters.installerBuildResourceId }} + matrix: + ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + Debian9-Offline: + _BootstrapPrep: true + _Container: ${{ parameters.debian9Arm64Container }} + _EnablePoison: false + _ExcludeOmniSharpTests: false + _RunOnline: false + name: Build_Tarball_arm64 + pool: ${{ parameters.poolInternalArm64 }} + +- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml + parameters: + architecture: x64 + # Always attempt to run the bootstrap leg (e.g. even when stage 1 tests fail) in order to get a complete accessment of the build status. + # The bootstrap build will shortcut if the stage 1 build failed. + condition: and(${{ parameters.condition }}, succeededOrFailed()) + dependsOn: Build_Tarball_x64 + excludeSdkContentTests: true + installerBuildResourceId: ${{ parameters.installerBuildResourceId }} matrix: Fedora33-Offline: - _PreviousSourceBuildArtifact: Build Tarball Fedora33-Offline_Artifacts - _BuildArch: x64 + _PreviousSourceBuildArtifact: Build_Tarball_x64 Fedora33-Offline_Artifacts _Container: ${{ parameters.fedora33Container }} - _Platform: linux + _EnablePoison: false + _ExcludeOmniSharpTests: false _RunOnline: false - timeoutInMinutes: ${{ parameters.buildJobTimeout }} - variables: - - ${{ if ne(variables['System.TeamProject'], 'public') }}: - - group: AzureDevOps-Artifact-Feeds-Pats - workspace: - clean: all - - steps: - - checkout: self - clean: true - - - download: current - artifact: $(_PreviousSourceBuildArtifact) - patterns: '*.tar.gz' - displayName: Download Previous Source Build Artifacts - - - task: CopyFiles@2 - displayName: Copy Previous Source Build Artifacts - inputs: - SourceFolder: $(PIPELINE.WORKSPACE)/$(_PreviousSourceBuildArtifact) - Contents: '*.tar.gz' - TargetFolder: ${{ parameters.tarballDir }}/packages/archive/ - - - template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml - parameters: - additionalBuildArgs: --with-sdk /tarball/.dotnet - buildArch: $(_BuildArch) - container: $(_Container) - installerBuildResourceId: ${{ parameters.installerBuildResourceId }} - isBootstrapped: true - platform: $(_Platform) - prepScript: | - set -x - - mkdir ${{ parameters.tarballDir }}/.dotnet - tarballFilePath="${{ parameters.tarballDir }}/packages/archive/dotnet-sdk-*.tar.gz" - eval tar -ozxf "$tarballFilePath" -C "${{ parameters.tarballDir }}/.dotnet" - eval rm -f "$tarballFilePath" - runOnline: $(_RunOnline) - tarballDir: ${{ parameters.tarballDir }} + name: Build_Tarball_x64_Using_Previous + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + ${{ parameters.poolPublicAmd64 }} + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + ${{ parameters.poolInternalAmd64 }} + usePreviousArtifacts: true diff --git a/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml deleted file mode 100644 index 99e54f4ab..000000000 --- a/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml +++ /dev/null @@ -1,158 +0,0 @@ -# Steps used to build a source-build tarball - -parameters: - # Additional custom build args - additionalBuildArgs: "" - - # Architecture to build - buildArch: null - - # Container image to build within - container: null - - # Enable the poison report - enablePoison: false - - # Skip running the OmniSharp smoke-tests - excludeOmniSharpTests: false - - # Resource id of the installer build to retrieve source/product tarball's from - installerBuildResourceId: null - - # Whether or not this is a bootstrapped build - isBootstrapped: false - - # Platform the build is running on (linux, osx, win) - platform: null - - # Script logic to prep the tarball for building - prepScript: null - - # Whether or not to build online - runOnline: false - - # Directory to build the tarball in - tarballDir: - -steps: - - ${{ if ne(variables['System.TeamProject'], 'public') }}: - - task: Bash@3 - displayName: Setup Private Feeds Credentials - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh - arguments: $(Build.SourcesDirectory)/NuGet.config $Token - env: - Token: $(dn-bot-dnceng-artifact-feeds-rw) - - - download: ${{ parameters.installerBuildResourceId }} - artifact: BlobArtifacts - patterns: '**/dotnet-sdk-source*.tar.gz' - displayName: Download Source Tarball - - - download: ${{ parameters.installerBuildResourceId }} - artifact: BlobArtifacts - patterns: '**/dotnet-sdk-!(*-*)-${{ parameters.platform }}-${{ parameters.buildArch }}.tar.gz' - displayName: Download MSFT sdk Tarball - - - script: | - set -x - - resourceIdPathSegment= - if [[ '${{ parameters.installerBuildResourceId }}' != 'current' ]]; then - resourceIdPathSegment='${{ parameters.installerBuildResourceId }}/' - fi - - mkdir -p "${{ parameters.tarballDir }}" - tarballFilePath="$(PIPELINE.WORKSPACE)/${resourceIdPathSegment}BlobArtifacts/dotnet-sdk-source*.tar.gz" - eval tar -ozxf "$tarballFilePath" -C "${{ parameters.tarballDir }}" - eval rm -f "$tarballFilePath" - displayName: Extract Tarball - - - script: ${{ parameters.prepScript }} - displayName: Prep Tarball - - - script: | - set -x - df -h - - networkArgs= - customBuildArgs= - if [[ '${{ parameters.runOnline }}' == 'true' ]]; then - customBuildArgs='--online' - else - networkArgs='--network none' - fi - - if [[ '${{ parameters.enablePoison }}' == 'true' ]]; then - customBuildArgs="$customBuildArgs --poison" - fi - - docker run --rm -v ${{ parameters.tarballDir }}:/tarball -w /tarball ${networkArgs} ${{ parameters.container }} ./build.sh ${customBuildArgs} ${{ parameters.additionalBuildArgs }} -- /p:CleanWhileBuilding=true - displayName: Build Tarball - - - script: | - set -x - - # Use installer repo's NuGet.config during online testing to utilize internal feeds - rm -f ${{ parameters.tarballDir }}/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/online.NuGet.Config - cp $(Build.SourcesDirectory)/NuGet.config ${{ parameters.tarballDir }}/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/online.NuGet.Config - - dockerVolumeArgs="-v ${{ parameters.tarballDir }}:/tarball" - dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=${{ parameters.excludeOmniSharpTests}} -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true" - poisonArg='' - - if [[ '${{ parameters.isBootstrapped }}' != 'true' && '${{ parameters.installerBuildResourceId }}' != 'current' ]]; then - dockerVolumeArgs+=" -v $(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/:/BlobArtifacts" - msftSdkTarballName=$(find "$(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/" -name "dotnet-sdk-*-${{ parameters.Platform }}-${{ parameters.buildArch }}.tar.gz" -exec basename {} \;) - dockerEnvArgs+=" -e SMOKE_TESTS_MSFT_SDK_TARBALL_PATH=/BlobArtifacts/$msftSdkTarballName" - fi - - if [[ '${{ parameters.enablePoison }}' == 'true' ]]; then - poisonArg='--poison' - dockerEnvArgs+=" -e SMOKE_TESTS_WARN_POISON_DIFFS=true" - fi - - docker run --rm $dockerVolumeArgs -w /tarball $dockerEnvArgs ${{ parameters.container }} ./build.sh $poisonArg --run-smoke-test ${{ parameters.additionalBuildArgs }} -- /p:SmokeTestConsoleVerbosity=detailed - displayName: Run Tests - - # Don't use CopyFiles@2 as it encounters permissions issues because it indexes all files in the source directory graph. - - script: | - set -x - - targetFolder=$(Build.StagingDirectory)/BuildLogs/ - mkdir -p ${targetFolder} - - cd "${{ parameters.tarballDir }}" - find artifacts/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; - find artifacts/ -type f -name "*.log" -exec cp {} --parents -t ${targetFolder} \; - find artifacts/prebuilt-report/ -exec cp {} --parents -t ${targetFolder} \; - find src/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; - find src/ -type f -name "*.log" -exec cp {} --parents -t ${targetFolder} \; - find test/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; - displayName: Prepare BuildLogs staging directory - continueOnError: true - condition: succeededOrFailed() - - - publish: '$(Build.StagingDirectory)/BuildLogs' - artifact: $(Agent.JobName)_BuildLogs_Attempt$(System.JobAttempt) - displayName: Publish BuildLogs - continueOnError: true - condition: succeededOrFailed() - - - task: PublishTestResults@2 - displayName: Publish Test Results - condition: succeededOrFailed() - continueOnError: true - inputs: - testRunner: vSTest - testResultsFiles: 'test/**/*.trx' - searchFolder: ${{ parameters.tarballDir }} - mergeTestResults: true - publishRunAttachments: true - testRunTitle: SourceBuild_SmokeTests_$(Agent.JobName) - - - publish: '${{ parameters.tarballDir }}/artifacts/${{ parameters.buildArch}}/Release/' - artifact: $(Agent.JobName)_Artifacts - displayName: Publish Artifacts - condition: succeededOrFailed() - continueOnError: true diff --git a/src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj b/src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj index 6fc81bf3d..f7cad5354 100644 --- a/src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj +++ b/src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj @@ -11,10 +11,6 @@ should be added to source-build-reference-packages. --> - - - - diff --git a/src/SourceBuild/tarball/content/Directory.Build.props b/src/SourceBuild/tarball/content/Directory.Build.props index fdc0999af..61cc6ff67 100644 --- a/src/SourceBuild/tarball/content/Directory.Build.props +++ b/src/SourceBuild/tarball/content/Directory.Build.props @@ -177,13 +177,12 @@ OSX Linux FreeBSD - - - freebsd-$(Platform) - osx-$(Platform) - linux-$(Platform) - win-$(Platform) + freebsd-$(Platform) + osx-$(Platform) + linux-$(Platform) + win-$(Platform) + $(PortableRid) diff --git a/src/SourceBuild/tarball/content/build.proj b/src/SourceBuild/tarball/content/build.proj index 4c76732f7..52c3341e0 100644 --- a/src/SourceBuild/tarball/content/build.proj +++ b/src/SourceBuild/tarball/content/build.proj @@ -106,6 +106,7 @@ EnvironmentVariables=" SMOKE_TESTS_SDK_TARBALL_PATH=$(SdkTarballPath); SMOKE_TESTS_TARGET_RID=$(TargetRid); + SMOKE_TESTS_PORTABLE_RID=$(PortableRid); $(CustomTestEnvVars)" /> diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs index abcf4dba9..8070b2576 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs @@ -85,7 +85,8 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests private static string GetBaselineFilePath(string baselineFileName) => Path.Combine(GetAssetsDirectory(), "baselines", baselineFileName); - public static string RemoveRids(string diff) => diff.Replace(Config.TargetRid, "banana.rid"); + public static string RemoveRids(string diff, bool isPortable = false) => + isPortable ? diff.Replace(Config.PortableRid, "portable-rid") : diff.Replace(Config.TargetRid, "banana-rid"); public static string RemoveVersions(string source) { diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs index 0aaab59ff..67b5bfc78 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs @@ -13,6 +13,7 @@ internal static class Config public const string ExcludeOmniSharpEnv = "SMOKE_TESTS_EXCLUDE_OMNISHARP"; public const string MsftSdkTarballPathEnv = "SMOKE_TESTS_MSFT_SDK_TARBALL_PATH"; public const string PoisonReportPathEnv = "SMOKE_TESTS_POISON_REPORT_PATH"; + public const string PortableRidEnv = "SMOKE_TESTS_PORTABLE_RID"; public const string PrereqsPathEnv = "SMOKE_TESTS_PREREQS_PATH"; public const string SdkTarballPathEnv = "SMOKE_TESTS_SDK_TARBALL_PATH"; public const string TargetRidEnv = "SMOKE_TESTS_TARGET_RID"; @@ -23,6 +24,8 @@ internal static class Config Environment.GetEnvironmentVariable(DotNetDirectoryEnv) ?? Path.Combine(Directory.GetCurrentDirectory(), ".dotnet"); public static string? MsftSdkTarballPath { get; } = Environment.GetEnvironmentVariable(MsftSdkTarballPathEnv); public static string? PoisonReportPath { get; } = Environment.GetEnvironmentVariable(PoisonReportPathEnv); + public static string PortableRid { get; } = Environment.GetEnvironmentVariable(PortableRidEnv) ?? + throw new InvalidOperationException($"'{Config.PortableRidEnv}' must be specified"); public static string? PrereqsPath { get; } = Environment.GetEnvironmentVariable(PrereqsPathEnv); public static string? SdkTarballPath { get; } = Environment.GetEnvironmentVariable(SdkTarballPathEnv); public static string TargetRid { get; } = Environment.GetEnvironmentVariable(TargetRidEnv) ?? diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SdkContentTests.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SdkContentTests.cs index 2ca4b03a4..342a9e2f4 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SdkContentTests.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SdkContentTests.cs @@ -27,17 +27,16 @@ public class SdkContentTests : SmokeTests { const string msftFileListingFileName = "msftSdkFiles.txt"; const string sbFileListingFileName = "sbSdkFiles.txt"; - WriteTarballFileList(Config.MsftSdkTarballPath, msftFileListingFileName); - WriteTarballFileList(Config.SdkTarballPath, sbFileListingFileName); + WriteTarballFileList(Config.MsftSdkTarballPath, msftFileListingFileName, isPortable: true); + WriteTarballFileList(Config.SdkTarballPath, sbFileListingFileName, isPortable: false); string diff = BaselineHelper.DiffFiles(msftFileListingFileName, sbFileListingFileName, OutputHelper); diff = BaselineHelper.RemoveVersions(diff); diff = RemoveDiffMarkers(diff); - diff = BaselineHelper.RemoveRids(diff); BaselineHelper.CompareContents("MsftToSbSdk.diff", diff, OutputHelper, Config.WarnOnSdkContentDiffs); } - private void WriteTarballFileList(string? tarballPath, string outputFileName) + private void WriteTarballFileList(string? tarballPath, string outputFileName, bool isPortable) { if (!File.Exists(tarballPath)) { @@ -45,7 +44,9 @@ public class SdkContentTests : SmokeTests } string fileListing = ExecuteHelper.ExecuteProcessValidateExitCode("tar", $"tf {tarballPath}", OutputHelper); + fileListing = BaselineHelper.RemoveRids(fileListing, isPortable); IEnumerable files = fileListing.Split(Environment.NewLine).OrderBy(path => path); + File.WriteAllLines(outputFileName, files); } diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdk.diff b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdk.diff index f1600a4aa..9a44f27de 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdk.diff +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdk.diff @@ -31,34 +31,34 @@ index ------------ +./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Security.AccessControl.xml ./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Security.Cryptography.Xml.dll ./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Security.Cryptography.Xml.xml --./packs/Microsoft.NETCore.App.Host.linux-x64/ --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/ --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/ --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/ --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/ --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/apphost --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/coreclr_delegates.h --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/hostfxr.h --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/libnethost.a --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/libnethost.so --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/nethost.h --./packs/Microsoft.NETCore.App.Host.linux-x64/x.y.z/runtimes/linux-x64/native/singlefilehost +-./packs/Microsoft.NETCore.App.Host.portable-rid/ +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/ +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/ +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/ +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/ +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/apphost +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/coreclr_delegates.h +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/hostfxr.h +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/libnethost.a +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/libnethost.so +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/nethost.h +-./packs/Microsoft.NETCore.App.Host.portable-rid/x.y.z/runtimes/portable-rid/native/singlefilehost +./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Text.Encodings.Web.dll +./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Text.Encodings.Web.xml +./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Text.Json.dll +./packs/Microsoft.AspNetCore.App.Ref/x.y.z/ref/netx.y/System.Text.Json.xml -+./packs/Microsoft.NETCore.App.Host.banana.rid/ -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/ -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/ -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/ -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/ -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/apphost -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/coreclr_delegates.h -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/hostfxr.h -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/libnethost.a -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/libnethost.so -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/nethost.h -+./packs/Microsoft.NETCore.App.Host.banana.rid/x.y.z/runtimes/banana.rid/native/singlefilehost ++./packs/Microsoft.NETCore.App.Host.banana-rid/ ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/ ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/ ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/ ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/ ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/apphost ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/coreclr_delegates.h ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/hostfxr.h ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/libnethost.a ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/libnethost.so ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/nethost.h ++./packs/Microsoft.NETCore.App.Host.banana-rid/x.y.z/runtimes/banana-rid/native/singlefilehost ./packs/Microsoft.NETCore.App.Ref/ ./packs/Microsoft.NETCore.App.Ref/x.y.z/ ./packs/Microsoft.NETCore.App.Ref/x.y.z/analyzers/ @@ -1478,4 +1478,4 @@ index ------------ +./shared/Microsoft.AspNetCore.App/x.y.z/System.Text.Json.dll ./shared/Microsoft.AspNetCore.App/x.y.z/THIRD-PARTY-NOTICES.txt ./shared/Microsoft.NETCore.App/ - ./shared/Microsoft.NETCore.App/x.y.z/ \ No newline at end of file + ./shared/Microsoft.NETCore.App/x.y.z/ diff --git a/src/SourceBuild/tarball/patches/aspnetcore/0001-Revert-Revert-release-6.0-Build-ProjectTemplates-in-.patch b/src/SourceBuild/tarball/patches/aspnetcore/0001-Revert-Revert-release-6.0-Build-ProjectTemplates-in-.patch new file mode 100644 index 000000000..7ada1a116 --- /dev/null +++ b/src/SourceBuild/tarball/patches/aspnetcore/0001-Revert-Revert-release-6.0-Build-ProjectTemplates-in-.patch @@ -0,0 +1,113 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Godbe +Date: Wed, 23 Mar 2022 09:11:11 -0700 +Subject: [PATCH] Revert "Revert "[release/6.0] Build ProjectTemplates in + Source-Build (#40650)" (#40805)" + +This reverts commit a351c437ac7bc9f9be96de51832608438a7a37df. +--- + Directory.Build.props | 3 +++ + Directory.Build.targets | 9 +++++++-- + .../src/Microsoft.Authentication.WebAssembly.Msal.csproj | 9 ++++++++- + ...pNetCore.Components.WebAssembly.Authentication.csproj | 9 ++++++++- + 4 files changed, 26 insertions(+), 4 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 8f0ac59422..721f099a77 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -30,6 +30,9 @@ + $(MSBuildProjectName.EndsWith('.Test')) OR + $(MSBuildProjectName.EndsWith('.FunctionalTest')) ) ">true + true ++ true + true + true + true ++ Condition="'$(ExcludeFromSourceBuild)' == '' and ++ '$(DotNetBuildFromSource)' == 'true' and ++ '$(IsAspNetCoreApp)' != 'true' and ++ '$(MSBuildProjectName)' != '$(TargetingPackName)' and ++ '$(IsAnalyzersProject)' != 'true' and ++ '$(IsProjectTemplateProject)' != 'true'">true + + +diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj +index 8ae5d1c43d..8e0f53957e 100644 +--- a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj ++++ b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj +@@ -1,6 +1,6 @@ +  + +- ++ + + + $(DefaultNetCoreTargetFramework) +@@ -25,6 +25,7 @@ + + $(MSBuildThisFileDirectory)Interop\ + ++ CheckForSourceBuild; + CompileInterop; + IncludeCompileInteropOutput; + $(ResolveStaticWebAssetsInputsDependsOn) +@@ -91,5 +92,11 @@ + + + ++ ++ ++ ++ ++ ++ + + +diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj +index 8d6a000d74..35c79a73eb 100644 +--- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj ++++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj +@@ -1,6 +1,6 @@ + + +- ++ + + + $(DefaultNetCoreTargetFramework) +@@ -26,6 +26,7 @@ + + $(MSBuildThisFileDirectory)Interop\ + ++ CheckForSourceBuild; + CompileInterop; + IncludeCompileInteropOutput; + $(ResolveStaticWebAssetsInputsDependsOn) +@@ -93,4 +94,10 @@ + + + ++ ++ ++ ++ ++ ++ +