meilisearch / heed

A fully typed LMDB wrapper with minimum overhead 🐦
https://docs.rs/heed
MIT License
569 stars 52 forks source link

Expose a function to return the LMDB version #199

Closed Kerollmops closed 1 year ago

Kerollmops commented 1 year ago

I want to expose a very simple function that returns the major, minor, and patch versions of the underlying LMDB library.

fn heed::lmdb_version() -> (major, minor, patch);
postmeback commented 1 year ago

I will give it a try !

postmeback commented 1 year ago

Getting error while cargo build

error: failed to run custom build command for lmdb-master-sys v0.1.0 (C:\Projects\Rust\Github\199-fix\lmdb-master-sys)

Caused by: process didn't exit successfully: C:\Projects\Rust\Github\199-fix\target\debug\build\lmdb-master-sys-4cded00d7d715647\build-script-build (exit code: 1) --- stdout TARGET = Some("x86_64-pc-windows-msvc") OPT_LEVEL = Some("0") HOST = Some("x86_64-pc-windows-msvc") cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") DEBUG = Some("true") cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None running: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-FoC:\Projects\Rust\Github\199-fix\target\debug\build\lmdb-master-sys-543b8494d1ec48d1\out\c5dfcf082afb74ec-mdb.o" "-c" "C:\Projects\Rust\Github\199-fix\lmdb-master-sys\lmdb\libraries\liblmdb\mdb.c" mdb.c c1: fatal error C1083: Cannot open source file: 'C:\Projects\Rust\Github\199-fix\lmdb-master-sys\lmdb\libraries\liblmdb\mdb.c': No such file or directory
exit code: 2

--- stderr

error occurred: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-FoC:\Projects\Rust\Github\199-fix\target\debug\build\lmdb-master-sys-543b8494d1ec48d1\out\c5dfcf082afb74ec-mdb.o" "-c" "C:\Projects\Rust\Github\199-fix\lmdb-master-sys\lmdb\libraries\liblmdb\mdb.c" with args "cl.exe" did not execute successfully (status code exit code: 2).

warning: build failed, waiting for other jobs to finish...

postmeback commented 1 year ago

And also, where exactly should i write the function ?

Kerollmops commented 1 year ago

Hey @postmeback 👋

Getting error while cargo build

You should read the README when you build from source. You probably forgot to pull the LMDB sources.

And also, where exactly should i write the function ?

Put in at the root of the project, in the heed lib.rs file, please.