leo-project / erocksdb

Erlang bindings to RocksDB datastore
68 stars 15 forks source link

build rocksdb & snappy via rebar.config #16

Closed benoitc closed 8 years ago

benoitc commented 8 years ago

this fix the build with tools like erlang.mk.

mocchira commented 8 years ago

@benoitc CI have failed due to https://travis-ci.org/leo-project/erocksdb/builds/105296933#L825. We need to build the rocksdb beforehand to retrieve the PLATFORM_LDFLAGS from c_src/rocksdb/${BUILD_CONFIG} and pass it to rebar compile as an environment variable somehow.

PLATFORM_LDFLAGS="`cat c_src/rocksdb/${BUILD_CONFIG} |grep PLATFORM_LDFLAGS| awk -F= '{print $$2}'|sed -e 's/-lsnappy//'`" ./rebar compile
benoitc commented 8 years ago

I saw that, not sure right now how to fix it. Maybe handling it in a rebar.config.script?

mocchira commented 8 years ago

@benoitc

I saw that, not sure right now how to fix it. Maybe handling it in a rebar.config.script?

Maybe.

Since port_envs can be used instead of environment variables which are handled in https://github.com/rebar/rebar/blob/master/src/rebar_port_compiler.erl#L178, In rebar.config.script, executing build_deps.sh then tweaking port_envs to add PLATFORM_LDFLAGS seems to work.

Licenser commented 8 years ago

I've solved this issue in https://github.com/project-fifo/erocksdb/blob/r3/rebar.config.script It works around the checkout issue by putting the resolve phase into the compile time not the variable generation time.

mocchira commented 8 years ago

Since https://github.com/leo-project/erocksdb/pull/21 have solved this problem, I close this one.