Skip to content

Commit fa4cf98

Browse files
committed
[BE] Add --clean option to install_requirements.py
Summary: as titled. remove `cmake-out/` and `pip-out/` before installing ExecuTorch. Android is creating directory name such as `cmake-out-armv8` so removing those as well. Test Plan: Tried on my machine Reviewers: Subscribers: Tasks: Tags:
1 parent 0186c7f commit fa4cf98

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

install_requirements.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ def python_is_compatible():
7878
else:
7979
print(f"Error: {arg} must follow --pybind")
8080
sys.exit(1)
81+
elif arg == "--clean":
82+
print(f"Cleaning build artifacts...")
83+
if sys.platform == "win32":
84+
subprocess.run(["rmdir", "/s", "cmake-out*/"], check=True)
85+
subprocess.run(["rmdir", "/s", "pip-out/"], check=True)
86+
else:
87+
subprocess.run(["rm", "-rf", "cmake-out*/"], check=True)
88+
subprocess.run(["rm", "-rf", "pip-out/"], check=True)
8189
else:
8290
print(f"Error: Unknown option {arg}")
8391
sys.exit(1)

0 commit comments

Comments
 (0)