From 35d35efa4dc921eb19a6d4026242a534da4c9781 Mon Sep 17 00:00:00 2001 From: Epsitha Ananth Date: Wed, 5 Oct 2022 14:26:18 -0700 Subject: [PATCH 1/6] Generate Sbom --- Build.cmd | 8 +++++++- azure-pipelines.yml | 2 ++ eng/Build.ps1 | 2 +- eng/restore-internal-tools.yml | 13 +++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 eng/restore-internal-tools.yml diff --git a/Build.cmd b/Build.cmd index ad55484933d..f5faf997ba0 100644 --- a/Build.cmd +++ b/Build.cmd @@ -1,2 +1,8 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*" +setlocal + +set _args=%* +if "%~1"=="-?" set _args=-help + +powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\common\build.ps1'" %_args% +exit /b %ERRORLEVEL% \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d739dc40ac2..df849372dd0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -118,6 +118,7 @@ stages: steps: - checkout: self clean: true + - template: /eng/restore-internal-tools.yml - script: eng\CIBuild.cmd -configuration $(_BuildConfig) -prepareMachine @@ -138,6 +139,7 @@ stages: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:PublishToSymbolServer=true /p:VisualStudioDropName=$(VisualStudioDropName) + /p:GenerateSbom=true - script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c $(_BuildConfig) displayName: End to end build tests - task: PublishTestResults@2 diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 347dce1afe8..7de78ba4789 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -44,7 +44,7 @@ param ( [switch]$procdump, [switch]$deployExtensions, [switch]$prepareMachine, - [switch]$useGlobalNuGetCache = $true, + [switch]$useGlobalNuGetCache = $false, [switch]$warnAsError = $true, [switch][Alias('test')]$testDesktop, [switch]$testCoreClr, diff --git a/eng/restore-internal-tools.yml b/eng/restore-internal-tools.yml new file mode 100644 index 00000000000..abf9d4fddd8 --- /dev/null +++ b/eng/restore-internal-tools.yml @@ -0,0 +1,13 @@ +steps: + - task: NuGetAuthenticate@0 + inputs: + nuGetServiceConnections: 'devdiv/dotnet-core-internal-tooling' + forceReinstallCredentialProvider: true + + - script: $(Build.SourcesDirectory)/eng/Build.cmd + -restore + -projects $(Build.SourcesDirectory)/eng/common/internal/Tools.csproj + /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/RestoreInternal.binlog + /v:normal + displayName: Restore internal tools + condition: and(succeeded(), ne(variables['_skipRestoreInternalTools'], 'true')) \ No newline at end of file From 333c30e9d5ef96dc665ee3541579e47b892c00bc Mon Sep 17 00:00:00 2001 From: Epsitha Ananth Date: Mon, 10 Oct 2022 16:56:50 -0700 Subject: [PATCH 2/6] pass ci flag --- eng/restore-internal-tools.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/restore-internal-tools.yml b/eng/restore-internal-tools.yml index abf9d4fddd8..66c0b0d89dc 100644 --- a/eng/restore-internal-tools.yml +++ b/eng/restore-internal-tools.yml @@ -6,6 +6,7 @@ steps: - script: $(Build.SourcesDirectory)/eng/Build.cmd -restore + -ci -projects $(Build.SourcesDirectory)/eng/common/internal/Tools.csproj /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/RestoreInternal.binlog /v:normal From 828b10ebe54fc5c41e811cb637e0bee79189ee11 Mon Sep 17 00:00:00 2001 From: Epsitha Ananth Date: Mon, 10 Oct 2022 17:29:23 -0700 Subject: [PATCH 3/6] update --- Build.cmd | 8 +------- eng/restore-internal-tools.yml | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Build.cmd b/Build.cmd index f5faf997ba0..e8af08f3935 100644 --- a/Build.cmd +++ b/Build.cmd @@ -1,8 +1,2 @@ @echo off -setlocal - -set _args=%* -if "%~1"=="-?" set _args=-help - -powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\common\build.ps1'" %_args% -exit /b %ERRORLEVEL% \ No newline at end of file +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*" \ No newline at end of file diff --git a/eng/restore-internal-tools.yml b/eng/restore-internal-tools.yml index 66c0b0d89dc..0d9938ebc67 100644 --- a/eng/restore-internal-tools.yml +++ b/eng/restore-internal-tools.yml @@ -5,7 +5,6 @@ steps: forceReinstallCredentialProvider: true - script: $(Build.SourcesDirectory)/eng/Build.cmd - -restore -ci -projects $(Build.SourcesDirectory)/eng/common/internal/Tools.csproj /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/RestoreInternal.binlog From 7cd078c0ffb2d444740c9e0e33b730e7c6f3f550 Mon Sep 17 00:00:00 2001 From: Epsitha Ananth Date: Mon, 17 Oct 2022 16:46:13 -0700 Subject: [PATCH 4/6] Sbom generation --- eng/RestoreInternal.cmd | 2 ++ eng/restore-internal-tools.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 eng/RestoreInternal.cmd diff --git a/eng/RestoreInternal.cmd b/eng/RestoreInternal.cmd new file mode 100644 index 00000000000..cdd42f2c499 --- /dev/null +++ b/eng/RestoreInternal.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0\common\build.ps1""" -build -restore %*" \ No newline at end of file diff --git a/eng/restore-internal-tools.yml b/eng/restore-internal-tools.yml index 0d9938ebc67..f71d0710e44 100644 --- a/eng/restore-internal-tools.yml +++ b/eng/restore-internal-tools.yml @@ -4,7 +4,7 @@ steps: nuGetServiceConnections: 'devdiv/dotnet-core-internal-tooling' forceReinstallCredentialProvider: true - - script: $(Build.SourcesDirectory)/eng/Build.cmd + - script: $(Build.SourcesDirectory)\eng\RestoreInternal.cmd -ci -projects $(Build.SourcesDirectory)/eng/common/internal/Tools.csproj /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/RestoreInternal.binlog From 83e584ef94d57e21fd8c61b5dc3a06a626115ce1 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 19 Oct 2022 16:27:54 +0200 Subject: [PATCH 5/6] Fix for trimming tests: Added nuget.org source + explicit source mapping for FSharp.Core --- .../projects/SelfContained_Trimming_Test/NuGet.Config | 11 ++++++++++- .../SelfContained_Trimming_Test.fsproj | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/projects/SelfContained_Trimming_Test/NuGet.Config b/tests/projects/SelfContained_Trimming_Test/NuGet.Config index 277ccdc4067..e8af19a856b 100644 --- a/tests/projects/SelfContained_Trimming_Test/NuGet.Config +++ b/tests/projects/SelfContained_Trimming_Test/NuGet.Config @@ -1,11 +1,12 @@ - + + @@ -13,4 +14,12 @@ + + + + + + + + diff --git a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index b60d71ac565..6654cf18e18 100644 --- a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -10,6 +10,8 @@ true + true + true true win-x64 @@ -29,7 +31,8 @@ - $(MSBuildThisFileDirectory)/../../../artifacts/packages/Release/Release + $(MSBuildThisFileDirectory)/../../../artifacts/packages/Release/Release; + https://api.nuget.org/v3/index.json; From 037310c64e67cfc66cad4e45dc31cc908babd98b Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 24 Oct 2022 15:57:51 -0700 Subject: [PATCH 6/6] Update Build.ps1 Tweaks to handle useGlobalNugetCache --- eng/Build.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 1115b5d9dc7..c2d58455868 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -44,7 +44,8 @@ param ( [switch]$procdump, [switch]$deployExtensions, [switch]$prepareMachine, - [switch]$useGlobalNuGetCache = $false, + [switch]$useGlobalNuGetCache = $true, + [switch]$dontUseGlobalNuGetCache = $false, [switch]$warnAsError = $true, [switch][Alias('test')]$testDesktop, [switch]$testCoreClr, @@ -113,7 +114,7 @@ function Print-Usage() { Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -procdump Monitor test runs with procdump" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" - Write-Host " -useGlobalNuGetCache Use global NuGet cache." + Write-Host " -dontUseGlobalNuGetCache Do not use the global NuGet cache" Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." Write-Host " -sourceBuild Simulate building for source-build." Write-Host " -skipbuild Skip building product" @@ -131,6 +132,10 @@ function Process-Arguments() { exit 0 } + if ($dontUseGlobalNugetCache -or $ci) { + $script:useGlobalNugetCache = $False + } + $script:nodeReuse = $False; if ($testAll) {