mirror of
https://github.com/signalapp/libsignal.git
synced 2024-09-19 19:42:19 +02:00
node: Upload dump_syms output to releases instead of raw debug info
This commit is contained in:
parent
8ba0f2731c
commit
d0b1821888
4
.github/workflows/npm.yml
vendored
4
.github/workflows/npm.yml
vendored
@ -67,6 +67,8 @@ jobs:
|
|||||||
- run: brew install protobuf
|
- run: brew install protobuf
|
||||||
if: startsWith(matrix.os, 'macos')
|
if: startsWith(matrix.os, 'macos')
|
||||||
|
|
||||||
|
- run: cargo +stable install dump_syms --no-default-features --features cli
|
||||||
|
|
||||||
- name: Get Node version from .nvmrc
|
- name: Get Node version from .nvmrc
|
||||||
id: get-nvm-version
|
id: get-nvm-version
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -134,7 +136,7 @@ jobs:
|
|||||||
- name: Upload debug info
|
- name: Upload debug info
|
||||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
||||||
with:
|
with:
|
||||||
name: Debug info (${{matrix.os}})
|
name: Debug info (ubuntu-docker)
|
||||||
path: |
|
path: |
|
||||||
node/*-debuginfo.*
|
node/*-debuginfo.*
|
||||||
!node/*.sha256
|
!node/*.sha256
|
||||||
|
@ -57,4 +57,6 @@ USER root
|
|||||||
RUN apt-get install -y clang cmake crossbuild-essential-arm64 git python3 protobuf-compiler
|
RUN apt-get install -y clang cmake crossbuild-essential-arm64 git python3 protobuf-compiler
|
||||||
USER libsignal
|
USER libsignal
|
||||||
|
|
||||||
|
RUN cargo install dump_syms --no-default-features --features cli
|
||||||
|
|
||||||
CMD [ "/bin/bash" ]
|
CMD [ "/bin/bash" ]
|
||||||
|
@ -12,12 +12,16 @@ import shlex
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
|
||||||
|
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
def maybe_archive_debug_info(*, src_path: str, src_checksum_path: str, dst_path: str, dst_checksum_path: str) -> None:
|
def maybe_dump_debug_symbols(*, src_path: str, src_checksum_path: str, dst_path: str, dst_checksum_path: str) -> None:
|
||||||
|
dump_syms = shutil.which('dump_syms')
|
||||||
|
if not dump_syms:
|
||||||
|
print("note: dump_syms not installed; skipping debug info processing")
|
||||||
|
return
|
||||||
|
|
||||||
with open(src_checksum_path, 'rb') as f:
|
with open(src_checksum_path, 'rb') as f:
|
||||||
digest = hashlib.sha256()
|
digest = hashlib.sha256()
|
||||||
# Use read1 to use the file object's buffering.
|
# Use read1 to use the file object's buffering.
|
||||||
@ -35,10 +39,8 @@ def maybe_archive_debug_info(*, src_path: str, src_checksum_path: str, dst_path:
|
|||||||
with open(dst_checksum_path, 'w') as f:
|
with open(dst_checksum_path, 'w') as f:
|
||||||
f.write(checksum)
|
f.write(checksum)
|
||||||
|
|
||||||
print("Archiving %s to %s" % (src_path, dst_path))
|
print("Dumping debug symbols to %s" % dst_path)
|
||||||
with tarfile.open(dst_path, 'w:bz2') as archive:
|
subprocess.check_call([dump_syms, src_path, '-o', dst_path])
|
||||||
debug_realpath = os.path.realpath(src_path)
|
|
||||||
archive.add(debug_realpath, arcname=os.path.basename(src_path))
|
|
||||||
|
|
||||||
|
|
||||||
def main(args: Optional[List[str]] = None) -> int:
|
def main(args: Optional[List[str]] = None) -> int:
|
||||||
@ -181,7 +183,9 @@ def main(args: Optional[List[str]] = None) -> int:
|
|||||||
|
|
||||||
src_path = os.path.join(libs_in, lib_format.format('signal_node'))
|
src_path = os.path.join(libs_in, lib_format.format('signal_node'))
|
||||||
if os.access(src_path, os.R_OK):
|
if os.access(src_path, os.R_OK):
|
||||||
dst_path = os.path.join(out_dir, 'libsignal_client_%s_%s.node' % (node_os_name, node_arch))
|
dst_base = 'libsignal_client_%s_%s' % (node_os_name, node_arch)
|
||||||
|
|
||||||
|
dst_path = os.path.join(out_dir, dst_base + '.node')
|
||||||
print("Copying %s to %s" % (src_path, dst_path))
|
print("Copying %s to %s" % (src_path, dst_path))
|
||||||
if not os.path.exists(out_dir):
|
if not os.path.exists(out_dir):
|
||||||
os.makedirs(out_dir)
|
os.makedirs(out_dir)
|
||||||
@ -190,15 +194,11 @@ def main(args: Optional[List[str]] = None) -> int:
|
|||||||
else:
|
else:
|
||||||
shutil.copyfile(src_path, dst_path)
|
shutil.copyfile(src_path, dst_path)
|
||||||
|
|
||||||
debug_dst_path = os.path.join(
|
maybe_dump_debug_symbols(
|
||||||
out_dir,
|
|
||||||
'libsignal_client_%s_%s-debuginfo.tar.bz2' % (node_os_name, node_arch))
|
|
||||||
|
|
||||||
maybe_archive_debug_info(
|
|
||||||
src_path=os.path.join(libs_in, debug_format.format('signal_node')),
|
src_path=os.path.join(libs_in, debug_format.format('signal_node')),
|
||||||
src_checksum_path=os.path.join(libs_in, debug_format_for_checksum.format('signal_node')),
|
src_checksum_path=os.path.join(libs_in, debug_format_for_checksum.format('signal_node')),
|
||||||
dst_path=debug_dst_path,
|
dst_path=os.path.join(out_dir, dst_base + '-debuginfo.sym'),
|
||||||
dst_checksum_path=debug_dst_path + '.sha256'
|
dst_checksum_path=os.path.join(out_dir, dst_base + '-debuginfo.sha256'),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print("ERROR: did not find generated library")
|
print("ERROR: did not find generated library")
|
||||||
|
Loading…
Reference in New Issue
Block a user