File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ inputs:
6868 description : The cargo profile to build. This defaults to the release profile.
6969 required : false
7070 default : ' release'
71+ split_debuginfo :
72+ description : Split debuginfos off of the production binary using objcopy before stripping.
73+ required : false
74+ default : ' false'
7175
7276# TODO: allow kebab-case input option names?
7377# Note:
9599 INPUT_TOKEN : ${{ inputs.token }}
96100 INPUT_REF : ${{ inputs.ref }}
97101 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
4747 bail " invalid input 'zip': ${INPUT_ZIP} "
4848fi
4949
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+
5057leading_dir=" ${INPUT_LEADING_DIR:- } "
5158case " ${leading_dir} " in
5259 true) leading_dir=" 1" ;;
@@ -245,6 +252,11 @@ build() {
245252do_strip () {
246253 target_dir=" $1 "
247254 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
248260 for bin_exe in " ${bins[@]} " ; do
249261 x " ${strip} " " ${target_dir} /${bin_exe} "
250262 done
You can’t perform that action at this time.
0 commit comments