2 Commits
Author SHA1 Message Date
Reyad Attiyat bf0ce94fec unzip: mark bsdunzip as long-path aware on Windows
Signed-off-by: God-damnit-all <53661808+God-damnit-all@users.noreply.github.com>
2026-06-24 18:02:20 +02:00
Reyad Attiyat 6ef83d7a41 tar: mark bsdtar as long-path aware on Windows
bsdtar's -C/--directory option calls SetCurrentDirectoryW(), which is
 limited to MAX_PATH (260) characters unless the process opts in to long
 path support via an application manifest declaring longPathAware.
 Extracting into (or changing into) a directory whose path exceeds 260
 characters fails with "could not chdir".

 Embed a longPathAware application manifest into bsdtar.exe so these
 operations work for long destination paths. Both Windows build systems
 (CMake and the autotools/Makefile.am build) embed it, using different
 mechanisms per toolchain:

   - MinGW/Clang (GNU ld) do not generate an application manifest, so it
     is compiled from a resource script (bsdtar.rc) via windres. This
     manifest replaces the toolchain default, so it also declares the
     asInvoker execution level explicitly.
   - MSVC's linker already embeds a manifest (resource id 1); a duplicate
     RT_MANIFEST resource fails to link (CVT1100). Instead the manifest is
     merged into the linker's default manifest (asInvoker) by adding it to
     the target sources.
2026-06-22 22:37:05 -05:00