Skip to content

Fix: Win32 build failure when paths contain spaces#2053

Open
nsubaru wants to merge 1 commit intomicrosoft:mainfrom
nsubaru:fix/win32-build-failure-when-path-contain-spaces
Open

Fix: Win32 build failure when paths contain spaces#2053
nsubaru wants to merge 1 commit intomicrosoft:mainfrom
nsubaru:fix/win32-build-failure-when-path-contain-spaces

Conversation

@nsubaru
Copy link
Copy Markdown

@nsubaru nsubaru commented Apr 1, 2026

Description

Fixes a Win32 build issue when project paths contain spaces (e.g. "C:\Program Files").

Problem

The build fails when the path to root of repo contain space, ir results in treating path to ${GENERATORS_ROOT}/cuda/symbols.def as two or more args when vcxproj file generate, in case when there is one space, second part treat as additional object file for linker (it's bad as linker fail) while first part ModuleDefinitionFile xml node (which is okay).

Solution

Added proper quoting to affected paths in build scripts / command invocations.

Testing

  • Verified build succeeds with path containing spaces
  • Verified no regressions with standard paths

Notes

This issue primarily affects Windows environments.

Copilot AI review requested due to automatic review settings April 1, 2026 11:19
Copy link
Copy Markdown
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 PR addresses build-system robustness when generating/linking the CUDA shared library, specifically fixing a Win32 failure mode where a .def file path containing spaces is interpreted as multiple linker arguments.

Changes:

  • Quote the Windows linker -DEF: path for onnxruntime-genai-cuda so paths with spaces are passed as a single argument.

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.

2 participants