Skip to content

Commit 4f1d34b

Browse files
Use --perms with rsync (#3175)
This should fix writable permissions issues on all versions of macOS that we support. Signed-off-by: Brentley Jones <[email protected]>
1 parent 9c117ee commit 4f1d34b

File tree

4 files changed

+4
-29
lines changed

4 files changed

+4
-29
lines changed

xcodeproj/internal/bazel_integration_files/copy_dsyms.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ EOF
4949
if [[ -n "${BAZEL_OUTPUTS_DSYM:-}" ]]; then
5050
cd "${BAZEL_OUT%/*}"
5151

52-
if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
53-
# 15.4.0's `rsync` has a bug that requires the src to have write
54-
# permissions. We normally shouldn't do this as it modifies the bazel output
55-
# base, so we limit this to only macOS 15.4.0.
56-
# shellcheck disable=SC2046
57-
chmod -R +w $(xargs -n1 <<< "$BAZEL_OUTPUTS_DSYM")
58-
fi
59-
6052
# shellcheck disable=SC2046
6153
rsync \
6254
--copy-links \
@@ -65,6 +57,7 @@ if [[ -n "${BAZEL_OUTPUTS_DSYM:-}" ]]; then
6557
--archive \
6658
--delete \
6759
${exclude_list:+--exclude-from="$exclude_list"} \
60+
--perms \
6861
--chmod=u+w \
6962
--out-format="%n%L" \
7063
$(xargs -n1 <<< "$BAZEL_OUTPUTS_DSYM") \

xcodeproj/internal/bazel_integration_files/copy_outputs.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,14 @@ if [[ "$ACTION" != indexbuild ]]; then
3030
# rpaths to work
3131
ln -sfh "$PWD/$BAZEL_OUTPUTS_PRODUCT_BASENAME" "$TARGET_BUILD_DIR/$PRODUCT_NAME"
3232
else
33-
if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
34-
# 15.4.0'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.0.
37-
chmod -R +w "$BAZEL_OUTPUTS_PRODUCT_BASENAME"
38-
fi
39-
4033
# Product is a bundle
4134
rsync \
4235
--copy-links \
4336
--recursive \
4437
--times \
4538
--delete \
4639
${exclude_list:+--exclude-from="$exclude_list"} \
40+
--perms \
4741
--chmod=u+w \
4842
--out-format="%n%L" \
4943
"$BAZEL_OUTPUTS_PRODUCT_BASENAME" \

xcodeproj/internal/templates/incremental_installer.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,10 @@ dest_dir="$(dirname "${dest}")"
7474
# Copy over `xcschemes`
7575
readonly dest_xcschemes="$dest/xcshareddata/xcschemes"
7676

77-
if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
78-
# 15.4.0'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.0.
81-
chmod -R +w "$src_xcschemes"
82-
fi
83-
8477
mkdir -p "$dest_xcschemes"
8578
rsync \
8679
--archive \
80+
--perms \
8781
--chmod=u+w,F-x \
8882
--delete \
8983
"$src_xcschemes" "$dest_xcschemes/"

xcodeproj/internal/templates/legacy_installer.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,11 @@ fi
136136

137137
# Sync over the project, changing the permissions to be writable
138138

139-
if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
140-
# 15.4.0's `rsync` has a bug that requires the src to have write permissions.
141-
# We normally shouldn't do this as it modifies the bazel output base, so we
142-
# limit this to only macOS 15.4.0.
143-
chmod -R +w "$src"
144-
fi
145-
146139
# Don't touch project.xcworkspace as that will make Xcode prompt
147140
rsync \
148141
--archive \
149142
--copy-links \
143+
--perms \
150144
--chmod=u+w,F-x \
151145
--exclude=project.xcworkspace \
152146
--exclude=rules_xcodeproj/bazel \

0 commit comments

Comments
 (0)