Running this GN code:
rebased_path = rebase_path("/E:/foo/bar", root_build_dir)
print(rebased_path)
gives following output:
../../../../../../E:/foo/bar
This path is not valid because "E:" cannot be placed in the middle of the path.
Above code doesn't work if gn is run from Git Bash. On the other hand rebase_path("/e:/foo/bar", root_build_dir) fails if gn is run from Windows cmd.exe (and surprisingly enough from Git Bash on some Windows 10 machines).
The root cause is that Setup::FillSourceDir() uses either capital ("E:") or non-capital ("e:") drive letter, depending on how gn is being run. It doesn't matter for the build unless rebase_path() with absolute-path input is used.
Comment 1 by bugdroid1@chromium.org
, Mar 22 2016