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
  • Loading branch information
DilumAluthge committed Nov 17, 2021
1 parent 65a6bca commit cf0b519
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:?}" ]]; 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\","
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 cf0b519

Please sign in to comment.