Elffuss BraidHub

kikocis/lancedb public

main · 774 BRawPermalink
1# Builds the macOS artifacts (nodejs binaries).
2# Usage: ./ci/build_macos_artifacts_nodejs.sh [target]
3# Targets supported: x86_64-apple-darwin aarch64-apple-darwin
4set -e
5
6prebuild_rust() {
7 # Building here for the sake of easier debugging.
8 pushd rust/lancedb
9 echo "Building rust library for $1"
10 export RUST_BACKTRACE=1
11 cargo build --release --target $1
12 popd
13}
14
15build_node_binaries() {
16 pushd nodejs
17 echo "Building nodejs library for $1"
18 export RUST_TARGET=$1
19 npm run build-release
20 popd
21}
22
23if [ -n "$1" ]; then
24 targets=$1
25else
26 targets="x86_64-apple-darwin aarch64-apple-darwin"
27fi
28
29echo "Building artifacts for targets: $targets"
30for target in $targets
31 do
32 prebuild_rust $target
33 build_node_binaries $target
34done