Skip to content

Commit

Permalink
CP: Fix permissions on macos artifacts (#45598) (#45844)
Browse files Browse the repository at this point in the history
  • Loading branch information
godofredoc authored Sep 14, 2023
1 parent 9064459 commit bd986c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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 @@ -91,6 +92,21 @@ def main():
subprocess.check_call([
'lipo', arm64_dylib, x64_dylib, '-create', '-output', 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()

process_framework(dst, args, fat_framework, fat_framework_binary)

return 0
Expand Down

0 comments on commit bd986c5

Please sign in to comment.