Skip to content

Conversation

vitvakatu
Copy link
Contributor

@vitvakatu vitvakatu commented Jul 15, 2019

Overview

RocksDB is linked statically on Mac to avoid problems with dynamic library resolving.. It is required to set ROCKSDB_LIB_DIR prior to running package_app.sh.


See: https://jira.bf.local/browse/ECR-3324

Definition of Done

  • There are no TODOs left in the code
  • Change is covered by automated tests
  • The coding guidelines are followed
  • Public API has Javadoc
  • Method preconditions are checked and documented in the Javadoc of the method
  • Changelog is updated if needed (in case of notable or breaking changes)
  • The continuous integration build passes

@vitvakatu vitvakatu added the work-in-progress 👷‍♂️ Do not expect reviewers to provide any feedback on WIP PRs — please ask for it explicitly! label Jul 15, 2019
@coveralls
Copy link

coveralls commented Jul 15, 2019

Coverage Status

Coverage remained the same at 85.672% when pulling a6775e1 on static_rocksdb_mac into 4aa9ae1 on master.

@vitvakatu vitvakatu requested a review from dip56 July 16, 2019 08:11
@vitvakatu vitvakatu removed the work-in-progress 👷‍♂️ Do not expect reviewers to provide any feedback on WIP PRs — please ask for it explicitly! label Jul 16, 2019
@vitvakatu vitvakatu changed the title Use static rocksdb linkage on Mac Use static rocksdb linkage on Mac [ECR-3324] Jul 16, 2019
# 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

Copy link
Contributor

@dmitry-timofeev dmitry-timofeev left a comment

Choose a reason for hiding this comment

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

Updated the reason for this

@dmitry-timofeev
Copy link
Contributor

Rocksdb 6 is fine.

@dmitry-timofeev dmitry-timofeev merged commit ae4593c into master Jul 16, 2019
@dmitry-timofeev dmitry-timofeev deleted the static_rocksdb_mac branch July 16, 2019 13:56
dmitry-timofeev pushed a commit that referenced this pull request Jul 16, 2019
RocksDB is linked statically on Mac to avoid problems with dynamic library resolving.
When dynamic linking is currently used, the app has a dependency on a particular
version of the library, with any new version breaking the installation.

It is required to set ROCKSDB_LIB_DIR prior to running package_app.sh.

(cherry picked from commit ae4593c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants