Skip to content

Commit 5637038

Browse files
authored
Merge pull request #180 from matrix-org/rav/ld_library_path
Document LD_LIBRARY_PATH and go version requirements
2 parents 3fa99e3 + 59458fb commit 5637038

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Check out matrix-rust-sdk, edit your files and then run:
238238
./rebuild_rust_sdk.sh /path/to/your/matrix-rust-sdk
239239
```
240240
241-
Make sure you launch the tests with `LIBRARY_PATH` pointing to
241+
Make sure you launch the tests with `LIBRARY_PATH` and `LD_LIBRARY_PATH` pointing to
242242
`$matrix-rust-sdk/target/debug` so that the built code gets used.
243243
244244
Make sure you add `-count=1` on the command line when you re-run the tests,

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ It currently tests [rust SDK FFI bindings](https://github.com/matrix-org/matrix-
1010
*Please ensure you have met Complement's [Dependencies](https://github.com/matrix-org/complement?tab=readme-ov-file#dependencies) first.
1111
In practice, this means you must have `go` and `docker` installed.*
1212

13+
As of this writing, Complement Crypto's bindings to the Rust SDK are
14+
incompatible with `go` 1.24 due to
15+
https://github.com/NordSecurity/uniffi-bindgen-go/issues/66. Use `go` 1.23 for
16+
now.
17+
1318
Complement Crypto can be compiled and run in different modes depending on which SDK is being tested. For example, if you only want
1419
to test JS SDK then you do not need to compile rust code or run rust tests, and vice versa. Conversely, if you want to test
1520
interoperability between the two SDKs then you need to compile both SDKs.
@@ -64,6 +69,7 @@ To run only rust tests:
6469
COMPLEMENT_CRYPTO_TEST_CLIENT_MATRIX=rr \
6570
COMPLEMENT_BASE_IMAGE=ghcr.io/matrix-org/synapse-service:v1.114.0 \
6671
LIBRARY_PATH=$LIBRARY_PATH:/path/to/matrix-rust-sdk/target/debug \
72+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/matrix-rust-sdk/target/debug \
6773
go test -v -count=1 -tags=rust -timeout 15m ./tests
6874
```
6975

rebuild_rust_sdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ uniffi-bindgen-go -o $COMPLEMENT_DIR/internal/api/rust --config $COMPLEMENT_DIR/
5656
cd $COMPLEMENT_DIR
5757
sed -i.bak 's^// #include <matrix_sdk_ffi.h>^// #include <matrix_sdk_ffi.h>\n// #cgo LDFLAGS: -lmatrix_sdk_ffi^' internal/api/rust/matrix_sdk_ffi/matrix_sdk_ffi.go
5858

59-
echo "OK! Ensure LIBRARY_PATH is set to $RUST_SDK_DIR/target/debug so the .a/.dylib file is picked up when 'go test' is run."
60-
echo "e.g COMPLEMENT_BASE_IMAGE=homeserver:latest LIBRARY_PATH=\$LIBRARY_PATH:$RUST_SDK_DIR/target/debug go test ./tests"
59+
echo "OK! Ensure LIBRARY_PATH and LD_LIBRARY_PATH are set to $RUST_SDK_DIR/target/debug so the .so/.dylib file is picked up when 'go test' is run."
60+
echo "e.g COMPLEMENT_BASE_IMAGE=homeserver:latest LIBRARY_PATH=\$LIBRARY_PATH:$RUST_SDK_DIR/target/debug LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUST_SDK_DIR/target/debug go test ./tests"

0 commit comments

Comments
 (0)