Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Update lmdb to latest version and other goodies#56

Merged
victorporof merged 11 commits intomasterfrom
update-lmdb
Sep 5, 2019
Merged

Update lmdb to latest version and other goodies#56
victorporof merged 11 commits intomasterfrom
update-lmdb

Conversation

@victorporof
Copy link
Copy Markdown

@victorporof victorporof commented Aug 30, 2019

This PR:

  • Updates lmdb to 0.9.24 (with MOZ changes on top)
  • Makes the sys crate create bindings automatically using rust-bindgen
  • Allows cc to handle build optimizations, fixes build mdb.c without optimizations for debug build #54
  • Hides unused parameter warnings while building lmdb

@victorporof victorporof requested a review from mykmelez August 30, 2019 15:58
Copy link
Copy Markdown

@mykmelez mykmelez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great; I'm super-psyched that you've automated the bindings generation.

I looked at a couple of the failing Windows builds, and they fail with errors like:

cargo:warning=cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter'

Setting the flag via https://docs.rs/cc/1.0.4/cc/struct.Build.html#method.flag_if_supported should resolve that.

I'm unsure about the errors on macOS, but it looks like they only occur with Rust 1.30, so perhaps a dependency requires a newer version. Maybe we can simply drop support for that version of Rust?

.file(lmdb.join("mdb.c"))
.file(lmdb.join("midl.c"))
// https://github.com/LMDB/lmdb/blob/LMDB_0.9.21/libraries/liblmdb/Makefile#L25
.opt_level(2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@victorporof
Copy link
Copy Markdown
Author

I think we need to install libclang on windows:

2019-08-31T06:28:25.0361872Z --- stderr
2019-08-31T06:28:25.0362101Z thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'clang.dll\', \'libclang.dll\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src\libcore\result.rs:999:5
2019-08-31T06:28:25.0362841Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

@victorporof victorporof force-pushed the update-lmdb branch 2 times, most recently from 7e8588a to edd7b2e Compare August 31, 2019 07:18
@mykmelez
Copy link
Copy Markdown

mykmelez commented Sep 3, 2019

I think we need to install libclang on windows:

Ah, indeed, according to https://rust-lang.github.io/rust-bindgen/requirements.html. And the LLVM installer for Windows is GUI-based, which'd make it hard to install in CI. Perhaps instead of regenerating bindings at build time we should include the generated bindings in this changset?

Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Fixes #54

Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
Signed-off-by: Victor Porof <victor.porof@gmail.com>
@victorporof victorporof merged commit 97d6a75 into master Sep 5, 2019
@victorporof victorporof deleted the update-lmdb branch September 5, 2019 09:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build mdb.c without optimizations for debug build

2 participants