From 588c384dbd38f359f621594a587d7370e5e01fbf Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Fri, 26 Jan 2024 18:00:40 -0800 Subject: [PATCH 1/6] Migrate Release Pipelines to 1ES (#1438) * Migrate Release Pipelines to 1ES This PR migrates the VS and VS Code Release Pipelines to use the 1ES template. This extends the existing Microbuild Template and converts the PublishArtifact and NugetPush to the 1ES tasks. * Address PR comments --- eng/pipelines/VS-release.yml | 41 ++++++++-- eng/pipelines/VSCode-release.yml | 76 +++++++++++++------ eng/pipelines/jobs/MSHosted-OSX.job.yml | 2 + eng/pipelines/steps/BuildSolution.yml | 10 ++- .../steps/CollectAndPublishBinaries.yml | 4 +- eng/pipelines/steps/CopyAndPublishSymbols.yml | 4 +- .../steps/PackAndPublishVSPackages.yml | 19 ++--- eng/pipelines/steps/PublishOpenDebugAD7.yml | 10 +-- .../tasks/1ES/PublishPipelineArtifact.yml | 15 ++++ .../tasks/MicroBuildLocalizationPlugin.yml | 2 +- .../templates/VS-release.template.yml | 4 - .../VSCode-codesign-osx.template.yml | 4 +- .../VSCode-esrp-sign-osx.template.yml | 4 +- .../templates/VSCode-release.template.yml | 2 - 14 files changed, 133 insertions(+), 64 deletions(-) create mode 100644 eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml diff --git a/eng/pipelines/VS-release.yml b/eng/pipelines/VS-release.yml index 53e45bcee..6cf29c9fc 100644 --- a/eng/pipelines/VS-release.yml +++ b/eng/pipelines/VS-release.yml @@ -2,11 +2,40 @@ name: $(Date:yyyMMdd).$(Rev:r) variables: - group: TSDTUSR -jobs: -- template: ./jobs/VSEngSS-MicroBuild2022-1ES.job.yml - parameters: - DisplayName: 'VS_Release' - JobTemplate: - - template: ../templates/VS-release.template.yml +resources: + repositories: + - repository: MicroBuildTemplate + type: git + name: 1ESPipelineTemplates/MicroBuildTemplate + ref: refs/tags/release + +extends: + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + parameters: + pool: + name: VSEngSS-MicroBuild2022-1ES + os: windows + sdl: + sourceAnalysisPool: + name: VSEngSS-MicroBuild2022-1ES + os: windows + stages: + - stage: stage + displayName: VS_Release + jobs: + - job: Phase_1 + displayName: VS_Release + timeoutInMinutes: 180 + cancelTimeoutInMinutes: 1 + templateContext: + mb: + signing: + enabled: true + signType: real + zipSources: false + localization: + enabled: true + steps: + - template: /eng/pipelines/templates/VS-release.template.yml@self ... \ No newline at end of file diff --git a/eng/pipelines/VSCode-release.yml b/eng/pipelines/VSCode-release.yml index 5cc6cfa31..0ba0e6711 100644 --- a/eng/pipelines/VSCode-release.yml +++ b/eng/pipelines/VSCode-release.yml @@ -2,31 +2,57 @@ name: $(Date:yyyMMdd).$(Rev:r) variables: - group: TSDTUSR -stages: -- stage: Windows - dependsOn: [] - jobs: - - template: ./jobs/VSEngSS-MicroBuild2022-1ES.job.yml - parameters: - DisplayName: 'VSCode_Release' - JobTemplate: - - template: ../templates/VSCode-release.template.yml -- stage: OSX_CodeSign - dependsOn: [Windows] - jobs: - - template: ./jobs/MSHosted-OSX.job.yml - parameters: - DisplayName: 'OSX Sign/Harden' - JobTemplate: - - template: ../templates/VSCode-codesign-osx.template.yml +resources: + repositories: + - repository: MicroBuildTemplate + type: git + name: 1ESPipelineTemplates/MicroBuildTemplate + ref: refs/tags/release -- stage: OSX_ESRPSign - dependsOn: [OSX_CodeSign] - jobs: - - template: ./jobs/VSEngSS-MicroBuild2022-1ES.job.yml - parameters: - DisplayName: 'OSX Sign/Harden' - JobTemplate: - - template: ../templates/VSCode-esrp-sign-osx.template.yml +extends: + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + parameters: + pool: + name: VSEngSS-MicroBuild2022-1ES + os: windows + sdl: + sourceAnalysisPool: + name: VSEngSS-MicroBuild2022-1ES + os: windows + stages: + - stage: Windows + jobs: + - job: + displayName: Windows + timeoutInMinutes: 180 + cancelTimeoutInMinutes: 1 + templateContext: + mb: + signing: + enabled: true + signType: real + zipSources: false + localization: + enabled: true + steps: + - template: /eng/pipelines/templates/VSCode-release.template.yml@self + + - stage: OSX_CodeSign + dependsOn: [Windows] + jobs: + - template: /eng/pipelines/jobs/MSHosted-OSX.job.yml@self + parameters: + DisplayName: 'OSX Sign/Harden' + JobTemplate: + - template: ../templates/VSCode-codesign-osx.template.yml + + - stage: OSX_ESRPSign + dependsOn: [OSX_CodeSign] + jobs: + - template: /eng/pipelines/jobs/VSEngSS-MicroBuild2022-1ES.job.yml@self + parameters: + DisplayName: 'OSX Sign/Harden' + JobTemplate: + - template: ../templates/VSCode-esrp-sign-osx.template.yml ... \ No newline at end of file diff --git a/eng/pipelines/jobs/MSHosted-OSX.job.yml b/eng/pipelines/jobs/MSHosted-OSX.job.yml index 1f9f16d70..464d608a1 100644 --- a/eng/pipelines/jobs/MSHosted-OSX.job.yml +++ b/eng/pipelines/jobs/MSHosted-OSX.job.yml @@ -9,7 +9,9 @@ jobs: - job: displayName: ${{ parameters.DisplayName }} pool: + name: Azure Pipelines vmImage: 'macOS-latest' + os: macOS steps: - ${{ parameters.JobTemplate }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/BuildSolution.yml b/eng/pipelines/steps/BuildSolution.yml index d744aff2c..68758f48a 100644 --- a/eng/pipelines/steps/BuildSolution.yml +++ b/eng/pipelines/steps/BuildSolution.yml @@ -31,15 +31,17 @@ steps: "SIGN_TYPE": "$(SignType)" } -- template: ../tasks/PublishPipelineArtifact.yml +- template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: + displayName: 'Publish binlogs' + targetPath: '$(Build.BinariesDirectory)/build_logs/' artifactName: '${{ parameters.Configuration }}_binlog' - path: '$(Build.BinariesDirectory)/build_logs/' condition: ne(variables['System.Debug'], '') -- template: ../tasks/PublishPipelineArtifact.yml +- template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: + displayName: 'Publish debug binaries' + targetPath: '$(Build.SourcesDirectory)\bin\${{ parameters.Configuration }}' artifactName: '${{ parameters.Configuration }}_debug_bin' - path: '$(Build.SourcesDirectory)\bin\${{ parameters.Configuration }}' condition: ne(variables['System.Debug'], '') ... \ No newline at end of file diff --git a/eng/pipelines/steps/CollectAndPublishBinaries.yml b/eng/pipelines/steps/CollectAndPublishBinaries.yml index 30d66fbf7..092bb36c8 100644 --- a/eng/pipelines/steps/CollectAndPublishBinaries.yml +++ b/eng/pipelines/steps/CollectAndPublishBinaries.yml @@ -13,9 +13,9 @@ steps: CleanTargetFolder: true OverWrite: true -- template: ../tasks/PublishPipelineArtifact.yml +- template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish Binaries' - path: ${{ parameters.TargetFolder }} + targetPath: ${{ parameters.TargetFolder }} artifactName: '${{ parameters.ArtifactName }}' ... \ No newline at end of file diff --git a/eng/pipelines/steps/CopyAndPublishSymbols.yml b/eng/pipelines/steps/CopyAndPublishSymbols.yml index 65c5098ee..3d50fd18a 100644 --- a/eng/pipelines/steps/CopyAndPublishSymbols.yml +++ b/eng/pipelines/steps/CopyAndPublishSymbols.yml @@ -27,9 +27,9 @@ steps: SearchPattern: '**\*.pdb' SymbolServerType: TeamServices -- template: ../tasks/PublishPipelineArtifact.yml +- template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish Symbols' - path: '$(Build.ArtifactStagingDirectory)/symbols' + targetPath: '$(Build.ArtifactStagingDirectory)/symbols' artifactName: 'Symbols' ... \ No newline at end of file diff --git a/eng/pipelines/steps/PackAndPublishVSPackages.yml b/eng/pipelines/steps/PackAndPublishVSPackages.yml index 3fd56979c..365ce5529 100644 --- a/eng/pipelines/steps/PackAndPublishVSPackages.yml +++ b/eng/pipelines/steps/PackAndPublishVSPackages.yml @@ -12,10 +12,10 @@ steps: echo ##vso[task.setvariable variable=NugetPackageVersion;]%NugetPackageVersion% displayName: 'Get NuGet Version' -- template: ../tasks/PublishPipelineArtifact.yml +- template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish File Version' - path: '$(Build.SourcesDirectory)\obj\Lab.Release\NugetPackageVersion.txt' + targetPath: '$(Build.SourcesDirectory)\obj\Lab.Release\NugetPackageVersion.txt' artifactName: 'PackageVersion' - template: ../tasks/NuGetCommand.yml @@ -27,11 +27,12 @@ steps: buildProperties: 'version=$(NugetPackageVersion)' basePath: ${{ parameters.BasePath }} -- template: ../tasks/NuGetCommand.yml - parameters: - displayName: 'NuGet push' - command: push - searchPatternPush: '$(Build.SourcesDirectory)\VS.Redist.Debugger.MDD.MIEngine.*.nupkg;$(Build.SourcesDirectory)\VS.Redist.Debugger.MDD.UnixPortSupplier.*.nupkg' - feedPublish: '97a41293-2972-4f48-8c0e-05493ae82010' # VS - condition: and(succeeded(), eq(variables['SignType'], 'real')) +- task: 1ES.PublishNuget@1 + displayName: Publish Nuget package + condition: and(succeeded(), eq(variables['SignType'], 'real')) + inputs: + packagesToPush: '$(Build.SourcesDirectory)\VS.Redist.Debugger.MDD.MIEngine.*.nupkg;$(Build.SourcesDirectory)\VS.Redist.Debugger.MDD.UnixPortSupplier.*.nupkg' + packageParentPath: '$(Build.SourcesDirectory)' + publishVstsFeed: '97a41293-2972-4f48-8c0e-05493ae82010' # VS + nuGetFeedType: internal ... \ No newline at end of file diff --git a/eng/pipelines/steps/PublishOpenDebugAD7.yml b/eng/pipelines/steps/PublishOpenDebugAD7.yml index 28be90450..9fd5fde92 100644 --- a/eng/pipelines/steps/PublishOpenDebugAD7.yml +++ b/eng/pipelines/steps/PublishOpenDebugAD7.yml @@ -39,11 +39,11 @@ steps: copy ${{ parameters.SignedBinariesFolder }}\Release\osxlaunchhelper.scpt $(Build.StagingDirectory)\${{ parameters.RuntimeID }}\debugAdapters\bin\. displayName: "Copy osxlaunchhelper.scpt" - - template: ../tasks/PublishPipelineArtifact.yml + - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish Unsigned ${{ parameters.RuntimeID }}' - path: '$(Build.StagingDirectory)\${{ parameters.RuntimeID }}' - artifactName: 'unsigned_${{ parameters.RuntimeID }}_binaries' + targetPath: '$(Build.StagingDirectory)\${{ parameters.RuntimeID }}' + artifactName: 'unsigned_${{ parameters.RuntimeID }}_binaries' # Publishing for non-macOS - ${{ if not(startsWith(parameters.RuntimeID, 'osx-')) }}: @@ -51,8 +51,8 @@ steps: Compress-Archive -Path $(Build.StagingDirectory)\${{ parameters.RuntimeID }}\debugAdapters -DestinationPath $(Build.StagingDirectory)\zips\${{ parameters.RuntimeID }}.zip displayName: "Create ${{ parameters.RuntimeID}}.zip" - - template: ../tasks/PublishPipelineArtifact.yml + - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish ${{ parameters.RuntimeID }}' - path: '$(Build.StagingDirectory)\zips\${{ parameters.RuntimeID }}.zip' + targetPath: '$(Build.StagingDirectory)\zips\${{ parameters.RuntimeID }}.zip' artifactName: '${{ parameters.RuntimeID }}_zip' diff --git a/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml new file mode 100644 index 000000000..9feac58e4 --- /dev/null +++ b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml @@ -0,0 +1,15 @@ +--- +parameters: + displayName: 'Publish Pipeline Artifact' + targetPath: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop' + condition: 'succeeded()' + +steps: +- task: 1ES.PublishPipelineArtifact@1 + displayName: ${{ parameters.displayName }} + inputs: + targetPath: ${{ parameters.targetPath }} + artifactName: '${{ parameters.artifactName }}' + condition: ${{ parameters.condition }} +... \ No newline at end of file diff --git a/eng/pipelines/tasks/MicroBuildLocalizationPlugin.yml b/eng/pipelines/tasks/MicroBuildLocalizationPlugin.yml index f420771df..0d5024250 100644 --- a/eng/pipelines/tasks/MicroBuildLocalizationPlugin.yml +++ b/eng/pipelines/tasks/MicroBuildLocalizationPlugin.yml @@ -1,5 +1,5 @@ --- steps: -- task: ms-vseng.MicroBuildTasks.a0262b21-fb8f-46f8-bb9a-60ed560d4a87.MicroBuildLocalizationPlugin@3 +- task: ms-vseng.MicroBuildTasks.a0262b21-fb8f-46f8-bb9a-60ed560d4a87.MicroBuildLocalizationPlugin@4 displayName: 'Install Localization Plugin' ... \ No newline at end of file diff --git a/eng/pipelines/templates/VS-release.template.yml b/eng/pipelines/templates/VS-release.template.yml index 34613364a..e9408071e 100644 --- a/eng/pipelines/templates/VS-release.template.yml +++ b/eng/pipelines/templates/VS-release.template.yml @@ -6,10 +6,6 @@ steps: - template: ../tasks/NuGetToolInstaller.yml -- template: ../tasks/MicroBuildSigningPlugin.yml - -- template: ../tasks/MicroBuildLocalizationPlugin.yml - - template: ../steps/BuildSolution.yml parameters: Configuration: 'Lab.Release' diff --git a/eng/pipelines/templates/VSCode-codesign-osx.template.yml b/eng/pipelines/templates/VSCode-codesign-osx.template.yml index d3b9da477..42033534c 100644 --- a/eng/pipelines/templates/VSCode-codesign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-codesign-osx.template.yml @@ -22,9 +22,9 @@ steps: echo "#[command] zip -r $(Pipeline.Workspace)/${{ rid }}.zip ./debugAdapters" zip -r $(Pipeline.Workspace)/${{ rid }}.zip ./debugAdapters - - template: ../tasks/PublishPipelineArtifact.yml + - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish Binaries' - path: '$(Pipeline.Workspace)/${{ rid }}.zip' + targetPath: '$(Pipeline.Workspace)/${{ rid }}.zip' artifactName: 'unsigned_${{ rid }}_zip' ... diff --git a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml index 431a2f9b1..d1822636e 100644 --- a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml @@ -18,9 +18,9 @@ steps: SigningTarget: '$(Pipeline.Workspace)\Artifacts\${{ rid }}.zip' SigningCert: 8023 - - template: ../tasks/PublishPipelineArtifact.yml + - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: displayName: 'Publish Binaries' - path: '$(Pipeline.Workspace)\Artifacts\${{ rid }}.zip' + targetPath: '$(Pipeline.Workspace)\Artifacts\${{ rid }}.zip' artifactName: '${{ rid }}_zip' ... \ No newline at end of file diff --git a/eng/pipelines/templates/VSCode-release.template.yml b/eng/pipelines/templates/VSCode-release.template.yml index 1aefc7da6..af2638c3f 100644 --- a/eng/pipelines/templates/VSCode-release.template.yml +++ b/eng/pipelines/templates/VSCode-release.template.yml @@ -8,8 +8,6 @@ steps: - template: ../tasks/NuGetToolInstaller.yml -- template: ../tasks/MicroBuildSigningPlugin.yml - - template: ../tasks/UseDotNet.yml - template: ../steps/BuildSolution.yml From 8b7af0497b7b3d7681102912aae7fec4f22c2c2f Mon Sep 17 00:00:00 2001 From: Sergey Bobko Date: Thu, 15 Feb 2024 19:25:54 +0100 Subject: [PATCH 2/6] Add Intel GT register groups to MIEngine (#1439) - Incorporate Intel GT register categorization in MIEngine for enhanced debugging support. --- src/MIDebugEngine/Engine.Impl/EngineUtils.cs | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/MIDebugEngine/Engine.Impl/EngineUtils.cs b/src/MIDebugEngine/Engine.Impl/EngineUtils.cs index 2913cb81f..548a6f406 100644 --- a/src/MIDebugEngine/Engine.Impl/EngineUtils.cs +++ b/src/MIDebugEngine/Engine.Impl/EngineUtils.cs @@ -213,6 +213,28 @@ public Entry(string name, bool isRegex, string group) new Entry( "mm[0-7][0-7]", true, "AMD3DNow" ), new Entry( "mm[0-7]", true, "MMX" ), }; + private static readonly Entry[] s_IntelGTRegisters = new Entry[] + { + new Entry( "r[0-9]+$", true, "GRF"), + new Entry( "a[0-9]+", true, "ARF"), + new Entry( "f[0-9]+", true, "ARF"), + new Entry( "ce", false, "ARF"), + new Entry( "sr[0-9]+", true, "ARF"), + new Entry( "cr[0-9]+", true, "ARF"), + new Entry( "acc[0-9]+", true, "ARF"), + new Entry( "mme[0-9]+", true, "ARF"), + new Entry( "dbg[0-9]+", true, "ARF"), + new Entry( "genstbase", false, "Virtual"), + new Entry( "sustbase", false, "Virtual"), + new Entry( "dynbase", false, "Virtual"), + new Entry( "iobase", false, "Virtual"), + new Entry( "isabase", false, "Virtual"), + new Entry( "blsustbase", false, "Virtual"), + new Entry( "blsastbase", false, "Virtual"), + new Entry( "btbase", false, "Virtual"), + new Entry( "scrbase", false, "Virtual"), + + }; private static readonly Entry[] s_allRegisters = new Entry[] { @@ -231,6 +253,10 @@ public static RegisterNameMap Create(string[] registerNames) { map._map = s_X86Registers; } + else if (registerNames.Contains("isabase") && registerNames.Contains("ce")) // Intel GPU register set + { + map._map = s_IntelGTRegisters; + } else { // report one global register set From 0af7c1743a5013f94327e3cc49d8dd77adfbe3b9 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Tue, 27 Feb 2024 18:40:44 -0800 Subject: [PATCH 3/6] Fix CodeAnalysis Pipeline from 1ES Pipeline Upgrade (#1440) Add OneESPT flags to toggle between different publish --- eng/pipelines/steps/BuildSolution.yml | 3 +++ .../steps/CollectAndPublishBinaries.yml | 2 ++ eng/pipelines/steps/CopyAndPublishSymbols.yml | 4 ++++ .../steps/PackAndPublishVSPackages.yml | 1 + eng/pipelines/steps/PublishOpenDebugAD7.yml | 2 ++ .../tasks/1ES/PublishPipelineArtifact.yml | 21 +++++++++++++------ eng/pipelines/templates/Build.template.yml | 2 ++ .../templates/VS-release.template.yml | 4 ++++ .../VSCode-codesign-osx.template.yml | 1 + .../VSCode-esrp-sign-osx.template.yml | 1 + .../templates/VSCode-release.template.yml | 4 ++++ 11 files changed, 39 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/steps/BuildSolution.yml b/eng/pipelines/steps/BuildSolution.yml index 68758f48a..4e6c39263 100644 --- a/eng/pipelines/steps/BuildSolution.yml +++ b/eng/pipelines/steps/BuildSolution.yml @@ -4,6 +4,7 @@ parameters: Solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln' Configuration: 'Release' BuildArguments: '' + OneESPT: false steps: - template: ../tasks/NuGetCommand.yml @@ -37,6 +38,7 @@ steps: targetPath: '$(Build.BinariesDirectory)/build_logs/' artifactName: '${{ parameters.Configuration }}_binlog' condition: ne(variables['System.Debug'], '') + OneESPT: ${{ parameters.OneESPT }} - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: @@ -44,4 +46,5 @@ steps: targetPath: '$(Build.SourcesDirectory)\bin\${{ parameters.Configuration }}' artifactName: '${{ parameters.Configuration }}_debug_bin' condition: ne(variables['System.Debug'], '') + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/CollectAndPublishBinaries.yml b/eng/pipelines/steps/CollectAndPublishBinaries.yml index 092bb36c8..3cbb6ac78 100644 --- a/eng/pipelines/steps/CollectAndPublishBinaries.yml +++ b/eng/pipelines/steps/CollectAndPublishBinaries.yml @@ -3,6 +3,7 @@ parameters: TargetFolder: '$(Build.SourcesDirectory)\drop' ArtifactName: 'drop' + OneESPT: false steps: - template: ../tasks/CopyFiles.yml @@ -18,4 +19,5 @@ steps: displayName: 'Publish Binaries' targetPath: ${{ parameters.TargetFolder }} artifactName: '${{ parameters.ArtifactName }}' + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/CopyAndPublishSymbols.yml b/eng/pipelines/steps/CopyAndPublishSymbols.yml index 3d50fd18a..b61728414 100644 --- a/eng/pipelines/steps/CopyAndPublishSymbols.yml +++ b/eng/pipelines/steps/CopyAndPublishSymbols.yml @@ -1,5 +1,8 @@ # Collects build symbols and publishes them as 'Symbols' --- +parameters: + OneESPT: false + steps: - template: ../tasks/CopyFiles.yml parameters: @@ -32,4 +35,5 @@ steps: displayName: 'Publish Symbols' targetPath: '$(Build.ArtifactStagingDirectory)/symbols' artifactName: 'Symbols' + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/PackAndPublishVSPackages.yml b/eng/pipelines/steps/PackAndPublishVSPackages.yml index 365ce5529..fd95d189e 100644 --- a/eng/pipelines/steps/PackAndPublishVSPackages.yml +++ b/eng/pipelines/steps/PackAndPublishVSPackages.yml @@ -17,6 +17,7 @@ steps: displayName: 'Publish File Version' targetPath: '$(Build.SourcesDirectory)\obj\Lab.Release\NugetPackageVersion.txt' artifactName: 'PackageVersion' + OneESPT: true - template: ../tasks/NuGetCommand.yml parameters: diff --git a/eng/pipelines/steps/PublishOpenDebugAD7.yml b/eng/pipelines/steps/PublishOpenDebugAD7.yml index 9fd5fde92..094cbf4d5 100644 --- a/eng/pipelines/steps/PublishOpenDebugAD7.yml +++ b/eng/pipelines/steps/PublishOpenDebugAD7.yml @@ -44,6 +44,7 @@ steps: displayName: 'Publish Unsigned ${{ parameters.RuntimeID }}' targetPath: '$(Build.StagingDirectory)\${{ parameters.RuntimeID }}' artifactName: 'unsigned_${{ parameters.RuntimeID }}_binaries' + OneESPT: true # Publishing for non-macOS - ${{ if not(startsWith(parameters.RuntimeID, 'osx-')) }}: @@ -56,3 +57,4 @@ steps: displayName: 'Publish ${{ parameters.RuntimeID }}' targetPath: '$(Build.StagingDirectory)\zips\${{ parameters.RuntimeID }}.zip' artifactName: '${{ parameters.RuntimeID }}_zip' + OneESPT: true diff --git a/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml index 9feac58e4..065c933ea 100644 --- a/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml +++ b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml @@ -4,12 +4,21 @@ parameters: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: 'drop' condition: 'succeeded()' + OneESPT: false # Indicates that this is running under the 1ES Pipeline Template steps: -- task: 1ES.PublishPipelineArtifact@1 - displayName: ${{ parameters.displayName }} - inputs: - targetPath: ${{ parameters.targetPath }} - artifactName: '${{ parameters.artifactName }}' - condition: ${{ parameters.condition }} +- ${{ if eq(parameters['OneESPT'], true) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: ${{ parameters.displayName }} + inputs: + targetPath: ${{ parameters.targetPath }} + artifactName: '${{ parameters.artifactName }}' + condition: ${{ parameters.condition }} +- ${{ else }}: + - template: ../PublishPipelineArtifact.yml + parameters: + path: '${{ parameters.targetPath }}' + artifactName: '${{ parameters.artifactName }}' + displayName: ${{ parameters.displayName }} + condition: ${{ parameters.condition }} ... \ No newline at end of file diff --git a/eng/pipelines/templates/Build.template.yml b/eng/pipelines/templates/Build.template.yml index 502ddf823..f26c81aca 100644 --- a/eng/pipelines/templates/Build.template.yml +++ b/eng/pipelines/templates/Build.template.yml @@ -18,6 +18,7 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: ${{ parameters.Configuration }} + OneESPT: false - template: ../tasks/CSharp.yml @@ -26,6 +27,7 @@ steps: parameters: TargetFolder: '$(Build.StagingDirectory)\drop' ArtifactName: '${{ parameters.Configuration }}' + OneESPT: false - template: ../tasks/MicroBuildCleanup.yml ... \ No newline at end of file diff --git a/eng/pipelines/templates/VS-release.template.yml b/eng/pipelines/templates/VS-release.template.yml index e9408071e..352fa49ae 100644 --- a/eng/pipelines/templates/VS-release.template.yml +++ b/eng/pipelines/templates/VS-release.template.yml @@ -9,17 +9,21 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: 'Lab.Release' + OneESPT: true - template: ../steps/CollectAndPublishBinaries.yml parameters: TargetFolder: '$(Build.StagingDirectory)\drop' ArtifactName: 'drop' + OneESPT: true - template: ../tasks/SignVerify.yml parameters: TargetFolders: '$(Build.StagingDirectory)\drop' - template: ../steps/CopyAndPublishSymbols.yml + parameters: + OneESPT: true - template: ../steps/PackAndPublishVSPackages.yml parameters: diff --git a/eng/pipelines/templates/VSCode-codesign-osx.template.yml b/eng/pipelines/templates/VSCode-codesign-osx.template.yml index 42033534c..6ef2efc4d 100644 --- a/eng/pipelines/templates/VSCode-codesign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-codesign-osx.template.yml @@ -27,4 +27,5 @@ steps: displayName: 'Publish Binaries' targetPath: '$(Pipeline.Workspace)/${{ rid }}.zip' artifactName: 'unsigned_${{ rid }}_zip' + OneESPT: true ... diff --git a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml index d1822636e..f8efc334f 100644 --- a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml @@ -23,4 +23,5 @@ steps: displayName: 'Publish Binaries' targetPath: '$(Pipeline.Workspace)\Artifacts\${{ rid }}.zip' artifactName: '${{ rid }}_zip' + OneESPT: true ... \ No newline at end of file diff --git a/eng/pipelines/templates/VSCode-release.template.yml b/eng/pipelines/templates/VSCode-release.template.yml index af2638c3f..061e08130 100644 --- a/eng/pipelines/templates/VSCode-release.template.yml +++ b/eng/pipelines/templates/VSCode-release.template.yml @@ -13,11 +13,13 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: 'Lab.Release' + OneESPT: true - template: ../steps/CollectAndPublishBinaries.yml parameters: TargetFolder: '$(Build.StagingDirectory)\bin' ArtifactName: 'bin' + OneESPT: true - template: ../tasks/SignVerify.yml parameters: @@ -25,6 +27,8 @@ steps: ExcludeFolders: '.git MicroBuild' - template: ../steps/CopyAndPublishSymbols.yml + parameters: + OneESPT: true - script: | mkdir $(Build.StagingDirectory)\zips\ From 87fff3f9973eeea4c5f4f0484661df7e471f673d Mon Sep 17 00:00:00 2001 From: Andrew Crawley Date: Thu, 29 Feb 2024 18:12:17 -0800 Subject: [PATCH 4/6] Fix SSH attach on a clean machine (#1444) Attaching to a C# process running on a brand-new Linux VM was failing with an error about being unable to create or access the `.vs-debugger` folder on the remote host. After investigating, this is due to a behavior change in liblinux - previously, the call to `IRemoteFileSystem.Stat()` would fail if the file didn't exist, but it now returns a valid object that you can query to determine that the file doesn't exist. I updated the logic accordingly. Workaround: manually create the `.vs-debugger` folder on the remote host. Once it exists, the remote debugger will deploy successfully. --- src/SSHDebugPS/SSH/SSHConnection.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/SSHDebugPS/SSH/SSHConnection.cs b/src/SSHDebugPS/SSH/SSHConnection.cs index e084b510b..00d34b564 100644 --- a/src/SSHDebugPS/SSH/SSHConnection.cs +++ b/src/SSHDebugPS/SSH/SSHConnection.cs @@ -131,12 +131,15 @@ public override void CopyFile(string sourcePath, string destinationPath) /// Full path of the created directory. public override string MakeDirectory(string path) { - bool directoryExists = false; - liblinux.IO.IRemoteFileSystemInfo stat = null; + bool exists = false; + bool isDirectory = false; + try { - stat = _remoteSystem.FileSystem.Stat(path); - directoryExists = stat.IsDirectory(); + liblinux.IO.IRemoteFileSystemInfo stat = _remoteSystem.FileSystem.Stat(path); + + exists = stat.Exists(); + isDirectory = stat.IsDirectory(); } catch { @@ -144,11 +147,11 @@ public override string MakeDirectory(string path) // Unfortunately the exceptions that are thrown by liblinux are not public, so we can't specialize it. } - if (stat == null && !directoryExists) + if (!exists) { return _remoteSystem.FileSystem.CreateDirectory(path).FullPath; } - else if (stat != null && directoryExists) + else if (exists && isDirectory) { return _remoteSystem.FileSystem.GetDirectory(path).FullPath; } From 680f61374fbda6577733bb780770631dc1f227d4 Mon Sep 17 00:00:00 2001 From: swermin <160042555+swermin@users.noreply.github.com> Date: Fri, 1 Mar 2024 23:51:50 +0100 Subject: [PATCH 5/6] Add support for applying post remote connect commands on attach (#1443) add support for applying post remote connect commands on attach --- src/MICore/LaunchOptions.cs | 14 ++++++++++++-- src/MICore/LaunchOptions.xsd | 10 ++++++++++ src/MICore/LaunchOptions.xsd.types.designer.cs | 12 ++++++++++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/MICore/LaunchOptions.cs b/src/MICore/LaunchOptions.cs index 95f1ee049..711bdfecb 100644 --- a/src/MICore/LaunchOptions.cs +++ b/src/MICore/LaunchOptions.cs @@ -1490,8 +1490,12 @@ internal static SupplementalLaunchOptions GetOptionsFromFile(Logger logger) string optFile = Path.Combine(slnRoot, "Microsoft.MIEngine.Options.xml"); if (File.Exists(optFile)) { - var reader = File.OpenText(optFile); - string suppOptions = reader.ReadToEnd(); + string suppOptions = null; + using (var reader = File.OpenText(optFile)) + { + suppOptions = reader.ReadToEnd(); + } + if (!string.IsNullOrEmpty(suppOptions)) { try @@ -1555,6 +1559,11 @@ private void Merge(AttachOptionsForConnection suppOptions) setupCmds.AddRange(newSetupCmds); SetupCommands = new ReadOnlyCollection(setupCmds); + var postRemoteConnectCmds = this.PostRemoteConnectCommands.ToList(); + var newPostRemoteConnectCmds = LaunchCommand.CreateCollection(suppOptions.PostRemoteConnectCommands); + postRemoteConnectCmds.AddRange(newPostRemoteConnectCmds); + PostRemoteConnectCommands = new ReadOnlyCollection(postRemoteConnectCmds); + MergeMap(suppOptions.SourceMap); if (!string.IsNullOrWhiteSpace(suppOptions.AdditionalSOLibSearchPath)) { @@ -1847,6 +1856,7 @@ protected void InitializeCommonOptions(Xml.LaunchOptions.BaseLaunchOptions sourc this.WaitDynamicLibLoad = source.WaitDynamicLibLoad; this.SetupCommands = LaunchCommand.CreateCollection(source.SetupCommands); + this.PostRemoteConnectCommands = LaunchCommand.CreateCollection(source.PostRemoteConnectCommands); if (source.CustomLaunchSetupCommands != null) { diff --git a/src/MICore/LaunchOptions.xsd b/src/MICore/LaunchOptions.xsd index 2e3f63b9b..db1f833a9 100644 --- a/src/MICore/LaunchOptions.xsd +++ b/src/MICore/LaunchOptions.xsd @@ -413,6 +413,11 @@ One or more GDB/LLDB commands to execute in order to setup the underlying debugger. These are not required. + + + One or more commands to execute after the connection has been made, in order to set up the remote connection. These are not required. + + @@ -482,6 +487,11 @@ One or more GDB/LLDB commands to execute in order to setup the underlying debugger. These are not required. + + + One or more commands to execute after the connection has been made, in order to set up the remote connection. These are not required. + + diff --git a/src/MICore/LaunchOptions.xsd.types.designer.cs b/src/MICore/LaunchOptions.xsd.types.designer.cs index f8b2766a2..0c0c83941 100644 --- a/src/MICore/LaunchOptions.xsd.types.designer.cs +++ b/src/MICore/LaunchOptions.xsd.types.designer.cs @@ -200,7 +200,11 @@ public partial class AttachOptionsForConnection { /// [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public Command[] SetupCommands; - + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public Command[] PostRemoteConnectCommands; + /// [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public SourceMapEntry[] SourceMap; @@ -354,7 +358,11 @@ public partial class BaseLaunchOptions { /// [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public Command[] SetupCommands; - + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public Command[] PostRemoteConnectCommands; + /// [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public Command[] CustomLaunchSetupCommands; From f6d7aae8f20bdcb5e026def2a887bc6036e1ef32 Mon Sep 17 00:00:00 2001 From: Sergey Bobko Date: Sat, 2 Mar 2024 00:10:33 +0100 Subject: [PATCH 6/6] Remove `isabase` from IntelGTRegisters check (#1442) Co-authored-by: Andrew Wang --- src/MIDebugEngine/Engine.Impl/EngineUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MIDebugEngine/Engine.Impl/EngineUtils.cs b/src/MIDebugEngine/Engine.Impl/EngineUtils.cs index 548a6f406..eff2f1af7 100644 --- a/src/MIDebugEngine/Engine.Impl/EngineUtils.cs +++ b/src/MIDebugEngine/Engine.Impl/EngineUtils.cs @@ -253,7 +253,7 @@ public static RegisterNameMap Create(string[] registerNames) { map._map = s_X86Registers; } - else if (registerNames.Contains("isabase") && registerNames.Contains("ce")) // Intel GPU register set + else if (registerNames.Contains("ce")) // Intel GPU register set { map._map = s_IntelGTRegisters; }