Skip to content

Commit a21cc80

Browse files
authored
Base.GIT_VERSION_INFO: record the Buildkite commit that was used to build Julia (#43073)
1 parent a0c920c commit a21cc80

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

base/version_git.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ echo " date_string::String"
1313
echo " tagged_commit::Bool"
1414
echo " fork_master_distance::Int"
1515
echo " fork_master_timestamp::Float64"
16+
echo " build_system_commit::String"
17+
echo " build_system_commit_short::String"
1618
echo "end"
1719
echo ""
1820

@@ -82,6 +84,16 @@ if [ -z "$fork_master_timestamp" ]; then
8284
fork_master_timestamp="0"
8385
fi
8486

87+
build_system_directory="../.buildkite"
88+
if [[ -d "${build_system_directory}/.git" ]]; then
89+
build_system_commit=$(git -C "${build_system_directory}" rev-parse HEAD)
90+
build_system_commit_short=$(git -C "${build_system_directory}" rev-parse --short HEAD)
91+
else
92+
echo "Warning: The build system directory does not exist or is not a Git repo: ${build_system_directory}" >&2
93+
build_system_commit=""
94+
build_system_commit_short=""
95+
fi
96+
8597
echo "const GIT_VERSION_INFO = GitVersionInfo("
8698
echo " \"$commit\","
8799
echo " \"$commit_short\","
@@ -90,5 +102,7 @@ echo " $build_number,"
90102
echo " \"$date_string\","
91103
echo " $tagged_commit,"
92104
echo " $fork_master_distance,"
93-
echo " $fork_master_timestamp."
105+
echo " $fork_master_timestamp.,"
106+
echo " \"$build_system_commit\","
107+
echo " \"$build_system_commit_short\","
94108
echo ")"

0 commit comments

Comments
 (0)