File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 3
3
lipo
4
4
mktemp
5
5
tmpdir
6
+ DEBUGINFO
7
+ debuginfo
8
+ debuginfos
9
+ objcopy
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ inputs:
68
68
description : The cargo profile to build. This defaults to the release profile.
69
69
required : false
70
70
default : ' release'
71
+ split_debuginfo :
72
+ description : Split debuginfos off of the production binary using objcopy before stripping.
73
+ required : false
74
+ default : ' false'
71
75
72
76
# TODO: allow kebab-case input option names?
73
77
# Note:
95
99
INPUT_TOKEN : ${{ inputs.token }}
96
100
INPUT_REF : ${{ inputs.ref }}
97
101
INPUT_PROFILE : ${{ inputs.profile }}
102
+ INPUT_SPLIT_DEBUGINFO : ${{ inputs.split_debuginfo }}
Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ elif [[ ! "${INPUT_ZIP}" =~ ^(all|unix|windows|none)$ ]]; then
47
47
bail " invalid input 'zip': ${INPUT_ZIP} "
48
48
fi
49
49
50
+ split_debuginfo=" ${INPUT_SPLIT_DEBUGINFO:- } "
51
+ case " ${split_debuginfo} " in
52
+ true) split_debuginfo=" 1" ;;
53
+ false) split_debuginfo=" " ;;
54
+ * ) bail " 'split_debuginfo' input option must be 'true' or 'false': '${split_debuginfo} '" ;;
55
+ esac
56
+
50
57
leading_dir=" ${INPUT_LEADING_DIR:- } "
51
58
case " ${leading_dir} " in
52
59
true) leading_dir=" 1" ;;
@@ -245,6 +252,11 @@ build() {
245
252
do_strip () {
246
253
target_dir=" $1 "
247
254
if [[ -n " ${strip:- } " ]]; then
255
+ if [[ -n " ${split_debuginfo} " ]]; then
256
+ for bin_exe in " ${bins[@]} " ; do
257
+ x objcopy --only-keep-debug " ${target_dir} /${bin_exe} " " ${target_dir} /${bin_exe} .debug"
258
+ done
259
+ fi
248
260
for bin_exe in " ${bins[@]} " ; do
249
261
x " ${strip} " " ${target_dir} /${bin_exe} "
250
262
done
You can’t perform that action at this time.
0 commit comments