Skip to content

Commit 4694a61

Browse files
Option to export Android Breakpad symbols (#26)
1 parent 326e6a3 commit 4694a61

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
build-config: RelWithDebInfo
4646
export-pdb: true
4747
bundle-pdb: true
48+
export-symbols: true
4849
path: textureldr
4950
combine: true
5051
target: ${{ matrix.config.target }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ https://github.com/geode-sdk/build-geode-mod/tree/main/examples
3838
# Default: false
3939
bundle-pdb: ''
4040

41+
# Whether to export Breakpad symbols for Android builds. Not required.
42+
# Default: false
43+
export-symbols: ''
44+
4145
# Path to the project which to build. Defaults to current directory.
4246
path: ''
4347

action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ inputs:
6666
description: Whether to bundle PDB files into the .geode package. Requires SDK v4.2.0 and CLI v3.3.0 at minimum. Defaults to false
6767
required: false
6868
default: false
69+
export-symbols:
70+
description: Whether to export Breakpad symbols for Android builds. Defaults to false
71+
required: false
72+
default: false
6973

7074
outputs:
7175
build-output:
@@ -156,6 +160,15 @@ runs:
156160
curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-${{ steps.platform.outputs.id }}.zip -o ninja.zip
157161
7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja"
158162
echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH
163+
164+
- name: Install dump_syms
165+
if: inputs.export-symbols == 'true' && steps.platform.outputs.id == 'linux' && (steps.platform.outputs.target_id == 'android32' || steps.platform.outputs.target_id == 'android64')
166+
shell: bash
167+
run: |
168+
curl -L https://github.com/mozilla/dump_syms/releases/latest/download/dump_syms-x86_64-unknown-linux-gnu.tar.xz -o dump_syms.tar.xz
169+
xz -d dump_syms.tar.xz
170+
tar -xf dump_syms.tar
171+
echo "$GITHUB_WORKSPACE/dump_syms-x86_64-unknown-linux-gnu" >> $GITHUB_PATH
159172
160173
# - name: Fix Ubuntu weirdness
161174
# shell: bash
@@ -265,6 +278,14 @@ runs:
265278
266279
for file in $(find ./build -name *.geode); do
267280
cp $file "${{ github.workspace }}/output"
281+
if [ ${{ steps.platform.outputs.id }} = "linux" ] && [ "${{ inputs.export-symbols }}" = "true" ]; then
282+
if [ ${{ steps.platform.outputs.target_id }} = "android32" ] || [ ${{ steps.platform.outputs.target_id }} = "android64" ]; then
283+
SO_FILE_NAME="$(basename $file .geode).${{ steps.platform.outputs.target_id }}.so"
284+
if [ -f "./build/$SO_FILE_NAME" ]; then
285+
dump_syms ./build/$SO_FILE_NAME -o "${{ github.workspace }}/output/$SO_FILE_NAME.sym"
286+
fi
287+
fi
288+
fi
268289
done
269290
270291
if [ ${{ steps.platform.outputs.id }} = "win" ]; then
@@ -293,3 +314,4 @@ runs:
293314
path: |
294315
${{ steps.build.outputs.output }}/*.geode
295316
${{ steps.build.outputs.output }}/*.pdb
317+
${{ steps.build.outputs.output }}/*.sym

combine/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ runs:
7474
done
7575
# Copy the .pdb file from windows artifact if it exists
7676
cp ./artifacts/geode-build-win/*.pdb out/ || true
77+
# Copy the .sym files from android artifacts if they exist
78+
cp ./artifacts/geode-build-android32/*.sym out/ || true
79+
cp ./artifacts/geode-build-android64/*.sym out/ || true
7780
echo "output=$(realpath out)" >> $GITHUB_OUTPUT
7881
7982
- uses: geekyeggo/delete-artifact@v5

0 commit comments

Comments
 (0)