diff options
author | Konrad Kleine <kkleine@redhat.com> | 2022-02-11 11:50:33 +0100 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2022-03-04 23:43:45 -0800 |
commit | 1e3d5ccab6b616baa91448462951b43f28bd5601 (patch) | |
tree | 17795c071bc59d546fda71bf4e6ada79394bd923 | |
parent | 0205cc086e506fe85fdc48734e9a297299160eb1 (diff) |
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
-rwxr-xr-x | llvm/utils/release/export.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/utils/release/export.sh b/llvm/utils/release/export.sh index 3a318aee10d3..43bb71d09bea 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 } |