Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
dev: use objcopy to generate split debug symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Feb 16, 2024
1 parent fe3cf6e commit c653665
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ jobs:
with:
name: typst_preview-${{ env.target }}.pdb
path: target/${{ matrix.rust-target }}/release/typst_preview.pdb
- name: Split debug symbols for linux
if: matrix.platform == 'linux'
run: |
objcopy --compress-debug-sections --only-keep-debug "target/${{ matrix.rust-target }}/release/typst-preview" "target/${{ matrix.rust-target }}/release/typst-preview.debug"
objcopy --strip-debug --add-gnu-debuglink="typst-preview.debug" "target/${{ matrix.rust-target }}/release/typst-preview"
- name: Upload split debug symbols for linux
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: typst-preview-${{ env.target }}.dwp
path: target/${{ matrix.rust-target }}/release/typst-preview.dwp
name: typst-preview-${{ env.target }}.debug
path: target/${{ matrix.rust-target }}/release/typst-preview.debug
compression-level: 0
- name: Package split debug symbols for mac
# note that debug symbols on mac is a symlink to the actual dSYM directory
if: matrix.platform == 'darwin'
Expand Down Expand Up @@ -168,7 +174,7 @@ jobs:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
steps:
- name: Install dependencies
run: apk add --no-cache git clang lld musl-dev nodejs npm yarn
run: apk add --no-cache git clang lld musl-dev nodejs npm yarn objcopy
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -207,11 +213,15 @@ jobs:
with:
name: typst-preview-${{ env.target }}
path: typst-preview-${{ env.target }}
- name: Split debug symbols
run: |
objcopy --compress-debug-sections --only-keep-debug "target/${{ env.RUST_TARGET }}/release/typst-preview" "target/${{ env.RUST_TARGET }}/release/typst-preview.debug"
objcopy --strip-debug --add-gnu-debuglink="typst-preview.debug" "target/${{ env.RUST_TARGET }}/release/typst-preview"
- name: Upload split debug symbols
uses: actions/upload-artifact@v4
with:
name: typst-preview-${{ env.target }}.dwp
path: target/{{ env.RUST_TARGET }}/release/typst-preview.dwp
name: typst-preview-${{ env.target }}.debug
path: target/{{ env.RUST_TARGET }}/release/typst-preview.debug

release:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@ embed-fonts = []

[profile.release]
debug = true
split-debuginfo = "packed"

0 comments on commit c653665

Please sign in to comment.