2021-03-25 10:37:15 +03:00
|
|
|
cd src
|
2025-08-15 10:48:25 -04:00
|
|
|
# Find all core files and symlink them to src
|
|
|
|
|
# -H is used to follow hard-links, but add bazel-testlogs explicitly. This ensures we look
|
|
|
|
|
# in bazel-testlogs, but don't follow soft-links and end up with multiple copies of the same
|
|
|
|
|
# core dump from bazel-testlogs, bazel-out, etc.
|
|
|
|
|
core_files=$(/usr/bin/find -H .. bazel-testlogs \( -name "*.core" -o -name "*.mdmp" \) 2>/dev/null)
|
2021-03-25 10:37:15 +03:00
|
|
|
for core_file in $core_files; do
|
2025-07-15 18:19:08 -07:00
|
|
|
base_name=$(echo $core_file | sed "s/.*\///")
|
2025-08-15 10:48:25 -04:00
|
|
|
# Symlink file if it does not already exist
|
2025-07-15 18:19:08 -07:00
|
|
|
if [ ! -f $base_name ]; then
|
2025-08-15 10:48:25 -04:00
|
|
|
ln -sf $core_file $base_name
|
2025-07-15 18:19:08 -07:00
|
|
|
fi
|
2021-03-25 10:37:15 +03:00
|
|
|
done
|
2026-01-26 11:23:07 -08:00
|
|
|
|
|
|
|
|
# Find all gzipped core files and decompress them to src
|
|
|
|
|
gzipped_core_files=$(/usr/bin/find -H .. bazel-testlogs -name "*.core.gz" 2>/dev/null)
|
|
|
|
|
for gzipped_core_file in $gzipped_core_files; do
|
|
|
|
|
base_name=$(echo $gzipped_core_file | sed "s/.*\///" | sed "s/\.gz$//")
|
|
|
|
|
# Decompress file if it does not already exist
|
|
|
|
|
if [ ! -f $base_name ]; then
|
|
|
|
|
gunzip -c $gzipped_core_file >$base_name
|
|
|
|
|
fi
|
|
|
|
|
done
|