diff options
author | 2017-01-02 11:35:35 +0000 | |
---|---|---|
committer | 2017-01-03 15:03:23 +0000 | |
commit | 224a3ddc8ae195f303117e4407052e6f89ff694f (patch) | |
tree | 62b33e13ca44454474f2dd2e5b03b8973936006b /src/test/cpp | |
parent | 112840b4d6fafd04e2381a2e52fbad848a818ea6 (diff) |
Bazel client, Windows: fix MSYS root retrieval
The file_windows.cc:MsysRoot::Get() function was
incorrectly assuming that bash.exe is usually
under c:\tools\msys64\bin\bash.exe when in reality
it's c:\tools\msys64\usr\bin\bash.exe, so we need
to walk up one more directory.
Unfortunately the test was assuming the same so
the bug wasn't caught.
The new code is a bit more foolproof in that it
looks for an msys-looking final path segment and
assumes that to be the msys root.
Fixes https://github.com/bazelbuild/bazel/issues/2323
--
PiperOrigin-RevId: 143372193
MOS_MIGRATED_REVID=143372193
Diffstat (limited to 'src/test/cpp')
-rw-r--r-- | src/test/cpp/util/file_windows_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/cpp/util/file_windows_test.cc b/src/test/cpp/util/file_windows_test.cc index 048d13b510..231e21d6f8 100644 --- a/src/test/cpp/util/file_windows_test.cc +++ b/src/test/cpp/util/file_windows_test.cc @@ -95,7 +95,7 @@ TEST(FileTest, IsRootDirectory) { } TEST(FileTest, TestAsWindowsPath) { - SetEnvironmentVariableA("BAZEL_SH", "c:\\dummy\\msys\\bin\\bash.exe"); + SetEnvironmentVariableA("BAZEL_SH", "c:\\msys\\some\\long\\path\\bash.exe"); std::wstring actual; ASSERT_TRUE(AsWindowsPath("", &actual)); @@ -120,7 +120,7 @@ TEST(FileTest, TestAsWindowsPath) { ASSERT_EQ(std::wstring(L"d:\\progra~1\\micros~1"), actual); ASSERT_TRUE(AsWindowsPath("/foo", &actual)); - ASSERT_EQ(std::wstring(L"c:\\dummy\\msys\\foo"), actual); + ASSERT_EQ(std::wstring(L"c:\\msys\\foo"), actual); std::wstring wlongpath(L"dummy_long_path\\"); std::string longpath("dummy_long_path/"); |