Skip to content

Use --perms with rsync #3175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions xcodeproj/internal/bazel_integration_files/copy_dsyms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ EOF
if [[ -n "${BAZEL_OUTPUTS_DSYM:-}" ]]; then
cd "${BAZEL_OUT%/*}"

if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
# 15.4.0's `rsync` has a bug that requires the src to have write
# permissions. We normally shouldn't do this as it modifies the bazel output
# base, so we limit this to only macOS 15.4.0.
# shellcheck disable=SC2046
chmod -R +w $(xargs -n1 <<< "$BAZEL_OUTPUTS_DSYM")
fi

# shellcheck disable=SC2046
rsync \
--copy-links \
Expand All @@ -65,6 +57,7 @@ if [[ -n "${BAZEL_OUTPUTS_DSYM:-}" ]]; then
--archive \
--delete \
${exclude_list:+--exclude-from="$exclude_list"} \
--perms \
--chmod=u+w \
--out-format="%n%L" \
$(xargs -n1 <<< "$BAZEL_OUTPUTS_DSYM") \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,14 @@ if [[ "$ACTION" != indexbuild ]]; then
# rpaths to work
ln -sfh "$PWD/$BAZEL_OUTPUTS_PRODUCT_BASENAME" "$TARGET_BUILD_DIR/$PRODUCT_NAME"
else
if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
# 15.4.0's `rsync` has a bug that requires the src to have write
# permissions. We normally shouldn't do this as it modifies the bazel
# output base, so we limit this to only macOS 15.4.0.
chmod -R +w "$BAZEL_OUTPUTS_PRODUCT_BASENAME"
fi

# Product is a bundle
rsync \
--copy-links \
--recursive \
--times \
--delete \
${exclude_list:+--exclude-from="$exclude_list"} \
--perms \
--chmod=u+w \
--out-format="%n%L" \
"$BAZEL_OUTPUTS_PRODUCT_BASENAME" \
Expand Down
8 changes: 1 addition & 7 deletions xcodeproj/internal/templates/incremental_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,10 @@ dest_dir="$(dirname "${dest}")"
# Copy over `xcschemes`
readonly dest_xcschemes="$dest/xcshareddata/xcschemes"

if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
# 15.4.0's `rsync` has a bug that requires the src to have write permissions.
# We normally shouldn't do this as it modifies the bazel output base, so we
# limit this to only macOS 15.4.0.
chmod -R +w "$src_xcschemes"
fi

mkdir -p "$dest_xcschemes"
rsync \
--archive \
--perms \
--chmod=u+w,F-x \
--delete \
"$src_xcschemes" "$dest_xcschemes/"
Expand Down
8 changes: 1 addition & 7 deletions xcodeproj/internal/templates/legacy_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,11 @@ fi

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

if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then
# 15.4.0's `rsync` has a bug that requires the src to have write permissions.
# We normally shouldn't do this as it modifies the bazel output base, so we
# limit this to only macOS 15.4.0.
chmod -R +w "$src"
fi

# Don't touch project.xcworkspace as that will make Xcode prompt
rsync \
--archive \
--copy-links \
--perms \
--chmod=u+w,F-x \
--exclude=project.xcworkspace \
--exclude=rules_xcodeproj/bazel \
Expand Down