You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "kingsword09 (via GitHub)" <gi...@apache.org> on 2025/06/10 11:32:26 UTC
[I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
kingsword09 opened a new issue, #6279:
URL: https://github.com/apache/opendal/issues/6279
### Describe the bug
Running `./make_test.sh` resulted in the following error:
```shell
opendal/bindings/c/target/debug/libopendal_c.dylib : 21.48% ( 13.2 MiB => 2.85 MiB, /Users/xx/xx/opendal_workspace/opendal-go-services/libopendal_c_latest_fs_darwin/libopendal_c.darwin.dylib.zst)
panic: create operator must succeed: 1 Unsupported (permanent) at , context: { scheme: fs } => scheme is not enabled or supported
goroutine 1 [running]:
opendal_test_test.TestMain(0x14000242820)
/Users/xx/xx/opendal_workspace/opendal/bindings/go/tests/behavior_tests/opendal_test.go:47 +0x90
main.main()
_testmain.go:63 +0x98
FAIL opendal_test 1.393s
FAIL
```
Is there a step I'm missing? @yuchanns
### Steps to Reproduce
```bash
mkdir opendal_workspace
cd opendal_workspace
git clone --depth 1 [git@github.com:](mailto:git@github.com:)apache/opendal.git
git clone --depth 1 [git@github.com:](mailto:git@github.com:)apache/opendal-go-services.git
go work init
go work use ./opendal/bindings/go
go work use ./opendal/bindings/go/tests/behavior_tests
# use the backend you want to test, e.g., fs or memory
go work use ./opendal-go-services/fs
# go work use ./opendal-go-services/memory
cat <<EOF > ./make_test.sh
#!/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
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":"'$TARGET'", "goos":"'$TARGET'", "goarch": "'$GOARCH'"}], "service": ["'$SERVICE'"]}'
# Generate code
cd opendal-go-services/internal/generate
go run generate.go
cd -
# Delete unnecessary files
rm -rf $DIR
# Run tests
CGO_LDFLAGS="-L/opt/homebrew/opt/libffi/lib -Wl,-rpath,/opt/homebrew/opt/libffi/lib" \
CGO_CFLAGS="-I/opt/homebrew/opt/libffi/include" \
go test -ldflags="-linkmode external" ./opendal/bindings/go/tests/behavior_tests -v -run TestBehavior
```
<br/>
To build and run tests, run the following commands:
```bash
cd opendal_workspace
# specify the backend to test
export OPENDAL_TEST=fs
export OPENDAL_FS_ROOT=/tmp/opendal
# build the C binding and run the tests
./make_test.sh
cd -
```
### Expected Behavior
test success
### Additional Context
_No response_
### Are you willing to submit a PR to fix this bug?
- [ ] Yes, I would like to submit a PR.
--
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: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2961135551
> Would you consider upgrading [JupiterRider/ffi](https://github.com/JupiterRider/ffi/releases/tag/v0.5.0) to 0.5.0?
Done.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "kingsword09 (via GitHub)" <gi...@apache.org>.
kingsword09 commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2958968903
> Sorry, the development guide is outdate after some c binding changes.
>
> > > cargo build --features services-fs
>
> Excatly.
>
> I'll update the guide later.
Got it, thanks. So it needed to be changed to this.
```
cargo build --features "opendal/services-fs"
```
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2958831590
<!-- Answer -->
The error happens because OpenDAL doesn't enable any services unless the corresponding feature is activated at build time. The 'fs' scheme specifically requires the Cargo feature services-fs to be enabledâotherwise, it won't be available and you'll see the "scheme is not enabled or supported" error, even if your environment variables are set correctly. This is a build-time configuration, not something you can fix with runtime environment variables or test flags. See [this discussion](https://github.com/apache/opendal/issues/5932) and [the code reference](https://github.com/apache/opendal/blob/03d6c77341ab82f0fc0bd6aacc139d0bd13da0a1/core/src/services/fs/mod.rs).
To fix this, make sure that when you build the C binding (opendal/bindings/c), you enable the services-fs feature in Cargo. For example, you can run:
```bash
cargo build --features services-fs
```
Or, if you want to enable all test-related features (which includes services-fs):
```bash
cargo build --features tests
```
After rebuilding with the correct features, rerun your test script. This should enable the 'fs' scheme and resolve the error. Also, make sure your OPENDAL_FS_ROOT is set to an absolute path, as required by the fs backend configuration [docs](https://github.com/apache/opendal/blob/03d6c77341ab82f0fc0bd6aacc139d0bd13da0a1/core/src/services/fs/docs.md).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=hallucination) | [Report đ](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0122085f-306a-4153-b854-d1bd1f55f915?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [!
[Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/6279)
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2961163632
Thank you very much @JupiterRider for this great work in ffi/0.5.0! Also thank you @yuchanns for help addressing this.
So nice!
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "kingsword09 (via GitHub)" <gi...@apache.org>.
kingsword09 commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2960719317
> Hi the new Makefile is ready for Linux and macOS: https://github.com/apache/opendal/blob/main/bindings/go/Makefile
Thank you for updating the Makefile to support macOS and helping address this issue! Would you consider upgrading [JupiterRider/ffi](https://github.com/JupiterRider/ffi/releases/tag/v0.5.0) to 0.5.0? This should make things easier on macOS, as users wouldnât have to manually install libffi or set environment variables. Otherwise, missing libffi can cause errors like:
```bash
panic: dlopen(libffi.8.dylib, 0x0001): tried: 'libffi.8.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibffi.8.dylib'
(no such file), '/usr/lib/libffi.8.dylib' (no such file, not in dyld cache), 'libffi.8.dylib' (no such file)
```
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "kingsword09 (via GitHub)" <gi...@apache.org>.
kingsword09 closed issue #6279: bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported
URL: https://github.com/apache/opendal/issues/6279
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2959882036
Hi the new Makefile is ready for Linux and macOS: https://github.com/apache/opendal/blob/main/bindings/go/Makefile
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: Go Binding Tests Fail on macOS Due to scheme is not enabled or supported [opendal]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on issue #6279:
URL: https://github.com/apache/opendal/issues/6279#issuecomment-2960992632
Sure!
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org