From 3185a4da1246bee5c564394a20874835b5d8def1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 22 Aug 2026 21:01:46 +0900 Subject: feat(path-downloader): implement safe_junctions as always true Composer requires Windows 7 or later with proc_open available before it will use junctions, because a PHP bug (bugs.php.net #77552) makes junction detection fragile and can lose the target content when a package is removed. Junctions are created and removed here without going through PHP, so that bug does not apply and the check always passes. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/downloader/path_downloader.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs index a96d8db7..4f0435df 100644 --- a/crates/shirabe/src/downloader/path_downloader.rs +++ b/crates/shirabe/src/downloader/path_downloader.rs @@ -163,19 +163,12 @@ impl PathDownloader { // Returns true if junctions can be created and safely used on Windows. // - // A PHP bug makes junction detection fragile, leading to possible data loss when removing a - // package. See https://bugs.php.net/bug.php?id=77552 - // - // For safety we require a minimum version of Windows 7, so we can call the system rmdir which - // will preserve target content if given a junction. - // - // The PHP bug was fixed in 7.2.16 and 7.3.3 (requires at least Windows 7). + // Composer restricts this to Windows 7 or later with proc_open available, because a PHP bug + // (https://bugs.php.net/bug.php?id=77552) makes junction detection fragile and can lose the + // target content when removing a package. Junctions are created and removed here without + // going through PHP, so that bug does not apply. fn safe_junctions(&self) -> bool { - // We need to call mklink, and rmdir on Windows 7 (version 6.1) - // TODO(windows): PHP reads the Windows version off PHP_WINDOWS_VERSION_MAJOR and - // PHP_WINDOWS_VERSION_MINOR, which describe the host rather than PHP; this port has to - // ask the OS for it. - todo!() + true } } -- cgit v1.3.1-4-g156e