From 28d8a10c8f3b6a4d16dc9beb9f0f16912c5aace6 Mon Sep 17 00:00:00 2001 From: Charles Hofer Date: Wed, 13 Nov 2024 14:19:42 -0600 Subject: [PATCH] Fix wheel build --- build/rocm/tools/build_wheels.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/rocm/tools/build_wheels.py b/build/rocm/tools/build_wheels.py index deb6ab703391..faffc4fd6b51 100644 --- a/build/rocm/tools/build_wheels.py +++ b/build/rocm/tools/build_wheels.py @@ -303,6 +303,23 @@ 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.path.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(whl_house, item) + if os.path.isfile(whl_path): + os.chmod(whl_path, mode) + if __name__ == "__main__": logging.basicConfig(level=logging.INFO)