[PATCH] D121972: Add cmake/ to release tarballs via concatenation

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 17:49:06 PDT 2022


aaronpuchert created this revision.
aaronpuchert added reviewers: tstellar, kwk.
Herald added a project: All.
aaronpuchert requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The solution using append was reported not to work, but additionally it
would use the contents of the checked-out source tree instead of the git
tag or commit. This uses `git archive`, so it will use the right commit,
and at least for me (with GNU tar) it seems to work as intended.

Should fix #53281.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121972

Files:
  llvm/utils/release/export.sh


Index: llvm/utils/release/export.sh
===================================================================
--- llvm/utils/release/export.sh
+++ llvm/utils/release/export.sh
@@ -128,16 +128,18 @@
             -cJf test-suite-$release$rc.src.tar.xz test-suite-$release$rc.src
     fi
 
+    # Package up top-level cmake directory so that we can append it to all projects.
+    cmake_archive_file=$target_dir/$(template_file cmake)
+    trap "rm -fv $cmake_archive_file.tmp" EXIT
+    git archive -o $cmake_archive_file.tmp $tree_id cmake/
+
     for proj in $projects; do
         echo "Creating tarball for $proj ..."
         pushd $llvm_src_dir/$proj
         target_archive_file=$target_dir/$(template_file $proj)
         trap "rm -fv $target_archive_file.tmp" EXIT
         git archive --prefix=$proj-$release$rc.src/ -o $target_archive_file.tmp $tree_id .
-        # Get relative path to top-level cmake directory to be packaged
-        # alongside the project. Append that path to the tarball.
-        cmake_rel_path=$(realpath --relative-to=. $llvm_src_dir/cmake)
-        tar --append -f $target_archive_file.tmp $cmake_rel_path
+        tar -Af $target_archive_file.tmp $cmake_archive_file.tmp
         cat $target_archive_file.tmp | xz > $target_archive_file
         popd
     done


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121972.416365.patch
Type: text/x-patch
Size: 1292 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220318/67836789/attachment.bin>


More information about the llvm-commits mailing list