[PATCH] D31985: Support: Add a VCSRevision.h header file.
Quentin Neill via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 06:17:25 PDT 2017
qneill2014 added a comment.
In https://reviews.llvm.org/D31985#732557, @pcc wrote:
> 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
>
Thanks - that fixes the build breakage.
But it still won't work with "repo" managed repositories, since it manages .git/logs directories itself and doesn't seem to change ".git/logs/HEAD" at all.
What about using ".git/HEAD" itself? Isn't this just tracking a dependency to detect when to regenerate the header?
Repository:
rL LLVM
https://reviews.llvm.org/D31985
More information about the llvm-commits
mailing list