jt2594838 commented on code in PR #743:
URL: https://github.com/apache/tsfile/pull/743#discussion_r2938451935


##########
.github/workflows/wheels.yml:
##########
@@ -0,0 +1,286 @@
+name: Build TsFile wheels(multi-platform)
+
+on:
+  push:
+    branches:
+      - "rc/**"
+  workflow_dispatch:
+
+jobs:
+  build:
+    name: Build wheels on ${{ matrix.name }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: linux-x86_64
+            os: ubuntu-22.04
+            platform: linux
+            cibw_archs_linux: "x86_64"
+
+          - name: linux-aarch64
+            os: ubuntu-22.04-arm
+            platform: linux
+            cibw_archs_linux: "aarch64"
+
+          - name: macos-x86_64
+            os: macos-15-intel
+            platform: macos
+            cibw_archs_macos: "x86_64"
+
+          - name: macos-arm64
+            os: macos-latest 
+            platform: macos
+            cibw_archs_macos: "arm64"
+#          Windows is handled by the build-windows job below
+    
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          submodules: false
+          fetch-depth: 0
+
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: "3.11"
+      
+      - name: Set up Java 17
+        uses: actions/setup-java@v4
+        with:
+          distribution: temurin
+          java-version: "17"
+
+      - name: Install system deps (macOS)
+        if: matrix.platform == 'macos'
+        run: |
+          set -eux
+          brew update
+          brew install pkg-config || true
+
+      - name: Install build tools
+        run: |
+          python -m pip install -U pip wheel
+          python -m pip install cibuildwheel==2.21.3
+
+      - name: Pre-download virtualenv for cibuildwheel
+        run: |
+          if [ "$(uname)" = "Darwin" ]; then
+            CACHE_DIR="$HOME/Library/Caches/cibuildwheel"
+          else
+            CACHE_DIR="$HOME/.cache/cibuildwheel"
+          fi
+          mkdir -p "$CACHE_DIR"
+          TARGET="$CACHE_DIR/virtualenv-20.26.6.pyz"
+          if [ ! -f "$TARGET" ]; then
+            curl -sSL --retry 5 --retry-delay 15 --retry-all-errors \
+              -o "$TARGET" \
+              
"https://github.com/pypa/get-virtualenv/raw/20.26.6/public/virtualenv.pyz";
+          fi
+          ls -la "$TARGET"
+
+      
+      - name: Build C++ core via Maven (macOS)
+        if: matrix.platform == 'macos'
+        shell: bash
+        env:
+          MACOSX_DEPLOYMENT_TARGET: "12.0"
+          CFLAGS: "-mmacosx-version-min=12.0"
+          CXXFLAGS: "-mmacosx-version-min=12.0"
+          LDFLAGS: "-mmacosx-version-min=12.0"
+        run: |
+          set -euxo pipefail
+          chmod +x mvnw || true
+          ./mvnw -Pwith-cpp clean package \
+            -DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true \
+            -Dbuild.test=OFF \
+            -Dcmake.args="-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0"
+          otool -l cpp/target/build/lib/libtsfile*.dylib | grep -A2 
LC_VERSION_MIN_MACOSX || true
+            
+      - name: Build wheels via cibuildwheel
+        if: matrix.platform != 'macos'
+        env: 
+          CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
+#          CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows }}
+
+          CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
+          CIBW_SKIP: "pp* *-musllinux*"
+
+          CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
+          CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
+
+          MACOSX_DEPLOYMENT_TARGET: "12.0"
+
+          CIBW_BEFORE_ALL_LINUX: |
+            set -euxo pipefail
+            if command -v yum >/dev/null 2>&1; then
+              yum install -y wget tar gzip pkgconfig libuuid-devel 
libblkid-devel
+            else
+              echo "Not a yum-based image?" ; exit 1
+            fi
+            ARCH="$(uname -m)"
+            mkdir -p /opt/java
+            if [ "$ARCH" = "x86_64" ]; then
+              
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz";
+            else
+              # aarch64
+              
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz";
+            fi
+            curl -L -o /tmp/jdk17.tar.gz "$JDK_URL"
+            tar -xzf /tmp/jdk17.tar.gz -C /opt/java
+            export JAVA_HOME=$(echo /opt/java/jdk-17.0.12*)
+            export PATH="$JAVA_HOME/bin:$PATH"
+            java -version

Review Comment:
   Is this redundant with setup-java before?



##########
cpp/pom.xml:
##########
@@ -163,16 +163,6 @@
         </plugins>
     </build>
     <profiles>
-        <profile>
-            <id>linux-install-uuid-dev</id>
-            <activation>
-                <os>
-                    <family>unix</family>
-                    <name>Linux</name>
-                </os>
-            </activation>
-        </profile>
-        <!-- When running on jenkins, download the sonar build-wrapper, so we 
can do a code analysis -->

Review Comment:
   Add something in the ReadMe to remind the user to install manually.



##########
.github/workflows/unit-test-python.yml:
##########
@@ -60,6 +65,17 @@ jobs:
           key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
           restore-keys: ${{ runner.os }}-m2-
 
+      - name: Install dependencies
+        shell: bash
+        run: |
+          if [[ "$RUNNER_OS" == "Linux" ]]; then
+            if command -v apt-get >/dev/null 2>&1; then
+              sudo apt-get update
+              sudo apt-get install -y uuid-dev
+            elif command -v yum >/dev/null 2>&1; then
+              sudo yum install -y libuuid-devel
+            fi
+          fi

Review Comment:
   This makes some sense



##########
python/pyproject.toml:
##########
@@ -0,0 +1,69 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+[build-system]
+requires = [
+    "setuptools>=69",
+    "wheel", 
+    "Cython>=3", 
+    "numpy>=2.0.0,<3"
+    ]
+
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "tsfile"
+version = "2.2.1.dev"

Review Comment:
   We would better maintain a file or a script to record all positions where 
the version of TsFile exists.
   Otherwise, we may omit something during release.
   



##########
pom.xml:
##########
@@ -135,6 +135,10 @@
                             <exclude>**/tsfile.egg-info/**</exclude>
                             <!-- Exclude third_party-->
                             <exclude>**/third_party/**</exclude>
+                            <exclude>**/.python-version</exclude>
+                            <exclude>**/**venv-py**/**</exclude>
+                            <exclude>**/.python-version</exclude>
+                            <exclude>python/.python-version</exclude>

Review Comment:
   +1



##########
.github/workflows/unit-test-python.yml:
##########
@@ -60,6 +65,17 @@ jobs:
           key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
           restore-keys: ${{ runner.os }}-m2-
 
+      - name: Install dependencies
+        shell: bash
+        run: |
+          if [[ "$RUNNER_OS" == "Linux" ]]; then
+            if command -v apt-get >/dev/null 2>&1; then
+              sudo apt-get update
+              sudo apt-get install -y uuid-dev
+            elif command -v yum >/dev/null 2>&1; then
+              sudo yum install -y libuuid-devel
+            fi
+          fi

Review Comment:
   <img width="1532" height="561" alt="Image" 
src="https://github.com/user-attachments/assets/72b5bd11-777d-4165-87b2-1ca0d4b4786f";
 />



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to