Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] long paths in NuGet package breaking build on Windows #21369

Closed
thoemmi opened this issue Jul 16, 2024 · 2 comments
Closed

[Build] long paths in NuGet package breaking build on Windows #21369

thoemmi opened this issue Jul 16, 2024 · 2 comments
Labels
build build issues; typically submitted using template .NET Pull requests that update .net code platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform

Comments

@thoemmi
Copy link

thoemmi commented Jul 16, 2024

Describe the issue

The files in the runtimes folder of the NuGet package result in quite long path, e.g. runtimes/ios/native/onxxrumtime.xcframework/ios-arm64_x86_64-simulator/onnxrumtime.framework/Headers/onnxruntime_session_options_config_keys.h has 142 characters.
This can be problematic if the project referencing that package is at a (still reasonable) subdirectory.

This issue was originally reported in dotnet-smartcomponents/smartcomponents#16

Urgency

No response

Target platform

Windows

Build script

n/a

Error / output

C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3027: Could not copy "C:\Users\Thomas.nuget\packages\microsoft.ml.onnxruntime\1.18.0\runtimes\ios\native\onnxruntime.xcframework\ios-arm64_x86_64-simulator\onnxruntime.framework\Headers\onnxruntime_session_options_config_keys.h" to "bin\Debug\net8.0\runtimes\ios\native\onnxruntime.xcframework\ios-arm64_x86_64-simulator\onnxruntime.framework\Headers\onnxruntime_session_options_config_keys.h". Exceeded retry count of 10. Failed.

Visual Studio Version

Visual Studio 2022 Preview (17.11.0 Preview 3.0)

GCC / Compiler Version

No response

@thoemmi thoemmi added the build build issues; typically submitted using template label Jul 16, 2024
@github-actions github-actions bot added platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform labels Jul 16, 2024
@sophies927 sophies927 added the .NET Pull requests that update .net code label Jul 18, 2024
@skottmckay
Copy link
Contributor

That is the required directory structure for a Nuget native package (the runtimes/<platform>/native prefix) with an Apple xcframework (the onnxruntime.xcframework\ios-arm64_x86_64-simulator\onnxruntime.framework\Headers part) so I'm not sure what we can change.

Do you have long paths enabled?

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell

@thoemmi
Copy link
Author

thoemmi commented Jul 25, 2024

Enabling long paths by settings the registry key as documented in https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#registry-setting-to-enable-long-paths did the trick, I can now compile successfully.

Thanks for the hint!

@thoemmi thoemmi closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template .NET Pull requests that update .net code platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants