From 44ecf9a0c7c25496a43f59f1c8f20df9527e12cb Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 10 Jan 2017 10:41:26 +0000 Subject: Windows: implement and use AsShortWindowsPath Because CreateProcessW doesn't support long paths, not even with the "\\?\" prefix [1], we need to convert long paths to short ones to spawn processes. This change implements the corresponding function and uses it in blaze_util_windows. [1] https://github.com/bazelbuild/bazel/issues/2181#issuecomment-270696173 See https://github.com/bazelbuild/bazel/issues/2107 See https://github.com/bazelbuild/bazel/issues/2181 -- PiperOrigin-RevId: 144062404 MOS_MIGRATED_REVID=144062404 --- src/main/cpp/util/file_platform.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/cpp/util/file_platform.h') diff --git a/src/main/cpp/util/file_platform.h b/src/main/cpp/util/file_platform.h index 9c95468e4b..91fc086627 100644 --- a/src/main/cpp/util/file_platform.h +++ b/src/main/cpp/util/file_platform.h @@ -133,6 +133,10 @@ void ForEachDirectoryEntry(const std::string &path, // prepend the UNC prefix in case they need to pass it to a WinAPI function // (some require the prefix, some don't), or to quote the path if necessary. bool AsWindowsPath(const std::string &path, std::wstring *result); + +// Same as `AsWindowsPath`, but returns a lowercase 8dot3 style shortened path. +// Result will never have a UNC prefix. +bool AsShortWindowsPath(const std::string &path, std::string *result); #endif // defined(COMPILER_MSVC) || defined(__CYGWIN__) } // namespace blaze_util -- cgit v1.2.3