Windows: improve path handling, x86 address space and build time - #935
Open
clang-clang-clang wants to merge 1 commit into
Open
Windows: improve path handling, x86 address space and build time#935clang-clang-clang wants to merge 1 commit into
clang-clang-clang wants to merge 1 commit into
Conversation
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.
This PR improves long/non-ASCII path handling for the Windows tools, allows Win32 apps to use addresses/memory above 2GB, and enables parallel compilation for Windows build.
Manifest, long path aware & code-page
A shared application manifest enables longPathAware and sets the process code page to UTF-8. The manifest currently apply for executables only, not the DLLs or libs.
Note: long paths can be enable through registry value in Windows 10, version 1607, and later, with App manifest of course. And the activeCodePage effect starting at Windows Version 1903 (May 2019 Update).
ASCII paths keep working as-is since ASCII is a subset of UTF-8. The code-page change mainly affects narrow-character entry points, such as the command-line arguments used by
lua.exeandluac.exe, allowing their existing UTF-8 file handling to receive non-ASCII paths correctly.Corona Simulator already handles paths as UTF-8/UTF-16, so the code-page setting does not change its existing path behavior. It still gets the long-path opt-in from the shared manifest.
Extended memory limit from 2GB to 4GB on 32-bit Apps
/LARGEADDRESSAWAREis enabled for the Win32 executables, including the App Template.This is enabled by default for 64-bit compiler, so if Solar2D migrates to a 64-bit windows build in the future it will have no effect or can be removed.
Build in parallel
/MPis enabled across the Windows build chain. The old/Gm(Minimal Rebuild) setting in theluafilesystem_dllDebug configuration is disabled due to deprecated, and it is incompatible with/MP.App Template
The App Template has the same manifest, compiler, and linker settings, so generated Windows apps are covered as well.
Test
Tested on Windows:
LongPathsEnabled=1, Corona Simulator loaded a file with a 255-character filename and an absolute path of about 335 characters.luacalso processed the same long path. The same case failed with the old build.mt.exeexported xml from target exe showslongPathAwareistrueandactiveCodePageis set toUTF-8.dumpbin /headersconfirmed target exe has "Application can handle large (>2GB) addresses" per comment https://discord.com/channels/721785436195782677/724637134115438714/1047633649438294167Any suggestions are welcome. Thank you.