Skip to content
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

Fix permissions on macos artifacts #45598

Merged
merged 7 commits into from
Sep 14, 2023
Merged
Changes from 5 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
15 changes: 15 additions & 0 deletions sky/tools/create_macos_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def main():

shutil.rmtree(fat_framework, True)
shutil.copytree(arm64_framework, fat_framework, symlinks=True)

regenerate_symlinks(fat_framework)

fat_framework_binary = os.path.join(
Expand All @@ -93,6 +94,20 @@ def main():
])
process_framework(dst, args, fat_framework, fat_framework_binary)

# Add group and other readability to all files.
versions_path = os.path.join(fat_framework, 'Versions')
subprocess.check_call(['chmod', '-R', 'og+r', versions_path])
# Find all the files below the target dir with owner execute permission
find_subprocess = subprocess.Popen([
"find", versions_path, "-perm", "-100", "-print0"
],
stdout=subprocess.PIPE)
# Add execute permission for other and group for all files that had it for owner.
xargs_subprocess = subprocess.Popen(["xargs", "-0", "chmod", "og+x"],
stdin=find_subprocess.stdout)
find_subprocess.wait()
xargs_subprocess.wait()

return 0


Expand Down