aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-22 21:01:46 +0900
committernsfisis <nsfisis@gmail.com>2026-08-22 21:01:46 +0900
commit3185a4da1246bee5c564394a20874835b5d8def1 (patch)
tree882993ba0dcca82e917e5cf6902145e171caad14 /crates
parent48981196fb54aef826fe6f94c8028ed1c4b9db7a (diff)
downloadphp-shirabe-3185a4da1246bee5c564394a20874835b5d8def1.tar.gz
php-shirabe-3185a4da1246bee5c564394a20874835b5d8def1.tar.zst
php-shirabe-3185a4da1246bee5c564394a20874835b5d8def1.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe/src/downloader/path_downloader.rs17
1 files changed, 5 insertions, 12 deletions
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
}
}