Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ You need to install the following dependencies:
* [Stable Rust](https://www.rust-lang.org/tools/install).
* The [system dependencies](https://exonum.com/doc/version/0.11/get-started/install/) of Exonum.
You do _not_ need to manually fetch and compile Exonum.
__Important__: On Mac OS it is necessary to install RocksDB and Snappy
packages and to set environment variables `ROCKSDB_LIB_DIR` and `SNAPPY_LIB_DIR`.
To install these packages via Homebrew:

```bash
brew install rocksdb snappy
export ROCKSDB_LIB_DIR=/usr/local/lib
export SNAPPY_LIB_DIR=/usr/local/lib
```

* For automatic packaging of the Exonum Java app you need [CMake](https://cmake.org/) installed in your system.
Also on Mac you need a [`coreutils`](https://formulae.brew.sh/formula/coreutils) package installed.

Expand All @@ -36,6 +46,7 @@ $ mvn install
```

#### Building Exonum Java App

Run:

```$sh
Expand Down
3 changes: 2 additions & 1 deletion exonum-java-binding/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
`CommonTypeAdapterFactory`. `BlockTypeAdapterFactory` is renamed to `CoreTypeAdapterFactory`.
`JsonSerializer#json` and `JsonSerializer#builder` register `CommonTypeAdapterFactory`
by default. `CoreTypeAdapterFactory` must be registered explicitly if needed. (#971)

- Exonum Java App now uses static linkage for RocksDB on Mac OS. Installed RocksDB
is no more necessary to run the App. (#1011)

### Fixed
- The default [`Transaction#info`][tx-info-07] implementation causing an error on `transaction`
Expand Down
13 changes: 13 additions & 0 deletions exonum-java-binding/package_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ function build-exonum-java-for-platform() {
}

function build-exonum-java-macos() {
# We use static linkage for RocksDB on Mac because we depend on RocksDB 5.18.3
# which is not available via Homebrew
export ROCKSDB_STATIC=1
# Check if ROCKSDB_LIB_DIR is set
if [ -z "${ROCKSDB_LIB_DIR:-}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these variables? It's always the same /usr/local/lib. Can we set them here instead of requiring that from users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not requiring this from users, because our users will use the Homebrew package 😉
Setting this variable explicitly will allow you to choose what RocksDB version to use. Besides, it is also mentioned in Exonum install guide

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mb it'll be better to replace by the following (in pseudo-code):

export ROCKSDB_LIB_DIR={ROCKSDB_LIB_DIR:-/usr/local/lib}
IF $ROCKSDB_LIB_DIR/librocksdb.dylib not found THEN fail(RocksDB not installed)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, you can use a specific version of the rocksdb and use general path for snappy:

export ROCKSDB_LIB_DIR=/usr/local/Cellar/rocksdb/6.1.2/lib
or
export ROCKSDB_LIB_DIR=/usr/local/Cellar/rocksdb5/5.18.3/lib
and
export SNAPPY_LIB_DIR=/usr/local/lib

echo "Please set ROCKSDB_LIB_DIR"
exit 1
fi
# Check if SNAPPY_LIB_DIR is set
if [ -z "${SNAPPY_LIB_DIR:-}" ]; then
echo "Please set SNAPPY_LIB_DIR"
exit 1
fi
build-exonum-java-for-platform "@loader_path" "libjava_bindings.dylib"
}

Expand Down