Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 6 additions & 8 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ jobs:
fail-fast: false
matrix:
otp:
- "24.2.1.0"
- "23.3.4.11"
- "22.3.4.24"
- "24.3.4"
- "23.3.4.14"
- "22.3.4.26"

container:
image: erlang:${{ matrix.otp }}

steps:
- uses: actions/checkout@v2
- name: Compile
run: ./rebar3 compile
- name: Run xref and dialyzer
run: ./rebar3 do xref, dialyzer
- name: Run eunit
run: ./rebar3 eunit
run: apt-get update && apt-get install -y cmake && make
- name: Run tests
run: apt-get update && apt-get install -y cmake libc6-dev && make check
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.PHONY: compile rel cover test dialyzer
.PHONY: compile rel cover test dialyzer get-deps
REBAR=./rebar3

compile:
all: compile

get-deps:
$(REBAR) get-deps

compile: get-deps
$(REBAR) compile

clean:
Expand All @@ -11,6 +16,7 @@ cover: test
$(REBAR) cover

test: compile
$(MAKE) -C c_src test
$(REBAR) as test do eunit

dialyzer:
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

[![Erlang CI Actions Status](https://github.com/basho/eleveldb/workflows/Erlang%20CI/badge.svg)](https://github.com/basho/eleveldb/actions)

This repository follows the Basho standard for branch management
as of November 28, 2013. The standard is found here:
This project provides erlang bindings to a LevelDB datastore heavily optimised for [Riak workloads](https://github.com/basho/riak). See the [Basho leveldb wiki](https://github.com/basho/leveldb/wiki) for a breakdown of the optimisations.

https://github.com/basho/riak/wiki/Basho-repository-management
No further work on optimising the underlying store is currently being undertaken, only minimal fixes necessary for platform compatability.

In summary, the "develop" branch contains the most recently reviewed
engineering work. The "master" branch contains the most recently
released work, i.e. distributed as part of a Riak release.
As an alternative, elrang bindings to RocksDB can be found as part of the [BarrellDB](https://gitlab.com/barrel-db/erlang-rocksdb) project. For Riak-like workloads, especially with large objects, the pure-Erlang [Leveled store](https://github.com/martinsumner/leveled) is also available.

# Iterating Records

Expand Down
1 change: 1 addition & 0 deletions c_src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snappy-*.tar.gz
50 changes: 50 additions & 0 deletions c_src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
LEVELDB_VSN ?= "2.0.38"
SNAPPY_VSN ?= "1.1.9"
BASEDIR = $(shell pwd)

LDFLAGS := $(LDFLAGS) -L$(BASEDIR)/system/lib
LD_LIBRARY_PATH := $(BASEDIR)/system/lib:$(LD_LIBRARY_PATH)
CFLAGS := $(CFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC
CXXFLAGS := $(CXXFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC

get-deps:
if [ ! -r snappy-$(SNAPPY_VSN).tar.gz ]; then \
wget -O snappy-$(SNAPPY_VSN).tar.gz https://github.com/google/snappy/archive/refs/tags/$(SNAPPY_VSN).tar.gz; \
fi
if [ ! -d leveldb ]; then \
git clone https://github.com/basho/leveldb && \
(cd leveldb && git checkout $(LEVELDB_VSN)) && \
(cd leveldb && git submodule update --init); \
fi

compile: get-deps snappy ldb
cp leveldb/perf_dump leveldb/sst_rewrite leveldb/sst_scan leveldb/leveldb_repair ../priv

ldb:
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb all
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb tools

snappy: system/lib/libsnappy.a

system/lib/libsnappy.a:
tar -xzf snappy-$(SNAPPY_VSN).tar.gz && \
(cd snappy-$(SNAPPY_VSN) && \
git submodule update --init && \
if [ -r autogen.sh ]; then \
./autogen.sh && ./configure --prefix=$(BASEDIR)/system && make && make install; \
else \
mkdir build && cd build && \
mkdir -p $(BASEDIR)/system && \
cmake -D SNAPPY_BUILD_TESTS=0 -D SNAPPY_BUILD_BENCHMARKS=0 \
-D CMAKE_INSTALL_PREFIX=$(BASEDIR)/system \
..; \
fi && \
make && make install)
mv system/lib64 system/lib || true

clean:
$(MAKE) -C leveldb clean
rm -rf system snappy-$(SNAPPY_VSN)/build

test: compile
$(MAKE) CXXFLAGS="$(CXXFLAGS) -Wno-narrowing" LDFLAGS="$(LDFLAGS) -lsnappy -lpthread" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb test
106 changes: 0 additions & 106 deletions c_src/build_deps.sh

This file was deleted.

Binary file removed c_src/snappy-1.0.4.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/leveldb/libleveldb.a c_src/system/lib/libsnappy.a -lstdc++"}
]}.

{pre_hooks, [{'get-deps', "c_src/build_deps.sh get-deps"},
{compile, "c_src/build_deps.sh"}]}.
{pre_hooks, [{'get-deps', "make -C c_src get-deps"},
{compile, "make -C c_src compile"}]}.

{post_hooks, [{clean, "c_src/build_deps.sh clean"}]}.
{post_hooks, [{clean, "make -C c_src clean"}]}.
Binary file modified rebar3
Binary file not shown.
69 changes: 0 additions & 69 deletions tools.mk

This file was deleted.