Skip to content

Fix wrong ORT version in Windows DLL VersionInfo for pipeline builds#29545

Open
Sammy-Dabbas wants to merge 2 commits into
microsoft:mainfrom
Sammy-Dabbas:issue-29536-versioninfo
Open

Fix wrong ORT version in Windows DLL VersionInfo for pipeline builds#29545
Sammy-Dabbas wants to merge 2 commits into
microsoft:mainfrom
Sammy-Dabbas:issue-29536-versioninfo

Conversation

@Sammy-Dabbas

Copy link
Copy Markdown

Description

Official Windows DLLs embed the wrong version in their VersionInfo resource, for example File version 1.27.26.615 for the 1.27.0 release. The cmake fix from #24606 is intact but only covers local builds; official packages are produced by the ADO pipelines, which take a different path in tools/ci_build/build.py. When Build_BuildNumber and Build_SourceVersion are set, that branch stamps VERSION_BUILD_PART from the last two digits of the build year and drops the patch version from the version string entirely. I checked the shipped 1.22.0, 1.23.0, 1.26.0, and 1.27.0 Windows packages and all four carry the wrong version, so this path was never fixed.

This change parses major.minor.patch from VERSION_NUMBER, stamps the real ORT version in the numeric FILEVERSION (keeping MMDD as the fourth part for build traceability; it fits a 16-bit WORD), and includes the patch in the version string, which becomes for example 1.27.0.20260615.4.8f0278c. Local builds are unaffected. One open question for reviewers: whether you would rather have the fourth numeric part be the pipeline revision or zero instead of MMDD.

Motivation and Context

Fixes #29536. Anyone inspecting DLL properties, or tooling that reads VersionInfo to identify the installed ONNX Runtime version, currently sees a build-date artifact instead of the actual release version.

Verified by executing the pristine and patched stamping logic with the real 1.27.0 release inputs (the pristine output reproduces the issue exactly), and by compiling onnxruntime.rc with the Windows SDK rc.exe under both define sets and decoding VS_FIXEDFILEINFO from the .res: 1.27.26.615 before, 1.27.0.615 after. A full pipeline build was not run; confirming end to end means building with Build_BuildNumber and Build_SourceVersion set and checking the DLL's FileVersionRaw.

The ADO pipeline branch in generate_build_tree stamps
VERSION_BUILD_PART from the build year's last two digits and drops the
patch version, so official Windows DLLs report versions like 1.27.26.615
instead of 1.27.0. Stamp the real major.minor.patch from VERSION_NUMBER,
keep MMDD as the fourth numeric part for build traceability, and include
the patch in the version string.

Fixes microsoft#29536.
@Sammy-Dabbas

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect Windows DLL VersionInfo stamping for official Azure DevOps pipeline builds by deriving the correct major.minor.patch from VERSION_NUMBER and including the patch in the version string, instead of deriving the numeric “build” part from the build-year digits.

Changes:

  • Parse major.minor.patch from VERSION_NUMBER when Build_BuildNumber/Build_SourceVersion are present.
  • Stamp VERSION_BUILD_PART with the ORT patch version and include patch in VERSION_STRING (while keeping MMDD in VERSION_PRIVATE_PART).

Comment thread tools/ci_build/build.py
@Sammy-Dabbas

Copy link
Copy Markdown
Author

Good catch on the error message, it referenced VERSION_FILE while the code reads VERSION_NUMBER. Fixed in the latest commit.

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.

[Build] Wrong ORT version in VersionInfo

2 participants