Skip to content

Commit ca31e4c

Browse files
committed
Fix windows build cannot find versions.py
When I install executorch on windows I run into this error: error: [Errno 2] No such file or directory: 'pip-out\\lib.win-amd64-cpython-312\\executorch\\version.py' It turns out sometimes the dst directory (in this case pip-out\lib.win-amd64-cpython-312\executorch) is not installed before we write version.py into it. This PR adds a mkpath call to make sure it's always there.
1 parent 9a7882e commit ca31e4c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ def run(self):
635635
dst_root = self.get_package_dir(".")
636636
else:
637637
dst_root = os.path.join(self.build_lib, "executorch")
638+
# On Windows the package directory might not exist yet when building from a
639+
# clean tree. Ensure it is created before we attempt to write version.py.
640+
self.mkpath(dst_root)
638641
# Create the version file.
639642
Version.write_to_python_file(os.path.join(dst_root, "version.py"))
640643

0 commit comments

Comments
 (0)