From 8b661f715756ec794af24bcf9d069d3656073555 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Fri, 6 Sep 2024 00:30:40 +1000 Subject: [PATCH] Fix DML packaging CIs (#21997) ### Description The DML CIs build native and C# as well as sign DLLs in the same CI. Some parts of that require .net 8 and some .net 6. Update to use .net 8 in general, and revert to .net 6 for the signing. ### Motivation and Context Fix packaging pipeline. --- .../nuget/templates/dml-vs-2022.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml index f20a1ae3e1cd9..c73cbb102a640 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml @@ -43,7 +43,6 @@ stages: buildDirectory: '$(Build.BinariesDirectory)' BuildCommand: ${{ parameters.BuildCommand }} OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)' - DotNetExe: 'dotnet.exe' runCodesignValidationInjection: and(${{ parameters.DoNodejsPack }},${{ parameters. DoEsrp}}) #For the others, code sign is in a separated job DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true ALLOW_RELEASED_ONNX_OPSET_ONLY: ${{ parameters.AllowReleasedOpsetOnly }} @@ -97,6 +96,13 @@ stages: modifyEnvironment: true workingFolder: '$(Build.BinariesDirectory)' + # need to set PROCESSOR_ARCHITECTURE so the x86 SDK is installed correctly + - task: UseDotNet@2 + inputs: + version: 8.x + env: + PROCESSOR_ARCHITECTURE: ${{ parameters.BuildArch }} + - task: PowerShell@2 displayName: 'Install ONNX' inputs: @@ -202,7 +208,14 @@ stages: filename: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' arguments: ${{ parameters.BuildArch }} modifyEnvironment: true - # Esrp signing + + # Esrp signing. Requires older .net SDK currently (ESRP v5.1.1) + - task: UseDotNet@2 + inputs: + version: 6.x + env: + PROCESSOR_ARCHITECTURE: ${{ parameters.BuildArch }} + - template: ../../templates/win-esrp-dll.yml parameters: FolderPath: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'