This is an automated email from the ASF dual-hosted git repository.

pandalee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git


The following commit(s) were added to refs/heads/main by this push:
     new 67c028050 fix(python): Fix the build dependency failure that occurred 
in pyfory (#2596)
67c028050 is described below

commit 67c028050b40af60e74c11b30c109b0d084d5906
Author: PAN <[email protected]>
AuthorDate: Tue Sep 9 22:52:05 2025 +0800

    fix(python): Fix the build dependency failure that occurred in pyfory 
(#2596)
    
    <!--
    **Thanks for contributing to Apache Fory™.**
    
    **If this is your first time opening a PR on fory, you can refer to
    
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
    
    Contribution Checklist
    
    - The **Apache Fory™** community has requirements on the naming of pr
    titles. You can also find instructions in
    [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
    
    - Apache Fory™ has a strong focus on performance. If the PR you submit
    will have an impact on performance, please benchmark it first and
    provide the benchmark result here.
    -->
    
    ## Why?
    
    When I repeatedly perform `pip install -v e.`, I encounter the problem
    of not being able to find pyarrow. This issue is very similar to #1645.
    However, as long as I perform `bazel clean --expunge`, the problem can
    be solved. I think this might be dependency pollution caused by the
    virtual environment.
    
    <!-- Describe the purpose of this PR. -->
    
    ## What does this PR do?
    
    <!-- Describe the details of this PR. -->
    
    ## Related issues
    
    <!--
    Is there any related issue? If this PR closes them you say say
    fix/closes:
    
    - #xxxx0
    - #xxxx1
    - Fixes #xxxx2
    -->
    
    ## Does this PR introduce any user-facing change?
    relate #2595
    <!--
    If any user-facing interface changes, please [open an
    issue](https://github.com/apache/fory/issues/new/choose) describing the
    need to do so and update the document if necessary.
    
    Delete section if not applicable.
    -->
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
    
    <!--
    When the PR has an impact on performance (if you don't know whether the
    PR will have an impact on performance, you can submit the PR first, and
    if it will have impact on performance, the code reviewer will explain
    it), be sure to attach a benchmark data here.
    
    Delete section if not applicable.
    -->
---
 python/setup.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/setup.py b/python/setup.py
index d31f5544f..0e4a58b8f 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -45,6 +45,9 @@ 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"):
@@ -52,8 +55,6 @@ class BinaryDistribution(Distribution):
             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):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to