From d496ab13a0b9a57990bb84a6d548b93174c72e46 Mon Sep 17 00:00:00 2001 From: "Mr. Doge" <42662615+FuPeiJiang@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:57:17 -0500 Subject: [PATCH] ci: linux: specify target triple for `neon pack-build` (vectordb) (#1889) fixes that all `neon pack-build` packs are named `vectordb-linux-x64-musl-*.tgz` even when cross-compiling adds 2nd param: `TARGET_TRIPLE=${2:-x86_64-unknown-linux-gnu}` `npm run pack-build -- -t $TARGET_TRIPLE` --- .github/workflows/npm-publish.yml | 4 ++-- ci/build_linux_artifacts.sh | 5 +++-- ci/manylinux_node/build_vectordb.sh | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 1d51a2f8..a7cd9f33 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -133,7 +133,7 @@ jobs: free -h - name: Build Linux Artifacts run: | - bash ci/build_linux_artifacts.sh ${{ matrix.config.arch }} + bash ci/build_linux_artifacts.sh ${{ matrix.config.arch }} ${{ matrix.config.arch }}-unknown-linux-gnu - name: Upload Linux Artifacts uses: actions/upload-artifact@v4 with: @@ -188,7 +188,7 @@ jobs: - name: Build Linux Artifacts run: | source ./saved_env - bash ci/manylinux_node/build_vectordb.sh ${{ matrix.config.arch }} + bash ci/manylinux_node/build_vectordb.sh ${{ matrix.config.arch }} ${{ matrix.config.arch }}-unknown-linux-musl - name: Upload Linux Artifacts uses: actions/upload-artifact@v4 with: diff --git a/ci/build_linux_artifacts.sh b/ci/build_linux_artifacts.sh index eeff72ed..4a84e86a 100755 --- a/ci/build_linux_artifacts.sh +++ b/ci/build_linux_artifacts.sh @@ -1,8 +1,9 @@ #!/bin/bash set -e ARCH=${1:-x86_64} +TARGET_TRIPLE=${2:-x86_64-unknown-linux-gnu} -# We pass down the current user so that when we later mount the local files +# We pass down the current user so that when we later mount the local files # into the container, the files are accessible by the current user. pushd ci/manylinux_node docker build \ @@ -18,4 +19,4 @@ docker run \ -v $(pwd):/io -w /io \ --memory-swap=-1 \ lancedb-node-manylinux \ - bash ci/manylinux_node/build_vectordb.sh $ARCH + bash ci/manylinux_node/build_vectordb.sh $ARCH $TARGET_TRIPLE diff --git a/ci/manylinux_node/build_vectordb.sh b/ci/manylinux_node/build_vectordb.sh index 36c11834..9efe60a5 100755 --- a/ci/manylinux_node/build_vectordb.sh +++ b/ci/manylinux_node/build_vectordb.sh @@ -2,6 +2,7 @@ # Builds the node module for manylinux. Invoked by ci/build_linux_artifacts.sh. set -e ARCH=${1:-x86_64} +TARGET_TRIPLE=${2:-x86_64-unknown-linux-gnu} if [ "$ARCH" = "x86_64" ]; then export OPENSSL_LIB_DIR=/usr/local/lib64/ @@ -17,4 +18,4 @@ FILE=$HOME/.bashrc && test -f $FILE && source $FILE cd node npm ci npm run build-release -npm run pack-build +npm run pack-build -t $TARGET_TRIPLE