[llvm] 32a0482 - Add cmake to source release tarballs

Konrad Kleine via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 02:54:49 PST 2022


Author: Konrad Kleine
Date: 2022-02-11T11:54:44+01:00
New Revision: 32a0482a65b86cf0d84ea7e784cca9852df5c67c

URL: https://github.com/llvm/llvm-project/commit/32a0482a65b86cf0d84ea7e784cca9852df5c67c
DIFF: https://github.com/llvm/llvm-project/commit/32a0482a65b86cf0d84ea7e784cca9852df5c67c.diff

LOG: Add cmake to source release tarballs

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 and can be considered an alternative
approach for all projects to have access to the shared cmake
directory when building in standalone mode.

When generating source tarballs on my local laptop it takes 9 minutes and 45 seconds WITH this patch applied. When this patch is not applied, it takes 9minutes and 38 seconds. That means, this patch introduces a slowdown of 7 seconds, which seems fair.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D118481

Added: 
    

Modified: 
    llvm/utils/release/export.sh

Removed: 
    


################################################################################
diff  --git a/llvm/utils/release/export.sh b/llvm/utils/release/export.sh
index 3a318aee10d3d..43bb71d09bea8 100755
--- a/llvm/utils/release/export.sh
+++ b/llvm/utils/release/export.sh
@@ -131,7 +131,14 @@ export_sources() {
     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
 }


        


More information about the llvm-commits mailing list