[PATCH] D31985: Support: Add a VCSRevision.h header file.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 13:22:51 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D31985#732540, @qneill2014 wrote:

> FYI this breaks downstream builders that rely on the "repo" utility, since the file ".git/logs/HEAD" may not exist.


Hi Quentin, please let me know whether this patch fixes the problem in your scenario.

  diff --git a/llvm/include/llvm/Support/CMakeLists.txt b/llvm/include/llvm/Support/CMakeLists.txt
  index b4b99370574..f1901e55004 100644
  --- a/llvm/include/llvm/Support/CMakeLists.txt
  +++ b/llvm/include/llvm/Support/CMakeLists.txt
  @@ -17,7 +17,9 @@ macro(find_first_existing_vc_file out_var path)
       OUTPUT_VARIABLE git_dir)
     if(git_result EQUAL 0)
       string(STRIP "${git_dir}" git_dir)
  -    set(${out_var} "${git_dir}/logs/HEAD")
  +    if(EXISTS "${git_dir}/logs/HEAD")
  +      set(${out_var} "${git_dir}/logs/HEAD")
  +    endif()
     else()
       find_first_existing_file(${out_var}
         "${path}/.svn/wc.db"   # SVN 1.7


Repository:
  rL LLVM

https://reviews.llvm.org/D31985





More information about the llvm-commits mailing list