From 7d7dac4ef5e48a455e727c6f2df29ac79c597dc8 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 11 Jan 2023 11:40:39 +0100 Subject: [PATCH] Remove the feature and always use the vendored version --- README.md | 13 ------------ heed/Cargo.toml | 3 --- lmdb-master-sys/Cargo.toml | 7 +++---- lmdb-master-sys/build.rs | 42 ++++++++++++++++++-------------------- 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 0e65a729..1fb16414 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,6 @@ This library is able to serialize all kind of types, not just bytes slices, even Go check out [the examples](heed/examples/). -## Vendoring - -By default, if LMDB is installed on the system, this crate will attempt to make use of the system-available LMDB. -To force installation from source, build this crate with the `vendored` feature. - ## Building from Source ### Using the system LMDB if available @@ -35,11 +30,3 @@ However, if you already cloned it and forgot about the initialising the submodul ```bash git submodule update --init ``` - -### Always vendoring - -```bash -git clone --recursive https://github.com/meilisearch/heed.git -cd heed -cargo build --features vendored -``` diff --git a/heed/Cargo.toml b/heed/Cargo.toml index 21179cae..c7db9f46 100644 --- a/heed/Cargo.toml +++ b/heed/Cargo.toml @@ -35,9 +35,6 @@ url = "2.3.1" # like the `EnvOpenOptions` struct. default = ["serde", "serde-bincode", "serde-json"] -# Use the provided version of LMDB instead of the one that is installed on the system. -vendored = ["lmdb-master-sys/vendored"] - # The NO_TLS flag is automatically set on Env opening and # RoTxn implements the Sync trait. This allow the user to reference # a read-only transaction from multiple threads at the same time. diff --git a/lmdb-master-sys/Cargo.toml b/lmdb-master-sys/Cargo.toml index 1383f304..92d601bb 100644 --- a/lmdb-master-sys/Cargo.toml +++ b/lmdb-master-sys/Cargo.toml @@ -32,7 +32,6 @@ pkg-config = "0.3.26" [features] default = [] -vendored = [] -with-asan = ["vendored"] -with-fuzzer = ["vendored"] -with-fuzzer-no-link = ["vendored"] +with-asan = [] +with-fuzzer = [] +with-fuzzer-no-link = [] diff --git a/lmdb-master-sys/build.rs b/lmdb-master-sys/build.rs index 150faee6..2d14063a 100644 --- a/lmdb-master-sys/build.rs +++ b/lmdb-master-sys/build.rs @@ -31,27 +31,25 @@ fn main() { warn!("Building with `-fsanitize=fuzzer`."); } - if cfg!(feature = "vendored") || pkg_config::find_library("lmdb").is_err() { - let mut builder = cc::Build::new(); - - builder - .file(lmdb.join("mdb.c")) - .file(lmdb.join("midl.c")) - // https://github.com/mozilla/lmdb/blob/b7df2cac50fb41e8bd16aab4cc5fd167be9e032a/libraries/liblmdb/Makefile#L23 - .flag_if_supported("-Wno-unused-parameter") - .flag_if_supported("-Wbad-function-cast") - .flag_if_supported("-Wuninitialized"); - - if cfg!(feature = "with-asan") { - builder.flag("-fsanitize=address"); - } - - if cfg!(feature = "with-fuzzer") { - builder.flag("-fsanitize=fuzzer"); - } else if cfg!(feature = "with-fuzzer-no-link") { - builder.flag("-fsanitize=fuzzer-no-link"); - } - - builder.compile("liblmdb.a") + let mut builder = cc::Build::new(); + + builder + .file(lmdb.join("mdb.c")) + .file(lmdb.join("midl.c")) + // https://github.com/mozilla/lmdb/blob/b7df2cac50fb41e8bd16aab4cc5fd167be9e032a/libraries/liblmdb/Makefile#L23 + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wbad-function-cast") + .flag_if_supported("-Wuninitialized"); + + if cfg!(feature = "with-asan") { + builder.flag("-fsanitize=address"); } + + if cfg!(feature = "with-fuzzer") { + builder.flag("-fsanitize=fuzzer"); + } else if cfg!(feature = "with-fuzzer-no-link") { + builder.flag("-fsanitize=fuzzer-no-link"); + } + + builder.compile("liblmdb.a") }