Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

[mdbx_sys] README.md and build.rs to fix Windows build#91

Open
psengrith wants to merge 2 commits intoisar-community:v3from
psengrith:mdbx_sys_fix
Open

[mdbx_sys] README.md and build.rs to fix Windows build#91
psengrith wants to merge 2 commits intoisar-community:v3from
psengrith:mdbx_sys_fix

Conversation

@psengrith
Copy link

This pull request updates the following files in the mdbx_sys package:

  1. Add README.md which explains steps to properly build the package on Windows for Rust Development.
  2. Minor update to build.rs to fix build errors on Windows: Specifically, the new script introduces workarounds to solve:
  • bindgen incompatibility with clang (#2500), and
  • -D MDBX_LOCK_SUFFIX was properly configured for Windows build through CMake. This could potentially result in undefined behavior in Windows since the isar logic (e.g., IsarInstance::close_internal) is hard-coded to depend on the suffix .lock.
  1. Minor update to packages/isar/README.md 😀!

Note: This an updated pull request of the amended #87 (because directory structure mistake)

@psengrith psengrith marked this pull request as draft June 29, 2024 12:06
@psengrith psengrith changed the title [mdbx_sys] README.md and build.rs fix to window builds [mdbx_sys] README.md and build.rs to fix Windows build Jun 29, 2024
@psengrith psengrith marked this pull request as ready for review June 29, 2024 12:09
@mrclauss
Copy link

@vicenterusso Do you have an idea why the github action workflow did not build this pull request?

@vicenterusso
Copy link
Member

@vicenterusso Do you have an idea why the github action workflow did not build this pull request?

No clue, maybe because it was marked as a draft? just guessing..

let h_path = mdbx.join("mdbx.h");
let mut headers = fs::read_to_string(h_path.as_path()).expect("dist/mdbx.h was not found!");
// A temporary workaround since -DMDBX_LOCK_SUFFIX has no effect.
headers = headers.replace("\"-lck\"", "\".lock\"");
Copy link

Choose a reason for hiding this comment

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

This is wrong solution with could break both libmdbx API functions and internal handling of pathname.

In general LCK-file is a libmdbx' internals and should be avoid used outside.
If you need to manipulate DB files, then the mdbx_env_copy() or mdbx_env_delete() should be using.

Please contact me if you have questions/feedback, or need more API.
Regards.

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.

4 participants