[all-commits] [llvm/llvm-project] 225e14: [Support][Windows] Use the original path if GetFin...

Dmitry Vasilyev via All-commits all-commits at lists.llvm.org
Fri Apr 5 11:40:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 225e14e5b6d64e1f63da39fa7fe31d2ebb08260d
      https://github.com/llvm/llvm-project/commit/225e14e5b6d64e1f63da39fa7fe31d2ebb08260d
  Author: Dmitry Vasilyev <dvassiliev at accesssoftek.com>
  Date:   2024-04-05 (Fri, 05 Apr 2024)

  Changed paths:
    M llvm/lib/Support/Windows/Path.inc

  Log Message:
  -----------
  [Support][Windows] Use the original path if GetFinalPathNameByHandleW() failed (#87749)

The commit f11b056c (#76304) breaks `clang` and other tools if they are
used from a RAMDrive. `GetFinalPathNameByHandleW()` may return 0 and
GetLastError 0x28. This patch fixes that issue. Note `real_path()` uses
`openFileForRead()` but it reports the error only if failed to open a
file. Getting `RealPath` is optional functionality.

BTW, `sys::fs::real_path()` resolves not only symlinks, but also network
drives and virtual drives created by the `subst` tool. It may break an
automation. It is better to detect symlinks and resolve only symlinks.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list