bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
76 stars 228 forks source link

Long path and Unicode support on Windows 10+ #316

Closed Kojoley closed 1 year ago

Kojoley commented 1 year ago

Long path support is still not universal, even after an app has explicitly opted-in via manifest it also requires registry modification or group policies, see https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later though Python and Git installers nudges to enable it by their installers for a while.

-X utf8 forces Python to use UTF-8 when its outputs are piped (will be default in 3.15 https://peps.python.org/pep-0686/)

Also had to fix clang-linux and msvc toolsets manifest embedding issues.

Fixes #158

Kojoley commented 1 year ago

Holy... How many corners I hit there, but it finally works.

Kojoley commented 1 year ago

I'm not convinced of the utility of turning on the long-path flag. I'd rather see just the UTF8 changes. And deal with long-path separately if truly needed.

Why? Most of the things here are to embed manifest file, the cost of enabling long path support is just a single line in manifest file.

Is there some way to get the compiler front-end to link in the RC without having to rely on another external tool?

I don't think there is. Even link.exe calls rc.exe and will fail if you don't have WinSDK in the PATH (that's the roadblock of #159).

grafikrobot commented 1 year ago

I'm not convinced of the utility of turning on the long-path flag. I'd rather see just the UTF8 changes. And deal with long-path separately if truly needed.

Why? Most of the things here are to embed manifest file, the cost of enabling long path support is just a single line in manifest file.

Because I was thinking that the long-path didn't make a different on shell execution / rsp files. But.. now I see it does :-) (I blame spending last week on wg21 and my brain not entirely recovering yet).

Is there some way to get the compiler front-end to link in the RC without having to rely on another external tool?

I don't think there is. Even link.exe calls rc.exe and will fail if you don't have WinSDK in the PATH (that's the roadblock of #159).

Unfortunate. But I guess it is what it is.

Kojoley commented 1 year ago

Filed https://github.com/msys2/MINGW-packages/issues/17812 about msys2 fails. I don't think it will be fixed anytime soon so skip the test for now.