Skip to content

Commit 5c69895

Browse files
sgilmore10raulcd
authored andcommitted
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)
### Rationale for this change `dev/release/util-create-release-tarball.sh` should not include the release candidate number in the name of the tarball's top-level directory. If the release candidate number is included, the binaries and the release verification tasks fail because the tarball entries have an unexpected folder hierarchy. See #43188 (comment). ### What changes are included in this PR? 1. Modified `dev/release/util-create-release-tarball.sh` to not include the release candidate number in the name of the source directory from which the release tarball is created. ### Are these changes tested? Manually verified this change fixes the bug: ```bash $ dev/release/utils-create-release-tarball.sh 17.0.0 1 $ tar zxvf apache-arrow-17.0.0.tar.gz ... $ ls apache-arrow-17.0.0/ apache-arrow-17.0.0.tar.gz ``` ### Are there any user-facing changes? No * GitHub Issue: #43199 Authored-by: Sarah Gilmore <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 12be569 commit 5c69895

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

dev/release/02-source-test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SourceTest < Test::Unit::TestCase
2222
def setup
2323
@current_commit = git_current_commit
2424
detect_versions
25-
@tag_name = "apache-arrow-#{@release_version}-rc0"
25+
@tag_name_no_rc = "apache-arrow-#{@release_version}"
2626
@archive_name = "apache-arrow-#{@release_version}.tar.gz"
2727
@script = File.expand_path("dev/release/02-source.sh")
2828
@tarball_script = File.expand_path("dev/release/utils-create-release-tarball.sh")
@@ -50,15 +50,15 @@ def source(*targets)
5050

5151
def test_symbolic_links
5252
source
53-
Dir.chdir(@tag_name) do
53+
Dir.chdir(@tag_name_no_rc) do
5454
assert_equal([],
5555
Find.find(".").find_all {|path| File.symlink?(path)})
5656
end
5757
end
5858

5959
def test_csharp_git_commit_information
6060
source
61-
Dir.chdir("#{@tag_name}/csharp") do
61+
Dir.chdir("#{@tag_name_no_rc}/csharp") do
6262
FileUtils.mv("dummy.git", "../.git")
6363
sh("dotnet", "pack", "-c", "Release")
6464
FileUtils.mv("../.git", "dummy.git")
@@ -83,7 +83,7 @@ def test_csharp_git_commit_information
8383

8484
def test_python_version
8585
source
86-
Dir.chdir("#{@tag_name}/python") do
86+
Dir.chdir("#{@tag_name_no_rc}/python") do
8787
sh("python3", "setup.py", "sdist")
8888
if on_release_branch?
8989
pyarrow_source_archive = "dist/pyarrow-#{@release_version}.tar.gz"

dev/release/utils-create-release-tarball.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,27 @@ version=$1
3030
rc=$2
3131

3232
tag=apache-arrow-${version}-rc${rc}
33+
root_folder=apache-arrow-${version}
3334
tarball=apache-arrow-${version}.tar.gz
3435

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

37-
rm -rf ${tag}
38+
rm -rf ${root_folder}
3839

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

4546
# Resolve symbolic and hard links
46-
rm -rf ${tag}.tmp
47-
mv ${tag} ${tag}.tmp
48-
cp -R -L ${tag}.tmp ${tag}
49-
rm -rf ${tag}.tmp
47+
rm -rf ${root_folder}.tmp
48+
mv ${root_folder} ${root_folder}.tmp
49+
cp -R -L ${root_folder}.tmp ${root_folder}
50+
rm -rf ${root_folder}.tmp
5051

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

6061
# Create new tarball from modified source directory
61-
tar czf ${tarball} ${tag}
62-
rm -rf ${tag}
62+
tar czf ${tarball} ${root_folder}
63+
rm -rf ${root_folder}

0 commit comments

Comments
 (0)