Skip to content

Commit a62ca4d

Browse files
committed
Fix mis-bundling with tar
Also, increase lower limit in tests, now that I realize that I had bad corefiles
1 parent d134f1a commit a62ca4d

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

.buildkite/pipeline.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,23 +227,23 @@ steps:
227227
228228
echo "+++ Run coredump checks"
229229
230-
# Ensure that all files are above 5k (e.g. not empty tar/zstd streams)
230+
# Ensure that all files are above 20k (e.g. not empty tar/zstd streams)
231231
for f in *.core*; do
232-
echo -n "Check that $${f} is > 5kb: "
233-
(( "$$(stat -c%s "$${f}")" > 5120 ))
232+
echo -n "Check that $${f} is > 20kb: "
233+
(( "$$(stat -c%s "$${f}")" > 20480 ))
234234
echo "✔️"
235235
done
236236
237-
echo -n "Seven corefiles overall: "
238-
[[ "$$(ls *.core* | wc -l)" == "7" ]]
237+
echo -n "Eight corefiles overall: "
238+
[[ "$$(ls *.core* | wc -l)" == "8" ]]
239239
echo "✔️"
240240
241241
echo -n "Three zstd julia corefiles: "
242242
[[ "$$(ls julia-*.core.zst | wc -l)" == "3" ]]
243243
echo "✔️"
244244
245-
echo -n "One raw bash corefile: "
246-
[[ "$$(ls bash-*.core | wc -l)" == "1" ]]
245+
echo -n "Two raw bash corefile: "
246+
[[ "$$(ls bash-*.core | wc -l)" == "2" ]]
247247
echo "✔️"
248248
249249
echo -n "One raw bash bundled bash corefile: "

lib/compression.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,20 @@ function compressed_bundle_names() {
2626

2727
function compress_bundle() {
2828
local COREFILE="${1}"
29+
local BUNDLE_NAME="$(compressed_bundle_names "${COREFILE}")"
30+
31+
# Skip out early if we're not doing anything
32+
if [[ "${COREFILE}" == "${BUNDLE_NAME}" ]]; then
33+
return
34+
fi
2935

30-
# We are going to use `tar` to bundle together one or more files:
31-
declare -a FILE_LIST
3236
if [[ "${CREATE_BUNDLE}" == "true" ]]; then
37+
# Pass the file list off to `tar` and compress it
38+
declare -a FILE_LIST
3339
readarray -t FILE_LIST < <(collect_bundle_files "${COREFILE}")
40+
tar hc "${FILE_LIST[@]}" | compress > "${BUNDLE_NAME}"
3441
else
35-
FILE_LIST=( "${COREFILE}" )
42+
# Compress the file directly
43+
compress <"${COREFILE}" >"${BUNDLE_NAME}"
3644
fi
37-
38-
# Pass the file list off to `tar` and compress it
39-
tar hc "${FILE_LIST[@]}" | compress > "$(compressed_bundle_names "${COREFILE}")"
4045
}

0 commit comments

Comments
 (0)