... |
... |
@@ -51,23 +51,40 @@ variables: |
51
|
51
|
|
52
|
52
|
--remove-section=.comment --remove-section=.note --strip-unneeded
|
53
|
53
|
|
|
54
|
+ # Causes strip-binaries to fail on error if set to true
|
|
55
|
+ fatal-strip: "false"
|
|
56
|
+
|
54
|
57
|
# Generic implementation for stripping debugging symbols
|
55
|
58
|
strip-binaries: |
|
56
|
|
-
|
57
|
|
- cd "%{install-root}" && find -type f \
|
58
|
|
- '(' -perm -111 -o -name '*.so*' \
|
59
|
|
- -o -name '*.cmxs' -o -name '*.node' ')' \
|
60
|
|
- -exec sh -ec \
|
61
|
|
- 'read -n4 hdr <"$1" # check for elf header
|
62
|
|
- if [ "$hdr" != "$(printf \\x7fELF)" ]; then
|
63
|
|
- exit 0
|
64
|
|
- fi
|
65
|
|
- debugfile="%{install-root}%{debugdir}/$1"
|
66
|
|
- mkdir -p "$(dirname "$debugfile")"
|
67
|
|
- objcopy %{objcopy-extract-args} "$1" "$debugfile"
|
68
|
|
- chmod 644 "$debugfile"
|
69
|
|
- strip %{strip-args} "$1"
|
70
|
|
- objcopy %{objcopy-link-args} "$debugfile" "$1"' - {} ';'
|
|
59
|
+ find "%{install-root}" -type f \
|
|
60
|
+ '(' -perm -111 -o -name '*.so*' \
|
|
61
|
+ -o -name '*.cmxs' -o -name '*.node' ')' \
|
|
62
|
+ -print0 | while read -r -d $'\0' file; do
|
|
63
|
+ read -n4 hdr <"${file}" || continue # check for elf header
|
|
64
|
+ if [ "$hdr" != "$(printf \\x7fELF)" ]; then
|
|
65
|
+ continue
|
|
66
|
+ fi
|
|
67
|
+ if objdump -j .gnu_debuglink -s "${file}" &>/dev/null; then
|
|
68
|
+ continue
|
|
69
|
+ fi
|
|
70
|
+ case "${file}" in
|
|
71
|
+ "%{install-root}%{debugdir}/"*)
|
|
72
|
+ continue
|
|
73
|
+ ;;
|
|
74
|
+ *)
|
|
75
|
+ ;;
|
|
76
|
+ esac
|
|
77
|
+ realpath="$(realpath -s --relative-to="%{install-root}" "${file}")"
|
|
78
|
+ debugfile="%{install-root}%{debugdir}/${realpath}.debug"
|
|
79
|
+ mkdir -p "$(dirname "$debugfile")"
|
|
80
|
+ objcopy %{objcopy-extract-args} "${file}" "$debugfile"
|
|
81
|
+ chmod 644 "$debugfile"
|
|
82
|
+ mode="$(stat -c 0%a "${file}")"
|
|
83
|
+ [ -w "${file}" ] || chmod +w "${file}"
|
|
84
|
+ strip %{strip-args} "${file}" || %{fatal-strip}
|
|
85
|
+ objcopy %{objcopy-link-args} "$debugfile" "${file}"
|
|
86
|
+ chmod "${mode}" "${file}"
|
|
87
|
+ done
|
71
|
88
|
|
72
|
89
|
# Generic implementation for reproducible python builds
|
73
|
90
|
fix-pyc-timestamps: |
|
... |
... |
@@ -191,4 +208,4 @@ shell: |
191
|
208
|
command: [ 'sh', '-i' ]
|
192
|
209
|
|
193
|
210
|
remote-execution:
|
194
|
|
- url: ""
|
|
|
\ No newline at end of file |
|
211
|
+ url: ""
|