Skip to content

Fix permissions when openrsync is used #2708

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjburghard
Copy link
Contributor

Fix file permissions when openrsync is used on macOS 14.5+.

What was changed

Apply write permission using find & chmod when running on macOS 14.5+. To mitigate any previous bazel run invocations that already left the temporary directory without write permissions, an additional check and call to fix the permissions is added before calling rsync. This is needed when rsync needs to delete or modify any existing files.

Why was this changed

macOS 15.4.1 replaced the rsync implementation with openrsync. Apple seems to have added some additional flags like --chmod to openrsync to match the functionality and interface of rsync. Unfortunately, not there are bugs like --chmod being not properly applied when syncing directories.

How to test

  • macOS 15.4+ is required
  • Run bazelisk run //examples/ios/HelloWorld --define=apple.experimental.tree_artifact_outputs=1. simctl should fail with a permission error. (If this steps succeeds, delete the temporary directory and uninstall HelloWorld from the iOS simulator).
  • Switch to this PR and rerun the command. The command should succeed.

rsync_command = [
"/usr/bin/rsync",
"--archive",
"--delete",
"--checksum",
"--chmod=u+w",
"--perms",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding --perms since the man page says it is required when passing --chmod.
Does not have any observable effect at the moment.

@mjburghard mjburghard force-pushed the fix-rsync-permissions branch from 2bf6805 to 9e19934 Compare May 9, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant