[PATCH] D111252: [llvm] [Support] [Debuginfo] Add http and debuginfod client libraries and llvm-debuginfod-find tool

Noah Shutty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 16:49:20 PDT 2021


noajshu added inline comments.


================
Comment at: llvm/tools/llvm-debuginfod/llvm-debuginfod-find.cpp:71-79
+  const char *HomeEnv = std::getenv("HOME");
+  if (HomeEnv == NULL) {
+    LLVM_DEBUG(dbgs() << "HOME not set\n";);
+    return 1;
+  }
+  LLVM_DEBUG(dbgs() << "HOME = " << HomeEnv << "\n";);
+  SmallString<64> CacheDirectoryPath;
----------------
phosek wrote:
> I think this should use `XDG_CACHE_HOME` when set instead (which typically defaults to `$HOME/.cache`), see https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html. We should also check what the macOS and Windows alternatives are. This implementation should only be used as a fallback.
Thanks, I've switched it out to use LLVM's platform-independent `cache_directory` function, which in turn uses `XDG_CACHE_HOME` where applicable.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111252/new/

https://reviews.llvm.org/D111252



More information about the llvm-commits mailing list