Fix: Win32 build failure when paths contain spaces#2053
Open
nsubaru wants to merge 1 commit intomicrosoft:mainfrom
Open
Fix: Win32 build failure when paths contain spaces#2053nsubaru wants to merge 1 commit intomicrosoft:mainfrom
nsubaru wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 foronnxruntime-genai-cudaso paths with spaces are passed as a single argument.
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
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
Notes
This issue primarily affects Windows environments.