[PATCH] D121972: Add cmake/ to release tarballs via concatenation
Konrad Wilhelm Kleine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 18 06:39:52 PDT 2022
kwk requested changes to this revision.
kwk added a comment.
This revision now requires changes to proceed.
In D121972#3391268 <https://reviews.llvm.org/D121972#3391268>, @tstellar wrote:
> Would it be easier just to package the cmake directory in a separate tarball?
IMHO it would be simpler, yes. But this patch looks good for now and it fixes the issue of potentially bundling the wrong version of the cmake directory. I've tested this patch and fixed a small issue:
commit f61e4194da963adf618e9ddfc319e2938ab0c958 (HEAD -> arcpatch-D121972)
Author: Konrad Kleine <kkleine at redhat.com>
Date: Fri Mar 18 14:33:54 2022 +0100
Properly delete temporary files with trap
I didn't notice before but deleting multiple files by calling a bash
`trap` on the same signal (`EXIT`) will actually override the previous
`trap` handler, thus leading to left-overs.
diff --git a/llvm/utils/release/export.sh b/llvm/utils/release/export.sh
index a3586dec782a..bd4fc8a59bd1 100755
--- a/llvm/utils/release/export.sh
+++ b/llvm/utils/release/export.sh
@@ -130,14 +130,15 @@ export_sources() {
# Package up top-level cmake directory so that we can append it to all projects.
cmake_archive_file=$target_dir/$(template_file cmake)
- trap "rm -fv $cmake_archive_file.tmp" EXIT
+ trap_files_to_delete="$cmake_archive_file.tmp"
+ trap 'rm -fv $trap_files_to_delete' EXIT
git archive -o $cmake_archive_file.tmp $tree_id cmake/
for proj in $projects; do
echo "Creating tarball for $proj ..."
pushd $llvm_src_dir/$proj
target_archive_file=$target_dir/$(template_file $proj)
- trap "rm -fv $target_archive_file.tmp" EXIT
+ trap_files_to_delete="$trap_files_to_delete $target_archive_file.tmp"
git archive --prefix=$proj-$release$rc.src/ -o $target_archive_file.tmp $tree_id .
tar -Af $target_archive_file.tmp $cmake_archive_file.tmp
cat $target_archive_file.tmp | xz > $target_archive_file
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121972/new/
https://reviews.llvm.org/D121972
More information about the llvm-commits
mailing list