Page MenuHomePhabricator

Fix root path finding on Windows
AbandonedPublic

Authored by BYK on Apr 10 2016, 4:04 PM.
Tags
None
Referenced Files
F19505655: D15676.id40108.diff
Fri, Jan 9, 1:15 PM
F19069305: D15676.id.diff
Nov 30 2025, 1:42 PM
F19064537: D15676.id.diff
Nov 29 2025, 9:57 PM
F18975748: D15676.id40108.diff
Nov 16 2025, 9:54 AM
F18969402: D15676.id37874.diff
Nov 15 2025, 6:09 AM
F18872210: D15676.id41286.diff
Nov 5 2025, 2:51 AM
F18871473: D15676.id40108.diff
Nov 4 2025, 10:51 PM
F18856106: D15676.id40109.diff
Nov 1 2025, 8:05 AM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Maniphest Tasks
T8291: arc version fails on Windows
Summary

/ is not a root path on Windows and when using commands like arc version it resolves to the current working directory. This patch replaces the default / with %HOMEDRIVE% to fix the issue.

This patch fixes T8291 when combined with D15675.

Test Plan

Manual verification on Windows.

Diff Detail

Repository
rPHU libphutil
Branch
windows-root-path
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 11638
Build 14560: arc lint + arc unit

Unit TestsFailed

TimeTest
43 msFileFinderTestCase::Unknown Unit Message ("")
EXCEPTION (CommandException): Command failed with error #1! COMMAND find . "(" -path "./exclude" -o -path "subdir.txt" ")" -prune -o "(" -name "*.txt" ")" "(" -path "*" ")" -print0
26 msFileFinderTestCase::Unknown Unit Message ("")
EXCEPTION (CommandException): Command failed with error #1! COMMAND find . "(" -path "./exclude" -o -path "subdir.txt" ")" -prune -o -type "f" "(" -name "test" ")" "(" -path "*" ")" -print0
25 msFileFinderTestCase::Unknown Unit Message ("")
EXCEPTION (CommandException): Command failed with error #2! COMMAND find . "(" -path "./exclude" -o -path "subdir.txt" ")" -prune -o -type "f" "(" -name "*.txt" ")" "(" -path "*/include_dir.txt/subdir.txt/alsoinclude.txt" ")" -print0
28 msFileFinderTestCase::Unknown Unit Message ("")
EXCEPTION (CommandException): Command failed with error #1! COMMAND find . "(" -path "./exclude" -o -path "subdir.txt" ")" -prune -o -type "f" "(" -name "*.txt" ")" "(" -path "*" ")" -print0
27 msFileFinderTestCase::Unknown Unit Message ("")
EXCEPTION (CommandException): Command failed with error #1! COMMAND find . "(" -path "./exclude" -o -path "subdir.txt" ")" -prune -o -type "f" "(" -name "*.txt" ")" "(" -path "*" ")" -print0
View Full Test Results (13 Failed · 15 Passed)

Event Timeline

BYK retitled this revision from to Fix root path finding on Windows.
BYK updated this object.
BYK edited the test plan for this revision. (Show Details)
BYK added a reviewer: epriestley.
eadler added inline comments.
src/filesystem/Filesystem.php
743–745

won't this fail if arc is run on a project checked out to a drive other than %HOMEDRIVE%?

src/filesystem/Filesystem.php
743–745

Possibly. That said there's not reliable equivalent of / on Windows AFAIK. If you think getting the install drive for arc is a better option, I can update accordingly.

Btw. this section is gonna change substantially since there are some other issues I realized when fixing tests. Updating coming soon.

BYK edited edge metadata.
  • Fix test failures

Anything I can do to move this one forward?