msys2 / msys2-autobuild

🏭🏭🏭🏭🏭🏭🏭🏭
https://packages.msys2.org/queue
MIT License
36 stars 25 forks source link

Shorten BUILD_ROOT #43

Closed MehdiChinoune closed 2 years ago

jeremyd2019 commented 2 years ago

that saves 2 characters off the path. it would be possible to save 2 more using subst to git repo root (say M:\ or S:\). it might be possible to subst to the package directory for even more savings, but IIRC some packages look outside their package directory with relative paths.

MehdiChinoune commented 2 years ago

that saves 2 characters off the path. it would be possible to save 2 more using subst to git repo root (say M:\ or S:\). it might be possible to subst to the package directory for even more savings, but IIRC some packages look outside their package directory with relative paths.

It would be possible to save 10 characters by stripping mingw-w64- prefix from MinGW-packages folder names.

MehdiChinoune commented 2 years ago

Microsoft added support for path length up to 32767 since Windows 1607 ^1 (before Windows Server 2016), but should be enabled by the user. Fortunately It is enabled on Github Actions Images.

(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
1

I think the blocker is from mingw-w64 side where MAX_PATH is still defined to 260

// minwindef.h:33
#define MAX_PATH 260
lazka commented 2 years ago

that new path limit only works if you dont use MAX_PATH afaik, so depends on each tool and not mingw-w64. python uses the new limit for example

MehdiChinoune commented 2 years ago

@lazka Could you rebuild rust, I think this change will fix its failure to build with msys2-autobuild.

lazka commented 2 years ago

@lazka Could you rebuild rust, I think this change will fix its failure to build with msys2-autobuild.

thanks, building now

jeremyd2019 commented 2 years ago

that new path limit only works if you dont use MAX_PATH afaik, so depends on each tool and not mingw-w64. python uses the new limit for example

Yes. Also, I think each executable needs to have a manifest that opts it in to the new limit. Because a program could easily get a buffer overflow from some of those APIs that don't take a length, and assume a MAX_PATH sized buffer.

jeremyd2019 commented 2 years ago

I was afraid of this:

  Cloning into 'C:\runner\_work\msys2-autobuild\msys2-autobuild\M'...

C: means the CWD on drive C, C:\ means the root of drive C.

lazka commented 2 years ago

rust still went through.. weird

jeremyd2019 commented 2 years ago

In autobuild, the CWD on drive C was the root (the CWD on drive D was the checkout of msys2-autobuild). On my self-hosted runner, there is only drive C, so the CWD was the checkout in the runner's work directory.