File tree Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Original file line number Diff line number Diff line change 3
3
set -euo pipefail
4
4
5
5
function patch_dsym() {
6
- readonly dsym_name=" $1 "
7
- readonly binary_name=" ${dsym_name%% .* } "
8
- readonly binary_path=" ${dsym_name} /Contents/Resources/DWARF/${binary_name} "
6
+ local dsym_name=" $1 "
7
+
8
+ shopt -s extglob
9
+ local binary_name=" ${dsym_name% .dSYM} "
10
+ binary_name=" ${binary_name%@ (.app|.appex|.bundle|.dext|.kext|.framework|.pluginkit|.systemextension|.xctest|.xpc)} "
11
+ shopt +s extglob
12
+
13
+ local binary_path=" ${dsym_name} /Contents/Resources/DWARF/${binary_name} "
9
14
10
15
if [[ ! -f " $binary_path " ]]; then
11
16
echo " dSYM DWARF ${binary_path} does not exist." \
12
17
" Skip dSYM patch."
13
18
return 1
14
19
fi
15
20
21
+ local dwarf_uuid
16
22
dwarf_uuid=$( dwarfdump --uuid " ${binary_path} " | cut -d ' ' -f 2)
17
- readonly dwarf_uuid
18
23
if [[ -z " ${dwarf_uuid// / } " ]]; then
19
24
echo " Failed to get dSYM uuid." \
20
25
" Skip dSYM patch."
44
49
if [[ -n " ${BAZEL_OUTPUTS_DSYM:- } " ]]; then
45
50
cd " ${BAZEL_OUT%/* } "
46
51
52
+ if [[ $( sw_vers -productVersion | cut -d ' .' -f 1-2) == " 15.4" ]]; then
53
+ # 15.4's `rsync` has a bug that requires the src to have write permissions.
54
+ # We normally shouldn't do this as it modifies the bazel output base, so we
55
+ # limit this to only macOS 15.4.
56
+ # shellcheck disable=SC2046
57
+ chmod -R +w $( xargs -n1 <<< " $BAZEL_OUTPUTS_DSYM" )
58
+ fi
59
+
47
60
# shellcheck disable=SC2046
48
61
rsync \
49
62
--copy-links \
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ if [[ "$ACTION" != indexbuild ]]; then
30
30
# rpaths to work
31
31
ln -sfh " $PWD /$BAZEL_OUTPUTS_PRODUCT_BASENAME " " $TARGET_BUILD_DIR /$PRODUCT_NAME "
32
32
else
33
+ if [[ $( sw_vers -productVersion | cut -d ' .' -f 1-2) == " 15.4" ]]; then
34
+ # 15.4's `rsync` has a bug that requires the src to have write
35
+ # permissions. We normally shouldn't do this as it modifies the bazel
36
+ # output base, so we limit this to only macOS 15.4.
37
+ chmod -R +w " $BAZEL_OUTPUTS_PRODUCT_BASENAME "
38
+ fi
39
+
33
40
# Product is a bundle
34
41
rsync \
35
42
--copy-links \
Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ dest_dir="$(dirname "${dest}")"
74
74
# Copy over `xcschemes`
75
75
readonly dest_xcschemes=" $dest /xcshareddata/xcschemes"
76
76
77
+ if [[ $( sw_vers -productVersion | cut -d ' .' -f 1-2) == " 15.4" ]]; then
78
+ # 15.4's `rsync` has a bug that requires the src to have write permissions.
79
+ # We normally shouldn't do this as it modifies the bazel output base, so we
80
+ # limit this to only macOS 15.4.
81
+ chmod -R +w " $src_xcschemes "
82
+ fi
83
+
77
84
mkdir -p " $dest_xcschemes "
78
85
rsync \
79
86
--archive \
Original file line number Diff line number Diff line change 127
127
128
128
# Sync over the project, changing the permissions to be writable
129
129
130
+ if [[ $( sw_vers -productVersion | cut -d ' .' -f 1-2) == " 15.4" ]]; then
131
+ # 15.4's `rsync` has a bug that requires the src to have write permissions.
132
+ # We normally shouldn't do this as it modifies the bazel output base, so we
133
+ # limit this to only macOS 15.4.
134
+ chmod -R +w " $src "
135
+ fi
136
+
130
137
# Don't touch project.xcworkspace as that will make Xcode prompt
131
138
rsync \
132
139
--archive \
You can’t perform that action at this time.
0 commit comments