yuchanns commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2958856566
Sorry, I'll update the develop guide for macOS later.
You can replace the Makefile with:
```Makefile
#!/bin/bash
# Check if OPENDAL_TEST is set
if [ -z "$OPENDAL_TEST" ]; then
echo "Error: OPENDAL_TEST environment variable is not set"
echo "Please set OPENDAL_TEST to specify which backend to test (e.g., fs
or memory)"
exit 1
fi
# Specify the backend to test
export SERVICE="$OPENDAL_TEST"
# Get architecture
architecture=$(uname -m)
if [ "$architecture" = "x86_64" ]; then
ARCH="amd64"
GOARCH="amd64"
elif [ "$architecture" = "aarch64" ] || [ "$architecture" = "arm64" ]; then
ARCH="arm64"
GOARCH="arm64"
else
ARCH="unknown"
fi
# Build opendal
cd opendal/bindings/c
cargo build --features "opendal/services-fs"
cd -
# Set environment variables
export GITHUB_WORKSPACE="$PWD/opendal-go-services"
export VERSION="latest"
export TARGET="darwin"
export DIR="$GITHUB_WORKSPACE/libopendal_c_${VERSION}_${SERVICE}_${TARGET}"
# Create directory if not exists
mkdir -p "$DIR"
export OUTPUT="$DIR/libopendal_c.$TARGET.dylib.zst"
# Compress with zstd
zstd -19 opendal/bindings/c/target/debug/libopendal_c.dylib -o $OUTPUT
# Set environment variables for test
export MATRIX='{"build": [{"target":"darwin", "goos":"darwin", "goarch":
"'\$GOARCH'"}], "service": ["fs"]}'
# Generate code
cd opendal-go-services/internal/generate
go run generate.go
cd -
# Delete unnecessary files
rm -rf $DIR
# Run tests
go test ./opendal/bindings/go/tests/behavior_tests -v -run TestBehavior
```
--
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]