From 1a2e289d2d954057ce8d707f7047c49bcfbbe5bd Mon Sep 17 00:00:00 2001 From: Tiago Koji Castro Shibata Date: Wed, 16 Sep 2020 10:37:09 -0700 Subject: [PATCH] Fix nuget build (#5163) * Fix nuget content * Revert "Fix nuget content" This reverts commit e2cdcec4e39964c50eac2fb306c7a4bb84352443. * Nuget packaging * skip tests * msbuild path * Force msbuild version * Workaround https://github.com/NuGet/Home/issues/7621 * cleanup --- .../Microsoft.AI.MachineLearning.targets | 10 +++------- onnxruntime/core/platform/path_lib.cc | 4 ++-- .../azure-pipelines/nuget/templates/test_win.yml | 4 ++-- .../nuget/templates/windowsai.yml | 10 +++++----- .../azure-pipelines/templates/win-ci-2019.yml | 4 ++-- .../windows-build-tools-setup-steps.yml | 4 ++-- .../templates/windowsai-nuget-build.yml | 5 +++-- .../github/azure-pipelines/win-ci-pipeline.yml | 16 ++++++++-------- .../azure-pipelines/win-gpu-ci-pipeline.yml | 4 ++-- .../azure-pipelines/win-gpu-cuda-11-pipeline.yml | 4 ++-- .../win-nocontribops-ci-pipeline.yml | 4 ++-- .../win-x86-nocontribops-ci-pipeline.yml | 5 ++--- 12 files changed, 35 insertions(+), 39 deletions(-) diff --git a/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets b/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets index 5f082a5795..62c505e12d 100644 --- a/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets +++ b/csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets @@ -32,11 +32,7 @@ $(WindowsAIBinary);$(OnnxRuntimeBinary) - - - Binplacing WindowsAI binaries: {0} and {1}. - - - - + + + diff --git a/onnxruntime/core/platform/path_lib.cc b/onnxruntime/core/platform/path_lib.cc index 081d011013..f006257127 100644 --- a/onnxruntime/core/platform/path_lib.cc +++ b/onnxruntime/core/platform/path_lib.cc @@ -17,7 +17,7 @@ #include #pragma comment(lib, "PathCch.lib") // Desktop apps need to support back to Windows 7, so we can't use PathCch.lib as it was added in Windows 8 -#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#elif WINVER < _WIN32_WINNT_WIN8 #include #pragma comment(lib, "Shlwapi.lib") #else @@ -37,7 +37,7 @@ namespace { Status RemoveFileSpec(PWSTR pszPath, size_t cchPath) { assert(pszPath != nullptr && pszPath[0] != L'\0'); -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(USE_PATHCCH_LIB) +#if WINVER < _WIN32_WINNT_WIN8 && !defined(USE_PATHCCH_LIB) (void)cchPath; for (PWSTR t = L"\0"; *t == L'\0'; t = PathRemoveBackslashW(pszPath)) ; diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml index 0a53571f76..0c07576669 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml @@ -27,9 +27,9 @@ jobs: architecture: x64 - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: BatchScript@1 displayName: 'setup env' diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/windowsai.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/windowsai.yml index 4b8c5bf095..c90c8f4661 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/windowsai.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/windowsai.yml @@ -139,13 +139,13 @@ jobs: targetPath: '$(Build.BinariesDirectory)/nuget-artifact-arm' - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact - NuGet DirectML x64 Store' + displayName: 'Download Pipeline Artifact - NuGet CPU x64 Store' inputs: artifactName: 'Microsoft.AI.MachineLearning.x64.Store' targetPath: '$(Build.BinariesDirectory)/nuget-artifact-x64-store' - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact - NuGet DirectML x86 Store' + displayName: 'Download Pipeline Artifact - NuGet CPU x86 Store' inputs: artifactName: 'Microsoft.AI.MachineLearning.x86.Store' targetPath: '$(Build.BinariesDirectory)/nuget-artifact-x86-store' @@ -392,13 +392,13 @@ jobs: displayName: 'Setup VS2019 env vars' inputs: filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' - arguments: 'amd64' + arguments: x64 modifyEnvironment: true - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: PowerShell@2 displayName: 'NuGet Tests: Restore Windows.AI.MachineLearning Nuget Package (CppWinRT)' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml index 5784cadf36..666a734603 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml @@ -131,9 +131,9 @@ jobs: - ${{ if eq(parameters.BuildCSharp, true) }}: - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - ${{ if eq(parameters.BuildCSharp, true) }}: - task: DotNetCoreCLI@2 diff --git a/tools/ci_build/github/azure-pipelines/templates/windows-build-tools-setup-steps.yml b/tools/ci_build/github/azure-pipelines/templates/windows-build-tools-setup-steps.yml index 40e513b015..f97be247e7 100644 --- a/tools/ci_build/github/azure-pipelines/templates/windows-build-tools-setup-steps.yml +++ b/tools/ci_build/github/azure-pipelines/templates/windows-build-tools-setup-steps.yml @@ -5,9 +5,9 @@ parameters: DoDataDownload: true steps: - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 # - task: UniversalPackages@0 # displayName: 'Download python' # inputs: diff --git a/tools/ci_build/github/azure-pipelines/templates/windowsai-nuget-build.yml b/tools/ci_build/github/azure-pipelines/templates/windowsai-nuget-build.yml index 708d77476b..54eda01d51 100644 --- a/tools/ci_build/github/azure-pipelines/templates/windowsai-nuget-build.yml +++ b/tools/ci_build/github/azure-pipelines/templates/windowsai-nuget-build.yml @@ -148,10 +148,11 @@ steps: copy $(Build.SourcesDirectory)\onnxruntime\test\testdata\sequence_length.onnx $(Build.ArtifactStagingDirectory)\test_artifact\ copy $(Build.SourcesDirectory)\onnxruntime\test\testdata\sequence_construct.onnx $(Build.ArtifactStagingDirectory)\test_artifact\ displayName: 'Copy WinML test collateral to artifact directory' + - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: BatchScript@1 displayName: 'Setup VS2019 env vars' diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml index a7446863b3..39d4e5a684 100644 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml @@ -53,9 +53,9 @@ jobs: displayName: 'Install ONNX' - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: NuGetCommand@2 displayName: 'NuGet restore' @@ -230,9 +230,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 @@ -369,9 +369,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 displayName: 'Restore nuget packages' @@ -497,9 +497,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml index 57f2c22419..782d7f3827 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml @@ -78,9 +78,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 displayName: 'Restore nuget packages' diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-11-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-cuda-11-pipeline.yml index 83bd46d82f..541cf3d166 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-11-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-cuda-11-pipeline.yml @@ -77,9 +77,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 displayName: 'Restore nuget packages' diff --git a/tools/ci_build/github/azure-pipelines/win-nocontribops-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-nocontribops-ci-pipeline.yml index c9b6a38d03..8a0ef41a7c 100644 --- a/tools/ci_build/github/azure-pipelines/win-nocontribops-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-nocontribops-ci-pipeline.yml @@ -77,9 +77,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 displayName: 'Restore nuget packages' diff --git a/tools/ci_build/github/azure-pipelines/win-x86-nocontribops-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-x86-nocontribops-ci-pipeline.yml index 972b39c133..f24af318ff 100644 --- a/tools/ci_build/github/azure-pipelines/win-x86-nocontribops-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-x86-nocontribops-ci-pipeline.yml @@ -77,9 +77,9 @@ jobs: - template: templates/set-test-data-variables-step.yml - task: NuGetToolInstaller@0 - displayName: Use Nuget 4.9 + displayName: Use Nuget 5.7.0 inputs: - versionSpec: 4.9.4 + versionSpec: 5.7.0 - task: DotNetCoreCLI@2 @@ -116,4 +116,3 @@ jobs: condition : 'succeeded' - template: templates/clean-agent-build-directory-step.yml - \ No newline at end of file