From ff34b4ae8670a158134176070e2c487ff2e72b56 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 1 Feb 2023 23:30:19 +0000 Subject: [PATCH 1/5] Update azure-sdk-build-tools Repository Resource Refs in Yaml files --- .../templates/jobs/azuresdkpartnerdrops-to-nugetfeed.yml | 2 +- eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml | 2 +- src/dotnet/Mgmt.CI.BuildTools/ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/jobs/azuresdkpartnerdrops-to-nugetfeed.yml b/eng/pipelines/templates/jobs/azuresdkpartnerdrops-to-nugetfeed.yml index c5c9a77c6fb..423bdec44ea 100644 --- a/eng/pipelines/templates/jobs/azuresdkpartnerdrops-to-nugetfeed.yml +++ b/eng/pipelines/templates/jobs/azuresdkpartnerdrops-to-nugetfeed.yml @@ -4,7 +4,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230126.1 + ref: refs/tags/azure-sdk-build-tools_20230201.1 parameters: - name: BuildToolsRepoPath diff --git a/eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml b/eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml index 9ed79b98c2b..c2082a4aefe 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml @@ -3,7 +3,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230126.1 + ref: refs/tags/azure-sdk-build-tools_20230201.1 parameters: - name: ToolDirectory diff --git a/src/dotnet/Mgmt.CI.BuildTools/ci.yml b/src/dotnet/Mgmt.CI.BuildTools/ci.yml index 29135e1f148..49863c18975 100644 --- a/src/dotnet/Mgmt.CI.BuildTools/ci.yml +++ b/src/dotnet/Mgmt.CI.BuildTools/ci.yml @@ -8,7 +8,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230126.1 + ref: refs/tags/azure-sdk-build-tools_20230201.1 variables: - template: /eng/pipelines/templates/variables/globals.yml From 77de681a3b22b0c3aba63c4516c378274d5c310d Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 1 Feb 2023 12:49:51 -0800 Subject: [PATCH 2/5] necessary tooling updates to enable a clean assembly of the test-proxy --- .../templates/scripts/assemble-dotnet-standalone-exe.ps1 | 9 ++++++--- .../templates/steps/produce-net-standalone-packs.yml | 4 ++++ tools/test-proxy/ci.yml | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 index 0fbc91d9b15..dc9623eb9e0 100644 --- a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 +++ b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 @@ -26,6 +26,8 @@ param( [string] $Target, [Parameter(mandatory=$true)] [string] $ArtifactStagingDirectory, + [Parameter(mandatory=$true)] + [string] $AssemblyName, [Parameter(mandatory=$false)] [string] $Framework = "net6.0" ) @@ -60,7 +62,8 @@ if ("$($Rid)".Contains("linux")){ Push-Location "$outputPath" # The sum contents within this folder will be: `appSettings.json`, `test-proxy.pdb`, `test-proxy` (the binary), and a certificate. # This statement grabs the first extensionless file within the produced binary folder, which will always be the binary we need to set the executable bit on. - $binaryFile = (Get-ChildItem -Path . | Where-Object { !([System.IO.Path]::HasExtension($_)) } | Select-Object -First 1).ToString().Replace("`\","/") + $binaryFile = (Get-ChildItem -Path . | Where-Object { $_.Name -eq $AssemblyName } | Select-Object -First 1).ToString().Replace("`\","/") + bash -c "chmod +x $binaryFile" tar -cvzf "$($destinationPathSegment).tar.gz" . Pop-Location @@ -70,7 +73,7 @@ elseif("$($Rid)".Contains("osx")){ # a mac system. However, the `codesign` command is only available on a MacOS agent. With that being the case, we simply special case # this function here to ensure that the script does not fail outside of a MacOS agent. if ($IsMacOS) { - $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { !([System.IO.Path]::hasExtension($_)) } | Select-Object -First 1 + $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { _.Name -eq $AssemblyName } | Select-Object -First 1 $binaryFileBash = $binaryFile.ToString().Replace("`\","/") $entitlements = (Resolve-Path -Path (Join-Path $PSScriptRoot ".." ".." ".." "dotnet-executable-entitlements.plist")).ToString().Replace("`\", "/") @@ -86,7 +89,7 @@ else { } # clean up the uncompressed artifact directory -Remove-Item -Recurse -Force -Path $outputPath +# Remove-Item -Recurse -Force -Path $outputPath diff --git a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml index 82704b05a99..7665c15acb2 100644 --- a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml +++ b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml @@ -11,10 +11,13 @@ parameters: # A `BuildMatrix` is merely a list of possible targeted platforms. .NET 6+ can build for any target from any other target. # - rid: win-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy # - rid: linux-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy # - rid: osx-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy steps: - ${{ each target in parameters.BuildMatrix }}: @@ -29,6 +32,7 @@ steps: -Target "${{ parameters.TargetDirectory }}" -ArtifactStagingDirectory "$(Build.ArtifactStagingDirectory)" -Framework "${{ target.framework }}" + -AssemblyName "${{ target.assembly }}" pwsh: true displayName: 'Produce Executable for ${{ target.rid }}' condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) diff --git a/tools/test-proxy/ci.yml b/tools/test-proxy/ci.yml index dd45c7298bd..199f7130872 100644 --- a/tools/test-proxy/ci.yml +++ b/tools/test-proxy/ci.yml @@ -53,11 +53,16 @@ extends: StandaloneExeMatrix: - rid: osx-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: osx-arm64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: win-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: linux-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: linux-arm64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy From f47284160be728320ea6e16a8b9a0cd68e3336d3 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:43:19 -0800 Subject: [PATCH 3/5] remove assembly name change of azure.sdk.tools.testproxy -> testproxy. uncomment cleanup in assemble-dotnet-standalone-exe --- .../templates/scripts/assemble-dotnet-standalone-exe.ps1 | 2 +- .../Azure.Sdk.Tools.TestProxy/Azure.Sdk.Tools.TestProxy.csproj | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 index dc9623eb9e0..199e387c6c4 100644 --- a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 +++ b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 @@ -89,7 +89,7 @@ else { } # clean up the uncompressed artifact directory -# Remove-Item -Recurse -Force -Path $outputPath +Remove-Item -Recurse -Force -Path $outputPath diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Azure.Sdk.Tools.TestProxy.csproj b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Azure.Sdk.Tools.TestProxy.csproj index 1fa934582d3..274d5a4c52e 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Azure.Sdk.Tools.TestProxy.csproj +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Azure.Sdk.Tools.TestProxy.csproj @@ -9,7 +9,6 @@ preview $(OfficialBuildId) false - test-proxy From 30750ff991d51bcc6c8f82c9abd7990e798cf22e Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:47:21 -0800 Subject: [PATCH 4/5] missed passing the new parameter appropriately --- eng/pipelines/templates/steps/produce-net-standalone-packs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml index 7665c15acb2..ef13615a1cc 100644 --- a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml +++ b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml @@ -57,6 +57,7 @@ steps: -Target "${{ parameters.TargetDirectory }}" -ArtifactStagingDirectory "$(Build.ArtifactStagingDirectory)" -Framework "${{ target.framework }}" + -AssemblyName "${{ target.assembly }}" pwsh: true displayName: 'Produce Executable for ${{ target.rid }}' condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Darwin'))) From 8e21cb858388273258b7ecbfc6c1579b9c2c217e Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:56:20 -0800 Subject: [PATCH 5/5] last missing patch hopefully --- .../templates/scripts/assemble-dotnet-standalone-exe.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 index 199e387c6c4..6de6cb648a1 100644 --- a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 +++ b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 @@ -73,7 +73,7 @@ elseif("$($Rid)".Contains("osx")){ # a mac system. However, the `codesign` command is only available on a MacOS agent. With that being the case, we simply special case # this function here to ensure that the script does not fail outside of a MacOS agent. if ($IsMacOS) { - $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { _.Name -eq $AssemblyName } | Select-Object -First 1 + $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { $_.Name -eq $AssemblyName } | Select-Object -First 1 $binaryFileBash = $binaryFile.ToString().Replace("`\","/") $entitlements = (Resolve-Path -Path (Join-Path $PSScriptRoot ".." ".." ".." "dotnet-executable-entitlements.plist")).ToString().Replace("`\", "/")