Skip to content

Commit

Permalink
Base.GIT_VERSION_INFO: record the Buildkite commit that was used to…
Browse files Browse the repository at this point in the history
… build Julia (#43073)
  • Loading branch information
DilumAluthge authored Nov 22, 2021
1 parent a0c920c commit a21cc80
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion base/version_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down Expand Up @@ -82,6 +84,16 @@ if [ -z "$fork_master_timestamp" ]; then
fork_master_timestamp="0"
fi

build_system_directory="../.buildkite"
if [[ -d "${build_system_directory}/.git" ]]; 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 or is not a Git repo: ${build_system_directory}" >&2
build_system_commit=""
build_system_commit_short=""
fi

echo "const GIT_VERSION_INFO = GitVersionInfo("
echo " \"$commit\","
echo " \"$commit_short\","
Expand All @@ -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 ")"

0 comments on commit a21cc80

Please sign in to comment.