Skip to content

Commit 46c2d77

Browse files
authored
chore(BIC-9999): update download.sh and README.md (#18)
1 parent cde9aba commit 46c2d77

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

README.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This is a Rust API of [Couchbase Lite][CBL], an embedded NoSQL document database
44

55
## Disclaimer
66

7-
This library is **NOT SUPPORTED BY COUCHBASE**, it was forked from Couchbase Labs' repo [couchbase-lite-rust][CBL_RUST] and finalized.
7+
This library is **NOT SUPPORTED BY COUCHBASE**, it was forked from Couchbase Labs' repo [couchbase-lite-rust][CBL_RUST]
8+
and finalized.
89
It is currently used and maintained by Doctolib.
910
The supported platforms are Windows, macOS, Linux, Android and iOS.
1011

@@ -24,26 +25,16 @@ To upgrade the version, start by replacing all the necessary files in the folder
2425
For Android there is an extra step: stripping the libraries.
2526
Place your terminal to the root of this repo, then follow the instructions below.
2627

27-
Run Docker:
28-
``$ docker run --rm --platform linux/amd64 -it -v $(PWD):/build archlinux``
29-
Install strip:
30-
``$ pacman -Sy base-devel``
31-
Strip:
32-
``$ cd /build/libcblite-3.0.3/lib/x86_64-linux-android
33-
$ strip libcblite.so -o libcblite.stripped.so
34-
$ cd /build/libcblite-3.0.3/lib/i686-linux-android
35-
$ strip libcblite.so -o libcblite.stripped.so``
36-
37-
Run docker:
38-
``$ docker run --rm --platform linux/arm64 -it -v $(PWD):/build debian``
39-
Install strip:
40-
``$ apt update && apt install binutils -y``
41-
Strip:
42-
``$ cd /build/libcblite-3.0.3/lib/aarch64-linux-android
43-
$ strip libcblite.so -o libcblite.stripped.so
44-
$ cd /build/libcblite-3.0.3/lib/arm-linux-androideabi
45-
$ strip libcblite.so -o libcblite.stripped.so``
28+
### 2.1. Download
29+
```shell
30+
$ ./download.sh
31+
```
32+
33+
### 2.2 Strip
4634

35+
```shell
36+
$ DOCKER_BUILDKIT=1 docker build --file Dockerfile -t strip --output libcblite .
37+
```
4738

4839
### 3. Fix The Skanky Hardcoded Paths
4940

@@ -52,27 +43,30 @@ This tells the crate where to find Couchbase Lite's headers and library, and the
5243

5344
### 4. Build!
5445

55-
$ cargo build
46+
```shell
47+
$ cargo build
48+
```
5649

5750
### 5. Test
5851

5952
**The unit tests must be run single-threaded.** This is because each test case checks for leaks by
6053
counting the number of extant Couchbase Lite objects before and after it runs, and failing if the
6154
number increases. That works only if a single test runs at a time.
6255

63-
$ LEAK_CHECK=y cargo test -- --test-threads 1
56+
```shell
57+
$ LEAK_CHECK=y cargo test -- --test-threads 1
58+
```
6459

6560
### 6. Sanitizer
6661

67-
$ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test
68-
69-
**To diag flaky test**
62+
```shell
63+
$ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test
64+
```
7065

71-
$ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test --verbose --features=flaky-test flaky
66+
**To diag flaky test**
7267

73-
### 7. Strip libraries
74-
```
75-
DOCKER_BUILDKIT=1 docker build --file Dockerfile -t strip --output libcblite .
68+
```shell
69+
$ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test --verbose --features=flaky-test flaky
7670
```
7771

7872
## Learning
@@ -85,14 +79,23 @@ The Rust API is mostly method-for-method compatible with the languages documente
8579
down at the document property level (dictionaries, arrays, etc.) where I haven't yet written
8680
compatible bindings. For those APIs you can check out the document "[Using Fleece][FLEECE]".
8781

88-
(FYI, if you want to see what bindgen's Rust translation of the C API looks like, it's in the file `bindings.rs` in `build/couchbase-lite-*/out`, where "`*`" will be some hex string. This is super unlikely to be useful unless you want to work on improving the high-level bindings themselves.)
82+
(FYI, if you want to see what bindgen's Rust translation of the C API looks like, it's in the file `bindings.rs` in
83+
`build/couchbase-lite-*/out`, where "`*`" will be some hex string. This is super unlikely to be useful unless you want
84+
to work on improving the high-level bindings themselves.)
8985

9086

9187
[RUST]: https://www.rust-lang.org
88+
9289
[CBL]: https://www.couchbase.com/products/lite
90+
9391
[CBL_C]: https://github.com/couchbase/couchbase-lite-C
92+
9493
[CBL_RUST]: https://github.com/couchbaselabs/couchbase-lite-rust
94+
9595
[CBLDOCS]: https://docs.couchbase.com/couchbase-lite/current/introduction.html
96+
9697
[FLEECE]: https://github.com/couchbaselabs/fleece/wiki/Using-Fleece
98+
9799
[BINDGEN]: https://rust-lang.github.io/rust-bindgen/
100+
98101
[BINDGEN_INSTALL]: https://rust-lang.github.io/rust-bindgen/requirements.html

download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function download() {
5757
fi
5858
}
5959

60-
download ubuntu20.04-x86_64.tar.gz
60+
download linux-x86_64.tar.gz
6161
download windows-x86_64.zip
6262
download macos.zip
6363
download android.zip

0 commit comments

Comments
 (0)