From 47521d09a004f62b4e1bf71fd55146d76e650fa9 Mon Sep 17 00:00:00 2001 From: Jehandad Khan Date: Tue, 1 Oct 2024 18:07:35 +0000 Subject: [PATCH] update permissions for wheels --- build/rocm/tools/build_wheels.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build/rocm/tools/build_wheels.py b/build/rocm/tools/build_wheels.py index f29ca4e57231..b86d072cffb4 100644 --- a/build/rocm/tools/build_wheels.py +++ b/build/rocm/tools/build_wheels.py @@ -30,6 +30,7 @@ import subprocess import shutil import sys +import stat LOG = logging.getLogger(__name__) @@ -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)