Skip to content

Commit

Permalink
Revert portable feature as it doesn't do anything (#871)
Browse files Browse the repository at this point in the history
* Revert "Update README.md with a new section for the portable feature"

This reverts commit 0d8804a.

* Revert "Add portable feature for RocksDB build"

This reverts commit eeab5d8.

---------

Co-authored-by: zaidoon <zaidoon@cloudflare.com>
  • Loading branch information
zaidoon1 and zaidoon committed Mar 25, 2024
1 parent e9a084e commit 961abc8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ bzip2 = ["librocksdb-sys/bzip2"]
rtti = ["librocksdb-sys/rtti"]
multi-threaded-cf = []
serde1 = ["serde"]
portable = ["librocksdb-sys/portable"]

[dependencies]
libc = "0.2"
Expand Down
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,9 @@ the crate feature `multi-threaded-cf`, which makes this binding's
data structures use `RwLock` by default. Alternatively, you can directly create
`DBWithThreadMode<MultiThreaded>` without enabling the crate feature.

## Portable builds

RocksDB's build, unlike Cargo, will default to setting `-march=native`, which
generate code that fully takes advantage of build machine's CPU's features.
This may create a binary that isn't compatible with other CPUs on the same
architecture. For example, building on a machine with AVX512 support will create
a binary that fails with `SIGILL` on machines without AVX512.

Set the `portable` feature on this crate to pass `PORTABLE=1` to RocksDB's build,
which will create a portable binary at the cost of some performance.

## Switch between /MT or /MD run time library (Only for Windows)

The feature `mt_static` will request the library to be built with [/MT](https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170)
flag, which results in library using the static version of the run-time library.
*This can be useful in case there's a conflict in the dependecy tree between different
run-time versions.*

1 change: 0 additions & 1 deletion librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ zstd = ["zstd-sys"]
zlib = ["libz-sys"]
bzip2 = ["bzip2-sys"]
rtti = []
portable = []

[dependencies]
libc = "0.2"
Expand Down
4 changes: 0 additions & 4 deletions librocksdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ fn build_rocksdb() {
config.define("USE_RTTI", Some("1"));
}

if cfg!(feature = "portable") {
config.define("PORTABLE", Some("1"));
}

config.include(".");
config.define("NDEBUG", Some("1"));

Expand Down

0 comments on commit 961abc8

Please sign in to comment.