diff --git a/python/setup.py b/python/setup.py index 0e4a58b8fc..d31f5544fc 100644 --- a/python/setup.py +++ b/python/setup.py @@ -45,9 +45,6 @@ class BinaryDistribution(Distribution): def __init__(self, attrs=None): super().__init__(attrs=attrs) if BAZEL_BUILD_EXT: - cwd_path = os.path.normpath(project_dir) - subprocess.check_call(["bazel", "clean", "--expunge"], cwd=cwd_path) - bazel_args = ["bazel", "build", "-s"] arch = platform.machine().lower() if arch in ("x86_64", "amd64"): @@ -55,6 +52,8 @@ def __init__(self, attrs=None): elif arch in ("aarch64", "arm64"): bazel_args += ["--copt=-fsigned-char"] bazel_args += ["//:cp_fory_so"] + # Ensure Windows path compatibility + cwd_path = os.path.normpath(project_dir) subprocess.check_call(bazel_args, cwd=cwd_path) def has_ext_modules(self):