Skip to content

Commit

Permalink
update permissions for wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
JehandadKhan committed Oct 1, 2024
1 parent b7a9848 commit 47521d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build/rocm/tools/build_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import subprocess
import shutil
import sys
import stat


LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -255,10 +256,22 @@ def main():
LOG.info("Copying %s into %s" % (whl, wheelhouse_dir))
shutil.copy(whl, wheelhouse_dir)
# delete the 'dist' directory since it causes permissions issues
logging.info('Deleting dist, egg-info and cache directory')
shutil.rmtree(os.path.join(args.jax_path, "dist"))
shutil.rmtree(os.path.join(args.jax_path, "jax.egg-info"))
shutil.rmtree(os.path.join(args.jax_path, "jax", "__pycache__"))

# make the wheels delete-abl by the runner
whl_house = os.join(args.jax_path, "wheelhouse")
logging.info(f'Changing permissions for {whl_house}')
mode = (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP |
stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH )
for item in os.listdir(whl_house):
whl_path = os.path.join(path, item)
if os.path.isfile(whl_path):
os.chmod(whl_path, mode)


if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
Expand Down

0 comments on commit 47521d0

Please sign in to comment.