Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions dev/release/utils-create-release-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,26 @@ rm -rf ${root_folder}.tmp
# * https://github.com/apache/arrow/pull/4488
#
# We need to set constant timestamp for a dummy .git/ directory for
# Reproducible Builds. We use mtime of csharp/ for it. If
# SOURCE_DATE_EPOCH is defined, this mtime is overwritten when tar
# file is created.
if stat --help > /dev/null 2>&1; then
# GNU stat
#
# touch accepts YYYYMMDDhhmm.ss format but GNU stat doesn't support
# for outputting with the format. So we use date for it.
csharp_mtime=$(date --date="$(stat --format="%y" csharp)" +%Y%m%d%H%M.%S)
else
# BSD stat
csharp_mtime=$(stat -f %Sm -t %Y%m%d%H%M.%S csharp)
fi
# Reproducible Builds. We use committer date of the target commit hash
# for it. If SOURCE_DATE_EPOCH is defined, this mtime is overwritten
# when tar file is created.
csharp_mtime=$(TZ=UTC \
git \
-C "${SOURCE_TOP_DIR}" \
log \
--format=%cd \
--date=format:%Y%m%d%H%M.%S \
-n1 \
"${release_hash}")
dummy_git=${root_folder}/csharp/dummy.git
mkdir ${dummy_git}
pushd ${dummy_git}
echo ${release_hash} > HEAD
echo "[remote \"origin\"] url = https://github.com/${GITHUB_REPOSITORY:-apache/arrow}.git" >> config
mkdir objects refs
find . -exec touch -t "${csharp_mtime}" '{}' ';'
TZ=UTC find . -exec touch -t "${csharp_mtime}" '{}' ';'
popd
touch -t "${csharp_mtime}" ${root_folder}/csharp
TZ=UTC touch -t "${csharp_mtime}" ${root_folder}/csharp

# Create new tarball from modified source directory.
#
Expand Down
2 changes: 1 addition & 1 deletion dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ ensure_source_directory() {
fetch_archive ${dist_name}
git clone https://github.com/${GITHUB_REPOSITORY}.git arrow
pushd arrow
dev/release/utils-create-release-tarball.sh ${VERSION} ${RC_NUMBER}
"${SOURCE_DIR}/utils-create-release-tarball.sh" ${VERSION} ${RC_NUMBER}
if ! cmp ${dist_name}.tar.gz ../${dist_name}.tar.gz; then
echo "Source archive isn't reproducible"
return 1
Expand Down