Follow BugSplat convention for naming sym files.

BugSplat's Breakpad processor is very particular about upload conventions. To resolve this issue modify sym file such that the file name is Valentina.sym and the module name (first line of the sym file) as Valentina.
This commit is contained in:
Roman Telezhynskyi 2024-05-09 11:23:05 +03:00
parent f7f981b910
commit 79e1bf0f8d

View File

@ -6,6 +6,7 @@ import glob
import zipfile import zipfile
import requests import requests
import shutil import shutil
import re
database = "valentina" database = "valentina"
@ -35,12 +36,34 @@ def generate_sym_files(install_root):
print("No debug files found.") print("No debug files found.")
for debug_file in debug_files: for debug_file in debug_files:
print(f"Generating symbols for: {os.path.basename(debug_file)}") corrected_debug_name = os.path.basename(debug_file)
debug_dir = os.path.dirname(debug_file)
sym_file = os.path.splitext(debug_file)[0] + ".sym" if sys.platform == "darwin":
dump_syms_cmd = ["dump_syms", '-o', sym_file, '--inlines', debug_file] # Remove ".app" if present
corrected_debug_name = corrected_debug_name.replace(".app", "")
# Remove ".framework" if present
corrected_debug_name = corrected_debug_name.replace(".framework", "")
elif platform == "linux":
# Remove .so + version numbers if present (e.g., .so.1.0.0 or .so.2.7.0)
corrected_debug_name = re.sub(r'\.so\.\d+(\.\d+)*', '', corrected_debug_name)
# Convert to lowercase
corrected_debug_name = corrected_debug_name.lower()
print(f"Generating symbols for: {corrected_debug_name}")
# Copy debug file with corrected name
corrected_debug_path = os.path.join(debug_dir, corrected_debug_name)
shutil.copy(debug_file, corrected_debug_path)
sym_file = os.path.splitext(corrected_debug_name)[0] + ".sym"
dump_syms_cmd = ["dump_syms", '-o', sym_file, '--inlines', corrected_debug_path]
subprocess.run(dump_syms_cmd, check=True) subprocess.run(dump_syms_cmd, check=True)
# Remove temporary debug file
os.remove(corrected_debug_path)
sym_files.append((debug_file, sym_file)) sym_files.append((debug_file, sym_file))
return sym_files return sym_files