Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue/447-export-…
Browse files Browse the repository at this point in the history
…and-set
  • Loading branch information
developerfred committed Jan 18, 2021
2 parents f9530fc + ed69084 commit aaa49ce
Show file tree
Hide file tree
Showing 33 changed files with 700 additions and 176 deletions.
90 changes: 71 additions & 19 deletions .github/workflows/rust.yml
@@ -1,42 +1,94 @@
name: RocksDB build
name: RocksDB CI

on: [push, pull_request]

jobs:
test-librocksdb-sys:
name: Test librocksdb-sys crate
runs-on:
- windows-latest
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
submodules: true

- name: Install dependencies
run: choco install llvm -y

- name: Run librocksdb-sys tests
toolchain: stable
components: rustfmt
profile: minimal
override: true
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=librocksdb-sys/Cargo.toml
command: fmt
args: --all -- --check

test-rocksdb:
name: Test rocksdb crate
runs-on:
- windows-latest
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: true
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings

audit:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

test:
name: ${{ matrix.build }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [Linux, macOS, Windows]
include:
- build: Linux
os: ubuntu-latest
- build: macOS
os: macos-latest
- build: Windows
os: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: true
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust || 'stable' }}
target: ${{ matrix.target }}
profile: minimal
override: true
- name: Remove msys64 # Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
if: runner.os == 'Windows'
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- name: Install dependencies
if: runner.os == 'Windows'
run: choco install llvm -y

- name: Run librocksdb-sys tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=librocksdb-sys/Cargo.toml
- name: Run rocksdb tests
uses: actions-rs/cargo@v1
with:
command: test
args: -- --skip test_iterator_outlive_db
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .travis/lints.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .travis/tests.sh

This file was deleted.

34 changes: 33 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,39 @@

## [Unreleased]

* Export the `DEFAULT_COLUMN_FAMILY_NAME` constant.
* Add `DB::cancel_all_background_work` method (stanislav-tkach)
* Bump `librocksdb-sys` up to 6.13.3 (aleksuss)
* Add `multi_get`, `multi_get_opt`, `multi_get_cf` and `multi_get_cf_opt` `DB` methods (stanislav-tkach)

## 0.15.0 (2020-08-25)

* Fix building rocksdb library on windows host (aleksuss)
* Add github actions CI for windows build (aleksuss)
* Update doc for Options::set_compression_type (wqfish)
* Add clippy linter in CI (aleksuss)
* Use DBPath for backup_restore test (wqfish)
* Allow to build RocksDB with a different stdlib (calavera)
* Add some doc-comments and tiny refactoring (aleksuss)
* Expose `open_with_ttl`. (calavera)
* Fixed build for `x86_64-linux-android` that doesn't support PCLMUL (vimmerru)
* Add support for `SstFileWriter` and `DB::ingest_external_file` (methyl)
* Add set_max_log_file_size and set_recycle_log_file_num to the Options (stanislav-tkach)
* Export the `DEFAULT_COLUMN_FAMILY_NAME` constant (stanislav-tkach)
* Fix slice transformers with no in_domain callback (nelhage)
* Don't segfault on failed a merge operator (nelhage)
* Adding read/write/db/compaction options (linxGnu)
* Add dbpath and env options (linxGnu)
* Add compaction filter factory API (unrealhoang)
* Add link stdlib when linking prebuilt rocksdb (unrealhoang)
* Support fetching sst files metadata, delete files in range, get mem usage (linxGnu)
* Do not set rerun-if-changed=build.rs (xu-cheng)
* Use pretty_assertions in tests (stanislav-tkach)
* librocksdb-sys: update rocksdb to 6.11.4 (ordian)
* Adding backup engine info (linxGnu)
* Implement `Clone` trait for `Options` (stanislav-tkach)
* Added `Send` implementation to `WriteBatch` (stanislav-tkach)
* Extend github actions (stanislav-tkach)
* Avoid copy for merge operator result using delete_callback (xuchen-plus)

