Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-43199: [CI][Packaging] dev/release/utils-create-release-tarball.sh should not include the release candidate number in the name of the tarball's top-level directory. #43200

Merged
merged 2 commits into from
Jul 9, 2024
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
8 changes: 4 additions & 4 deletions dev/release/02-source-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SourceTest < Test::Unit::TestCase
def setup
@current_commit = git_current_commit
detect_versions
@tag_name = "apache-arrow-#{@release_version}-rc0"
@tag_name_no_rc = "apache-arrow-#{@release_version}"
@archive_name = "apache-arrow-#{@release_version}.tar.gz"
@script = File.expand_path("dev/release/02-source.sh")
@tarball_script = File.expand_path("dev/release/utils-create-release-tarball.sh")
Expand Down Expand Up @@ -50,15 +50,15 @@ def source(*targets)

def test_symbolic_links
source
Dir.chdir(@tag_name) do
Dir.chdir(@tag_name_no_rc) do
assert_equal([],
Find.find(".").find_all {|path| File.symlink?(path)})
end
end

def test_csharp_git_commit_information
source
Dir.chdir("#{@tag_name}/csharp") do
Dir.chdir("#{@tag_name_no_rc}/csharp") do
FileUtils.mv("dummy.git", "../.git")
sh("dotnet", "pack", "-c", "Release")
FileUtils.mv("../.git", "dummy.git")
Expand All @@ -83,7 +83,7 @@ def test_csharp_git_commit_information

def test_python_version
source
Dir.chdir("#{@tag_name}/python") do
Dir.chdir("#{@tag_name_no_rc}/python") do
sh("python3", "setup.py", "sdist")
if on_release_branch?
pyarrow_source_archive = "dist/pyarrow-#{@release_version}.tar.gz"
Expand Down
19 changes: 10 additions & 9 deletions dev/release/utils-create-release-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,27 @@ version=$1
rc=$2

tag=apache-arrow-${version}-rc${rc}
root_folder=apache-arrow-${version}
tarball=apache-arrow-${version}.tar.gz

: ${release_hash:=$(git rev-list --max-count=1 ${tag})}

rm -rf ${tag}
rm -rf ${root_folder}

# be conservative and use the release hash, even though git produces the same
# archive (identical hashes) using the scm tag
(cd "${SOURCE_TOP_DIR}" && \
git archive ${release_hash} --prefix ${tag}/) | \
git archive ${release_hash} --prefix ${root_folder}/) | \
tar xf -

# Resolve symbolic and hard links
rm -rf ${tag}.tmp
mv ${tag} ${tag}.tmp
cp -R -L ${tag}.tmp ${tag}
rm -rf ${tag}.tmp
rm -rf ${root_folder}.tmp
mv ${root_folder} ${root_folder}.tmp
cp -R -L ${root_folder}.tmp ${root_folder}
rm -rf ${root_folder}.tmp

# Create a dummy .git/ directory to download the source files from GitHub with Source Link in C#.
dummy_git=${tag}/csharp/dummy.git
dummy_git=${root_folder}/csharp/dummy.git
mkdir ${dummy_git}
pushd ${dummy_git}
echo ${release_hash} > HEAD
Expand All @@ -58,5 +59,5 @@ mkdir objects refs
popd

# Create new tarball from modified source directory
tar czf ${tarball} ${tag}
rm -rf ${tag}
tar czf ${tarball} ${root_folder}
rm -rf ${root_folder}
Loading