Fix NuGet packages missing onnxruntime_experimental_c_api.inc - #29866
Merged
tianleiwu merged 3 commits intoJul 27, 2026
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot
AI
changed the title
[WIP] Fix missing onnxruntime_experimental_c_api.inc in NuGet packages
Fix NuGet packages missing onnxruntime_experimental_c_api.inc
Jul 24, 2026
tianleiwu
added a commit
that referenced
this pull request
Jul 24, 2026
This chery pick #29866 to 1.28 release Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
tianleiwu
approved these changes
Jul 24, 2026
tianleiwu
marked this pull request as ready for review
July 24, 2026 23:12
tianleiwu
approved these changes
Jul 26, 2026
tianleiwu
enabled auto-merge (squash)
July 27, 2026 22:29
jiafatom
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The NuGet native packages shipped
onnxruntime_experimental_c_api.hbut notonnxruntime_experimental_c_api.inc, which the header#includes directly — causing a fatal compile error for any C/C++ consumer.tools/nuget/generate_nuspec_for_native_nuget.pyonnxruntime_*.incglob entry alongside the existingonnxruntime_*.hglob so all.incfiles frominclude/onnxruntime/core/session/are packaged.tools/nuget/validate_package.pyonnxruntime_experimental_c_api.handonnxruntime_experimental_c_api.inctogpu_related_header_files,dmlep_related_header_files, andtraining_related_header_filesso CI validation catches this class of regression.Motivation and Context
onnxruntime_experimental_c_api.hends with#include "onnxruntime_experimental_c_api.inc". The NuGet packaging script used a*.hglob that by construction excludes.incfiles, so the included file was never shipped. The CMake install rules already handle both files correctly; this aligns NuGet packaging with that behavior.Affected packages: all native NuGet packages (
Microsoft.ML.OnnxRuntime,.Gpu.Windows,.Gpu.Linux, etc.).