From 7ea6f9cb04b3b56bf6a0a6e487c84fa3fb609bb5 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 15:44:32 -0700 Subject: [PATCH 1/4] Fail OptProf pipeline when profilingInputs can't be published --- azure-pipelines/microbuild.after.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines/microbuild.after.yml b/azure-pipelines/microbuild.after.yml index 34bdb45..6ec0838 100644 --- a/azure-pipelines/microbuild.after.yml +++ b/azure-pipelines/microbuild.after.yml @@ -24,7 +24,6 @@ steps: usePat: true displayName: 📢 Publish to Artifact Services - ProfilingInputs condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - continueOnError: true - task: PublishBuildArtifacts@1 inputs: From 48d18208f3d24fd090680f7ed4e2e4abc3da1aaa Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 16:08:44 -0700 Subject: [PATCH 2/4] Add missing OptProf.targets file --- azure-pipelines/build.yml | 6 ++++++ src/OptProf.targets | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/OptProf.targets diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 26b731c..237dd54 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -4,6 +4,12 @@ parameters: ##### Feel free to adjust their default value as needed. # Whether this repo uses OptProf to optimize the built binaries. +# When enabling this, be sure to update these files: +# - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo. +# - The project file(s) for the libraries to optimize must import OptProf.targets. +# - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. +# - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. +# and create pipelines for OptProf.yml, OptProf_part2.yml - name: EnableOptProf type: boolean default: false diff --git a/src/OptProf.targets b/src/OptProf.targets new file mode 100644 index 0000000..d0167d7 --- /dev/null +++ b/src/OptProf.targets @@ -0,0 +1,17 @@ + + + + IBC + Common7\IDE\PrivateAssemblies\$(TargetFileName) + /ExeConfig:"%VisualStudio.InstallationUnderTest.Path%\Common7\IDE\vsn.exe" + + + + + + + + + + + From 9dce0e27cd6a1014f350d22892c8a997bb1e8458 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 16:18:51 -0700 Subject: [PATCH 3/4] Filter VSInsertionMetadata from default.config world --- azure-pipelines/variables/InsertConfigValues.ps1 | 3 ++- azure-pipelines/variables/InsertPropsValues.ps1 | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/variables/InsertConfigValues.ps1 b/azure-pipelines/variables/InsertConfigValues.ps1 index 3ae11de..ae84969 100644 --- a/azure-pipelines/variables/InsertConfigValues.ps1 +++ b/azure-pipelines/variables/InsertConfigValues.ps1 @@ -3,7 +3,8 @@ $InsertedPkgs = (& "$PSScriptRoot\..\artifacts\VSInsertion.ps1") $icv=@() foreach ($kvp in $InsertedPkgs.GetEnumerator()) { $kvp.Value |% { - if ($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") { + # Skip VSInsertionMetadata packages for default.config world, which doesn't use it any more. + if (($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") -and $_.Name -notmatch 'VSInsertionMetadata') { $id = $Matches[1] $version = $Matches[2] $icv += "$id=$version" diff --git a/azure-pipelines/variables/InsertPropsValues.ps1 b/azure-pipelines/variables/InsertPropsValues.ps1 index 8d1e70a..3ae11de 100644 --- a/azure-pipelines/variables/InsertPropsValues.ps1 +++ b/azure-pipelines/variables/InsertPropsValues.ps1 @@ -1,2 +1,14 @@ -# These values are commonly the same. -& "$PSScriptRoot/InsertConfigValues.ps1" +$InsertedPkgs = (& "$PSScriptRoot\..\artifacts\VSInsertion.ps1") + +$icv=@() +foreach ($kvp in $InsertedPkgs.GetEnumerator()) { + $kvp.Value |% { + if ($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") { + $id = $Matches[1] + $version = $Matches[2] + $icv += "$id=$version" + } + } +} + +Write-Output ([string]::join(',',$icv)) From 990c095107389e5cc9f88defec36b3c1cc67bea0 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 29 Feb 2024 12:37:10 -0700 Subject: [PATCH 4/4] Add comment about multi-targeting projects --- azure-pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 237dd54..27a4aed 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -6,7 +6,7 @@ parameters: # Whether this repo uses OptProf to optimize the built binaries. # When enabling this, be sure to update these files: # - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo. -# - The project file(s) for the libraries to optimize must import OptProf.targets. +# - The project file(s) for the libraries to optimize must import OptProf.targets (for multi-targeted projects, only import it for ONE target). # - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. # - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. # and create pipelines for OptProf.yml, OptProf_part2.yml