forked from OSchip/llvm-project
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
This commit is contained in:
parent
9ece72c159
commit
32a0482a65
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue