-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This probably isn't the right repo for this, but I can't find an issue tracker for depot_tools and since Dart is using it I'm hoping someone may be able to advise where to send this (or pass it on).
This morning I'm unable to gclient sync in the Dart repo. It fails like this:
PS D:\Dev\Google\dart-sdk\sdk> gclient sync -D
Updating depot_tools...
Traceback (most recent call last):
File "D:\Dev\Google\depot_tools\bootstrap\bootstrap.py", line 408, in <module>
sys.exit(main(sys.argv[1:]))
^^^^^^^^^^^^^^^^^^
File "D:\Dev\Google\depot_tools\bootstrap\bootstrap.py", line 374, in main
git_dir = search_win_git_directory()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Dev\Google\depot_tools\bootstrap\bootstrap.py", line 282, in search_win_git_directory
if _within_depot_tools(p):
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Dev\Google\depot_tools\bootstrap\bootstrap.py", line 252, in _within_depot_tools
return os.path.commonpath([os.path.abspath(path), ROOT_DIR]) == ROOT_DIR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen ntpath>", line 826, in commonpath
ValueError: Paths don't have the same drive
PS D:\Dev\Google\dart-sdk\sdk>
My Python is rusty, but it seems it's calling _within_depot_tools to check whether a path is within the depot_tools checkout or not. However that calls commonpath which seems to through if the paths are on different drives. Since it does does this for every path in my PATH environment variable. It fails for any path on drive C because my depot_tools is on drive D:
path = C:\Program Files\PowerShell\7
ROOT_DIR = D:\Dev\Google\depot_tools
I suspect this is a recent change (since yesterday) and that the fix is probably for _within_depot_tools to first check whether the drives match before calling commonpath.
(I can hack this file locally for now to get running, so it's not urgent for me, but it's possible this will affect other Windows contributors)