## 0.14.0 (2020-04-22)

Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.14.0"
version = "0.15.0"
edition = "2018"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
Expand All @@ -27,8 +27,9 @@ bzip2 = ["librocksdb-sys/bzip2"]

[dependencies]
libc = "0.2"
librocksdb-sys = { path = "librocksdb-sys", version = "6.10.2" }
librocksdb-sys = { path = "librocksdb-sys", version = "6.11.4" }

[dev-dependencies]
trybuild = "1.0.21"
tempfile = "3.1.0"
pretty_assertions = "0.6.1"
5 changes: 2 additions & 3 deletions librocksdb-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "librocksdb-sys"
version = "6.10.2"
version = "6.11.4"
edition = "2018"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
Expand All @@ -9,7 +9,6 @@ readme = "README.md"
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
keywords = [ "bindings", "ffi", "rocksdb" ]
categories = [ "api-bindings", "database", "external-ffi-bindings" ]

links = "rocksdb"

[features]
Expand All @@ -30,5 +29,5 @@ uuid = { version = "0.8", features = ["v4"] }

[build-dependencies]
cc = { version = "^1.0", features = ["parallel"] }
bindgen = "0.54"
bindgen = "0.55"
glob = "0.3"
12 changes: 8 additions & 4 deletions librocksdb-sys/build.rs
Expand Up @@ -147,10 +147,14 @@ fn build_rocksdb() {
lib_sources = lib_sources
.iter()
.cloned()
.filter(|file| match *file {
"port/port_posix.cc" | "env/env_posix.cc" | "env/fs_posix.cc"
| "env/io_posix.cc" => false,
_ => true,
.filter(|file| {
!matches!(
*file,
"port/port_posix.cc"
| "env/env_posix.cc"
| "env/fs_posix.cc"
| "env/io_posix.cc"
)
})
.collect::<Vec<&'static str>>();

Expand Down
4 changes: 2 additions & 2 deletions librocksdb-sys/build_version.cc
@@ -1,4 +1,4 @@
#include "build_version.h"
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@50f206ad84fa6cd516bad1bea93c03ae0655b314@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2020/07/29 16:07:40@";
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@48bfca38f6f175435052a59791922a1a453d9609@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2020/07/15 17:54:15@";
const char* rocksdb_build_compile_date = __DATE__;
1 change: 0 additions & 1 deletion librocksdb-sys/rocksdb_lib_sources.txt
Expand Up @@ -251,4 +251,3 @@ utilities/transactions/write_unprepared_txn_db.cc
utilities/ttl/db_ttl_impl.cc
utilities/write_batch_with_index/write_batch_with_index.cc
utilities/write_batch_with_index/write_batch_with_index_internal.cc

18 changes: 11 additions & 7 deletions librocksdb-sys/tests/ffi.rs
Expand Up @@ -89,21 +89,25 @@ macro_rules! CheckCondition {
};
}

unsafe fn CheckEqual(expected: *const c_char, v: *const c_char, n: size_t) {
if expected.is_null() && v.is_null() {
// ok
unsafe fn CheckEqual(expected: *const c_char, actual: *const c_char, n: size_t) {
let is_equal = if expected.is_null() && actual.is_null() {
true
} else if !expected.is_null()
&& !v.is_null()
&& !actual.is_null()
&& n == strlen(expected)
&& memcmp(expected as *const c_void, v as *const c_void, n) == 0
&& memcmp(expected as *const c_void, actual as *const c_void, n) == 0
{
// ok
true
} else {
false
};

if !is_equal {
panic!(
"{}: expected '{}', got '{}'",
phase,
rstr(strndup(expected, n)),
rstr(strndup(v, 5))
rstr(strndup(actual, 5))
);
}
}
Expand Down

0 comments on commit aaa49ce

Please sign in to comment.