-
Notifications
You must be signed in to change notification settings - Fork 5.3k
AOT publish passes with long paths on Windows #121956
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
base: main
Are you sure you want to change the base?
Conversation
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this 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 the fix for issue #103625 by removing the workaround for long path failures on Windows during AOT publish and adding a dedicated test to verify the fix.
- Removed commented-out active issue annotation and explanatory comments about long path limitations
- Added a new test
DefaultTemplate_AOT_WithLongPaththat explicitly creates a project with a long path and performs AOT publish to ensure it works correctly
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
|
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #103625.
This PR fixes Windows MAX_PATH (260 character) limitation in WASM AOT compilation by adding
\\?\prefix support to long file paths across the Mono runtime's file operations.Long path prefix comes from Unicode “W” APIs. Windows versions from Windows NT on support that API.
OSs that do not support this change:
Changes:
gpath.c: Adds
g_path_make_long_compatible()helper function that conditionally adds\\?\prefix to Windows paths ≥260 characters, supporting both regular absolute paths (C:\path→\\?\C:\path) and UNC network paths (\\server\share→\\?\UNC\server\share).mono-path.c: Uses
g_path_make_long_prefix()inmono_path_canonicalize()to ensure canonicalized paths support long path operations.image.c: Uses the canonicalized absolute path (
absfname) instead of the original filename when loading assemblies to ensure long paths are handled correctly throughout the image loading process.MonoAOTCompiler.cs: Passes full absolute paths to the AOT compiler instead of potentially relative paths to ensure Windows long path support (
\\?\prefix from canonicalization) works correctly.gfile-win32.c: Calls
g_path_make_long_compatible()ing_file_test()before callingGetFileAttributesW()to enable existence checks for files with long paths.gfile.c: Calls
g_path_make_long_compatible()ing_fopen()before opening files to support long paths when the runtime needs to open assembly files.BuildPublishTests.cs: Adds
DefaultTemplate_AOT_WithLongPathtest with 300+ character path prefix to verify long path support works correctly with AOT compilation.