Skip to content

[Build] Fix DML Nuget Pipeline#27242

Closed
tianleiwu wants to merge 10 commits intorel-1.24.1from
tlwu/dml_nuget_pipeline_fix
Closed

[Build] Fix DML Nuget Pipeline#27242
tianleiwu wants to merge 10 commits intorel-1.24.1from
tlwu/dml_nuget_pipeline_fix

Conversation

@tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Feb 4, 2026

Fix DML NuGet Packaging Build Failure & Component Governance Warnings

I have addressed three distinct issues, incorporating feedback to improve robustness.

Changes

1. Fix arm64 Job Renaming

Replaced ren with PowerShell + error handling:

File: tools/ci_build/github/azure-pipelines/dml-nuget-packaging.yml

powershell -Command "Get-ChildItem Microsoft.ML.OnnxRuntime.DirectML.*.nupkg -ErrorAction Stop | Sort-Object -Property Name | Select-Object -First 1 | Rename-Item -NewName win-dml-arm64.zip"      

2. Fix Bundling Script (Multiple Matches)

The script was finding multiple packages (Release vs Dev, Main vs Symbols) and failing. I updated it to robustness selection logic:

  1. Filter: Exclude *.symbols.nupkg.
  2. Select Best: If multiple remain (e.g. 1.24.1.nupkg vs 1.24.1-dev...nupkg), select the one with the shortest filename, which prioritizes the canonical Release package.

File: tools/ci_build/github/windows/bundle_dml_package.ps1

# Before: Error if count != 1
- if ($nupkgFiles.Count -ne 1) { Write-Error ... }

# After: Warn and Select Best (Shortest Name)
+ if ($nupkgFiles.Count -gt 1) { Write-Warning "Found multiple packages. Selecting the one with the shortest filename." }
+ $nupkg = $nupkgFiles | Sort-Object {$_.Name.Length} | Select-Object -First 1

3. Fix Component Governance Warnings

Added setuptools installation for Python 3.12 compatibility.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes two issues in the DML NuGet packaging pipeline: (1) packaging build failures caused by multiple .nupkg files (main package and symbols package) when using the Windows ren command, and (2) Component Governance warnings due to Python 3.12's removal of the distutils module.

Changes:

  • Added setuptools installation to resolve Python 3.12 distutils deprecation
  • Replaced fragile batch ren command with explicit PowerShell logic to rename only the main .nupkg file (not symbols package)
  • Fixed trailing whitespace

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianleiwu tianleiwu force-pushed the tlwu/dml_nuget_pipeline_fix branch from c7f121c to f8fd180 Compare February 5, 2026 07:08
@tianleiwu tianleiwu closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant