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

chaokunyang 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 5bcb938ec fix(python): fix python wheel build (#3469)
5bcb938ec is described below

commit 5bcb938eca16bddd0c0e0d22d8b4b980b4160eea
Author: Shawn Yang <[email protected]>
AuthorDate: Wed Mar 11 17:50:06 2026 +0800

    fix(python): fix python wheel build (#3469)
    
    ## Why?
    
    
    
    ## What does this PR do?
    
    
    
    ## Related issues
    
    
    
    ## AI Contribution Checklist (required when AI assistance = `yes`)
    
    
    
    
    - [ ] Substantial AI assistance was used in this PR: `yes` / `no`
    - [ ] If `yes`, I included the standardized AI Usage Disclosure block
    below.
    - [ ] If `yes`, I can explain and defend all important changes without
    AI help.
    - [ ] If `yes`, I reviewed AI-assisted code changes line by line before
    submission.
    - [ ] If `yes`, I ran adequate human verification and recorded evidence
    (checks run locally or in CI, pass/fail summary, and confirmation I
    reviewed results).
    - [ ] If `yes`, I added/updated tests and specs where required.
    - [ ] If `yes`, I validated protocol/performance impacts with evidence
    when applicable.
    - [ ] If `yes`, I verified licensing and provenance compliance.
    
    AI Usage Disclosure (only when substantial AI assistance = `yes`):
    
    
    
    ```text
    AI Usage Disclosure
    - substantial_ai_assistance: yes
    - scope: <design drafting | code drafting | refactor suggestions | tests | 
docs | other>
    - affected_files_or_subsystems: <high-level paths/modules>
    - human_verification: <checks run locally or in CI + pass/fail summary + 
contributor reviewed results>
    - performance_verification: <N/A or benchmark/regression evidence summary>
    - provenance_license_confirmation: <Apache-2.0-compatible provenance 
confirmed; no incompatible third-party code introduced>
    ```
    
    ## Does this PR introduce any user-facing change?
    
    
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
---
 .github/workflows/build-native-release.yml | 25 ++++++++--
 ci/release.py                              | 75 ++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-native-release.yml 
b/.github/workflows/build-native-release.yml
index 7f8c5314a..087674549 100644
--- a/.github/workflows/build-native-release.yml
+++ b/.github/workflows/build-native-release.yml
@@ -206,7 +206,16 @@ jobs:
           X86_DIR=$(ls -d unpacked/x86_64/pyfory-*)
           UNIVERSAL_DIR="unpacked/pyfory-universal2"
           cp -R "$ARM_DIR" "$UNIVERSAL_DIR"
-          for so in pyfory/buffer.so pyfory/serialization.so 
pyfory/format/_format.so pyfory/lib/mmh3/mmh3.so; do
+          SO_FILES=$(cd "$ARM_DIR" && find pyfory -name '*.so' -type f | sort)
+          if [[ -z "$SO_FILES" ]]; then
+            echo "No shared libraries found in wheel payload"
+            exit 1
+          fi
+          for so in $SO_FILES; do
+            if [[ ! -f "$X86_DIR/$so" ]]; then
+              echo "Missing matching x86_64 library for $so"
+              exit 1
+            fi
             lipo -create "$ARM_DIR/$so" "$X86_DIR/$so" -output 
"$UNIVERSAL_DIR/$so"
           done
           WHEEL_FILE=$(ls "$UNIVERSAL_DIR"/pyfory-*.dist-info/WHEEL)
@@ -225,8 +234,18 @@ jobs:
           VERIFY_DIR=$(ls -d verify/pyfory-*)
           WHEEL_FILE=$(ls "$VERIFY_DIR"/pyfory-*.dist-info/WHEEL)
           grep -q "macosx_11_0_universal2" "$WHEEL_FILE"
-          for so in pyfory/ pyfory/serialization.so pyfory/format/_format.so 
pyfory/lib/mmh3/mmh3.so; do
-            echo "$so: $(lipo -archs "$VERIFY_DIR/$so")"
+          SO_FILES=$(cd "$VERIFY_DIR" && find pyfory -name '*.so' -type f | 
sort)
+          if [[ -z "$SO_FILES" ]]; then
+            echo "No shared libraries found in packed universal2 wheel"
+            exit 1
+          fi
+          for so in $SO_FILES; do
+            ARCHS=$(lipo -archs "$VERIFY_DIR/$so")
+            echo "$so: $ARCHS"
+            if [[ "$ARCHS" != *arm64* || "$ARCHS" != *x86_64* ]]; then
+              echo "Missing expected architectures for $so"
+              exit 1
+            fi
           done
       - name: Upload universal2 wheel
         uses: actions/upload-artifact@v4
diff --git a/ci/release.py b/ci/release.py
index 8f004f673..0caf8aaa0 100644
--- a/ci/release.py
+++ b/ci/release.py
@@ -148,6 +148,8 @@ def bump_version(**kwargs):
             "cpp",
             "go",
             "dart",
+            "csharp",
+            "swift",
             "compiler",
         ]
     else:
@@ -192,6 +194,10 @@ def bump_version(**kwargs):
             bump_go_version(new_version)
         elif lang == "dart":
             bump_dart_version(new_version)
+        elif lang == "csharp":
+            bump_csharp_version(new_version)
+        elif lang == "swift":
+            bump_swift_version(new_version)
         elif lang == "compiler":
             bump_compiler_version(new_version)
         else:
@@ -299,6 +305,36 @@ def bump_compiler_version(new_version):
     )
 
 
+def bump_csharp_version(new_version):
+    _bump_version(
+        "csharp",
+        "Directory.Build.props",
+        new_version,
+        _update_csharp_props_version,
+    )
+    _bump_version(
+        "csharp",
+        "README.md",
+        new_version,
+        _update_csharp_readme_package_version,
+    )
+    _bump_version(
+        "docs/guide/csharp",
+        "index.md",
+        new_version,
+        _update_csharp_readme_package_version,
+    )
+
+
+def bump_swift_version(new_version):
+    _bump_version(
+        "swift",
+        "README.md",
+        new_version,
+        _update_swift_readme_dependency_version,
+    )
+
+
 def _update_pom_parent_version(lines, new_version):
     start_index, end_index = -1, -1
     for i, line in enumerate(lines):
@@ -461,6 +497,45 @@ def _update_pubspec_version(lines, v: str):
     return lines
 
 
+def _update_csharp_props_version(lines, v: str):
+    for index, line in enumerate(lines):
+        if "<Version>" not in line:
+            continue
+        lines[index] = re.sub(
+            r"(<Version>)[^<]+(</Version>)",
+            r"\g<1>" + v + r"\2",
+            line,
+        )
+        return lines
+    raise ValueError("No <Version> element found in 
csharp/Directory.Build.props")
+
+
+def _update_csharp_readme_package_version(lines, v: str):
+    for index, line in enumerate(lines):
+        if "PackageReference" not in line or "Apache.Fory" not in line:
+            continue
+        lines[index] = re.sub(
+            
r'(<PackageReference\s+Include="Apache\.Fory"\s+Version=")[^"]+(")',
+            r"\g<1>" + v + r"\2",
+            line,
+        )
+        return lines
+    raise ValueError("No Apache.Fory PackageReference version snippet found")
+
+
+def _update_swift_readme_dependency_version(lines, v: str):
+    for index, line in enumerate(lines):
+        if "https://github.com/apache/fory.git"; not in line:
+            continue
+        lines[index] = re.sub(
+            
r'(\.package\(url:\s*"https://github\.com/apache/fory\.git",\s*from:\s*";)[^"]+("\))',
+            r"\g<1>" + v + r"\2",
+            line,
+        )
+        return lines
+    raise ValueError("No Swift Package dependency snippet for apache/fory.git 
found")
+
+
 def _normalize_python_version(v: str) -> str:
     v = v.strip()
     v = re.sub(r"(?i)-?snapshot$", ".dev0", v)


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

Reply via email to