[PATCH] D118481: Add cmake to source release tarballs

Konrad Wilhelm Kleine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 08:31:15 PST 2022


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

I've split the git archive generation into three steps:

1. generate pure tarball
2. append top-level cmake directory to all tarballs
3. compress the archive

This was inspired by D118252 <https://reviews.llvm.org/D118252> and can be considered an alternative
approach for all projects to have access to the shared cmake
directory when building in standalone mode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118481

Files:
  llvm/utils/release/export.sh


Index: llvm/utils/release/export.sh
===================================================================
--- llvm/utils/release/export.sh
+++ llvm/utils/release/export.sh
@@ -131,7 +131,14 @@
     for proj in $projects; do
         echo "Creating tarball for $proj ..."
         pushd $llvm_src_dir/$proj
-        git archive --prefix=$proj-$release$rc.src/ $tree_id . | xz >$target_dir/$(template_file $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
+        cat $target_archive_file.tmp | xz > $target_archive_file
         popd
     done
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118481.404041.patch
Type: text/x-patch
Size: 989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220128/d3fbf953/attachment.bin>


More information about the llvm-commits mailing list