From cf0b51925b6eadbf1e8055befc53c9d2d0a10871 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sat, 13 Nov 2021 22:42:35 -0500 Subject: [PATCH] `Base.GIT_VERSION_INFO`: record the Buildkite commit that was used to build Julia --- base/version_git.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/base/version_git.sh b/base/version_git.sh index c46021097995e..bf178dda9d93d 100644 --- a/base/version_git.sh +++ b/base/version_git.sh @@ -13,6 +13,8 @@ echo " date_string::String" echo " tagged_commit::Bool" echo " fork_master_distance::Int" echo " fork_master_timestamp::Float64" +echo " build_system_commit::String" +echo " build_system_commit_short::String" echo "end" echo "" @@ -82,6 +84,16 @@ if [ -z "$fork_master_timestamp" ]; then fork_master_timestamp="0" fi +build_system_directory="../.buildkite" +if [[ -d "${build_system_directory:?}" ]]; then + build_system_commit=$(git -C "${build_system_directory:?}" rev-parse HEAD) + build_system_commit_short=$(git -C "${build_system_directory:?}" rev-parse --short HEAD) +else + echo "Warning: The build system directory does not exist: ${build_system_directory:?}" >&2 + build_system_commit="" + build_system_commit_short="" +fi + echo "const GIT_VERSION_INFO = GitVersionInfo(" echo " \"$commit\"," echo " \"$commit_short\"," @@ -90,5 +102,7 @@ echo " $build_number," echo " \"$date_string\"," echo " $tagged_commit," echo " $fork_master_distance," -echo " $fork_master_timestamp." +echo " $fork_master_timestamp.," +echo " \"$build_system_commit\"," +echo " \"$build_system_commit_short\"," echo ")"