Fix script/symbolicate for Linux panic reports (#33822)

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-07-02 21:04:27 -04:00 committed by GitHub
parent 32d058d95e
commit def8bab5a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -164,7 +164,7 @@ fn init_panic_hook() {
}), }),
app_version: format!("remote-server-{version}"), app_version: format!("remote-server-{version}"),
app_commit_sha: option_env!("ZED_COMMIT_SHA").map(|sha| sha.into()), app_commit_sha: option_env!("ZED_COMMIT_SHA").map(|sha| sha.into()),
release_channel: release_channel.display_name().into(), release_channel: release_channel.dev_name().into(),
target: env!("TARGET").to_owned().into(), target: env!("TARGET").to_owned().into(),
os_name: telemetry::os_name(), os_name: telemetry::os_name(),
os_version: Some(telemetry::os_version()), os_version: Some(telemetry::os_version()),

View file

@ -11,24 +11,29 @@ fi
input_file=$1; input_file=$1;
if [[ "$input_file" == *.json ]]; then if [[ "$input_file" == *.json ]]; then
version=$(cat $input_file | jq -r .app_version) version=$(cat $input_file | jq -r .panic.app_version)
channel=$(cat $input_file | jq -r .release_channel) channel=$(cat $input_file | jq -r .panic.release_channel)
target_triple=$(cat $input_file | jq -r .target) target_triple=$(cat $input_file | jq -r .panic.target)
which llvm-symbolizer rustfilt >dev/null || echo Need to install llvm-symbolizer and rustfilt which llvm-symbolizer rustfilt >/dev/null || (echo Need to install llvm-symbolizer and rustfilt && exit 1)
echo $channel; echo $channel;
mkdir -p target/dsyms/$channel mkdir -p target/dsyms/$channel
if [[ "$version" == "remote-server-"* ]]; then
version="${version#remote-server-}"
dsym="$channel/remote_server-$version-$target_triple.dbg"
else
dsym="$channel/zed-$version-$target_triple.dbg" dsym="$channel/zed-$version-$target_triple.dbg"
fi
if [[ ! -f target/dsyms/$dsym ]]; then if [[ ! -f target/dsyms/$dsym ]]; then
echo "Downloading $dsym..." echo "Downloading $dsym..."
curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$dsym.gz" curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$dsym.gz"
gunzip target/dsyms/$dsym.gz gunzip target/dsyms/$dsym.gz
fi fi
cat $input_file | jq -r .backtrace[] | sed s'/.*+//' | llvm-symbolizer --no-demangle --obj=target/dsyms/$dsym | rustfilt cat $input_file | jq -r .panic.backtrace[] | sed s'/.*+//' | llvm-symbolizer --no-demangle --obj=target/dsyms/$dsym | rustfilt
else # ips file else # ips file