From 07eb0ec9eba89a8ec27c34208929c812b63de7b2 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Wed, 10 Mar 2021 16:29:46 +0000 Subject: [PATCH 1/3] ArPow stage 1: local source-build infrastructure --- azure-pipelines.yml | 57 +------------------ eng/SourceBuild.props | 39 +++++++++++++ eng/SourceBuildPrebuiltBaseline.xml | 5 ++ eng/Version.Details.xml | 6 ++ eng/build.sh | 45 ++++++++------- eng/common/templates/steps/source-build.yml | 2 +- .../0005-Fix-package-downgrade-warning.patch | 56 ++++++++++++++++++ 7 files changed, 135 insertions(+), 75 deletions(-) create mode 100644 eng/SourceBuild.props create mode 100644 eng/SourceBuildPrebuiltBaseline.xml create mode 100644 eng/source-build-patches/0005-Fix-package-downgrade-warning.patch diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 64ac57d9ddb..6f0ccc916ec 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,6 +84,7 @@ stages: enablePublishTestResults: false enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp jobs: @@ -184,6 +185,7 @@ stages: enablePublishTestResults: false enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp jobs: @@ -331,32 +333,6 @@ stages: - script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release displayName: End to end build tests - # Source Build Windows - - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - job: SourceBuild_Windows - pool: - vmImage: windows-latest - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration Release -noSign -prepareMachine -sourceBuild - displayName: Build - - task: PublishPipelineArtifact@1 - displayName: Publish Logs - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release' - artifactName: 'SourceBuild_Windows Logs' - continueOnError: true - condition: not(succeeded()) - - task: PublishBuildArtifacts@1 - displayName: Publish Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Release' - ArtifactName: 'SourceBuild_Windows_Test' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - # Up-to-date - disabled due to it being flaky #- job: UpToDate_Windows # pool: @@ -370,35 +346,6 @@ stages: # filePath: eng\tests\UpToDate.ps1 # arguments: -configuration $(_BuildConfig) -ci -binaryLog - # Source Build Semi-Official - - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - job: SourceBuild_Official - # used until https://github.com/dotnet/source-build/issues/1795 is fixed - pool: - name: NetCorePublic-Pool - queue: BuildPool.Ubuntu.1604.amd64.Open - timeoutInMinutes: 90 - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration Release --prepareMachine --docker --sourceBuild - displayName: Build - - task: PublishPipelineArtifact@1 - displayName: Publish Logs - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release' - artifactName: 'SourceBuild_Official Logs' - continueOnError: true - condition: not(succeeded()) - - task: PublishBuildArtifacts@1 - displayName: Publish Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Release' - ArtifactName: 'SourceBuild_Official_Test' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - # Plain build Windows # Disabled until the Windows Proto compiler is coreclr # - job: Plain_Build_Windows diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props new file mode 100644 index 00000000000..f7791b47ee4 --- /dev/null +++ b/eng/SourceBuild.props @@ -0,0 +1,39 @@ + + + + fsharp + true + + + + + + + + + + + + + $(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\FSharp.sln" + + + + + + + + + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml new file mode 100644 index 00000000000..c1b6dfbf053 --- /dev/null +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2abf2823983..e7b1f2d15c5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,11 +1,17 @@ + + https://github.com/dotnet/xliff-tasks + 7e80445ee82adbf9a8e6ae601ac5e239d982afaa + + https://github.com/dotnet/arcade 15246f4af00a1cb2e580783d32ec2937b1878a64 + diff --git a/eng/build.sh b/eng/build.sh index 11536de9109..fc9faae4354 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -29,6 +29,7 @@ usage() echo " --ci Building in CI" echo " --docker Run in a docker container if applicable" echo " --skipAnalyzers Do not run analyzers during build operations" + echo " --skipBuild Do not run the build" echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --sourceBuild Simulate building for source-build" echo "" @@ -60,6 +61,7 @@ binary_log=false force_bootstrap=false ci=false skip_analyzers=false +skip_build=false prepare_machine=false source_build=false properties="" @@ -126,6 +128,9 @@ while [[ $# > 0 ]]; do --skipanalyzers) skip_analyzers=true ;; + --skipbuild) + skip_build=true + ;; --preparemachine) prepare_machine=true ;; @@ -260,25 +265,27 @@ function BuildSolution { cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net5.0 $bootstrap_dir/fsc fi - # do real build - BuildMessage="Error building solution" - MSBuild $toolset_build_proj \ - $bl \ - /v:$verbosity \ - /p:Configuration=$configuration \ - /p:Projects="$projects" \ - /p:RepoRoot="$repo_root" \ - /p:Restore=$restore \ - /p:Build=$build \ - /p:Rebuild=$rebuild \ - /p:Pack=$pack \ - /p:Publish=$publish \ - /p:UseRoslynAnalyzers=$enable_analyzers \ - /p:ContinuousIntegrationBuild=$ci \ - /p:QuietRestore=$quiet_restore \ - /p:QuietRestoreBinaryLog="$binary_log" \ - /p:DotNetBuildFromSource=$source_build \ - $properties + if [[ "$skip_build" != true ]]; then + # do real build + BuildMessage="Error building solution" + MSBuild $toolset_build_proj \ + $bl \ + /v:$verbosity \ + /p:Configuration=$configuration \ + /p:Projects="$projects" \ + /p:RepoRoot="$repo_root" \ + /p:Restore=$restore \ + /p:Build=$build \ + /p:Rebuild=$rebuild \ + /p:Pack=$pack \ + /p:Publish=$publish \ + /p:UseRoslynAnalyzers=$enable_analyzers \ + /p:ContinuousIntegrationBuild=$ci \ + /p:QuietRestore=$quiet_restore \ + /p:QuietRestoreBinaryLog="$binary_log" \ + /p:ArcadeBuildFromSource=$source_build \ + $properties + fi } function TrapAndReportError { diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml index 8e336b7d16b..bb8202b2ccc 100644 --- a/eng/common/templates/steps/source-build.yml +++ b/eng/common/templates/steps/source-build.yml @@ -36,7 +36,7 @@ steps: ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ - --restore --build --pack --publish \ + --restore --build --pack --publish -bl\ $officialBuildArgs \ $targetRidArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ diff --git a/eng/source-build-patches/0005-Fix-package-downgrade-warning.patch b/eng/source-build-patches/0005-Fix-package-downgrade-warning.patch new file mode 100644 index 00000000000..e13b98068f9 --- /dev/null +++ b/eng/source-build-patches/0005-Fix-package-downgrade-warning.patch @@ -0,0 +1,56 @@ +From 7f0d25bfaa9a38da2097c9420461232a08951165 Mon Sep 17 00:00:00 2001 +From: Chris Rummel +Date: Thu, 3 Sep 2020 19:02:07 -0500 +Subject: [PATCH 5/5] Fix package downgrade warning + +--- + .../FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj | 4 ++-- + .../Microsoft.FSharp.Compiler.nuspec | 4 ++-- + src/fsharp/fsc/fsc.fsproj | 1 + + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +index aced6e1b4..fcdacc30b 100644 +--- a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj ++++ b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +@@ -770,8 +770,8 @@ + + + +- +- ++ ++ + + + +diff --git a/src/fsharp/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec +index b96f90d2a..366488b47 100644 +--- a/src/fsharp/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec ++++ b/src/fsharp/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec +@@ -22,8 +22,8 @@ + + + +- +- ++ ++ + + + +diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj +index 776cddc78..df16c1554 100644 +--- a/src/fsharp/fsc/fsc.fsproj ++++ b/src/fsharp/fsc/fsc.fsproj +@@ -45,6 +45,7 @@ + + + ++ + + + +-- +2.18.0 + From 74f71386fc39cd0695a2d31e39859e7be9ee6b8a Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Mon, 15 Mar 2021 19:57:13 +0000 Subject: [PATCH 2/3] Add clarification comments --- eng/SourceBuild.props | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index f7791b47ee4..1856021f8ac 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -20,12 +20,20 @@ Condition="'@(SourceBuildPatchFile)' != ''" /> + $(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\FSharp.sln" + From fb133e7547aeccc191ca298e27e4a64f95247738 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Mon, 29 Mar 2021 15:31:57 +0000 Subject: [PATCH 3/3] Rename build target per code review feedback --- eng/SourceBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 1856021f8ac..22c929f286c 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -34,7 +34,7 @@ The build script bootstraps some tooling for the build. Since the inner build is triggerred via msbuild, trigger the bootstrapping for the inner build. --> -