[llvm-branch-commits] [llvm] 1e3d5cc - Add cmake to source release tarballs

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 4 23:44:25 PST 2022


Author: Konrad Kleine
Date: 2022-03-04T23:43:45-08:00
New Revision: 1e3d5ccab6b616baa91448462951b43f28bd5601

URL: https://github.com/llvm/llvm-project/commit/1e3d5ccab6b616baa91448462951b43f28bd5601
DIFF: https://github.com/llvm/llvm-project/commit/1e3d5ccab6b616baa91448462951b43f28bd5601.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-branch-commits mailing list