forked from isar/isar
-
Notifications
You must be signed in to change notification settings - Fork 36
[mdbx_sys] README.md and build.rs to fix Windows build #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
psengrith
wants to merge
2
commits into
isar-community:v3
Choose a base branch
from
psengrith:mdbx_sys_fix
base: v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# mdbx_sys | ||
|
||
Rust binding of mdbx. | ||
|
||
## Build Setup (for Windows) | ||
|
||
For triplet `x86_64-pc-windows-msvc` | ||
|
||
1. Install rust to use triplet `x86_64-pc-windows-msvc`. | ||
|
||
2. Install [MSYS2](https://www.msys2.org/). | ||
|
||
- Make sure to add `msys\usr\bin` to environment variable `PATH`. | ||
|
||
3. Use MSYS2 package manager to install neccessary build tools: | ||
|
||
```{bash} | ||
pacman -S --needed make | ||
``` | ||
|
||
- Make sure to add `msys\mingw64\bin` to environment variable `PATH`. | ||
|
||
3. Install `clang >=5.0 <= 15.0` (as a workaround for [#2500](https://github.com/rust-lang/rust-bindgen/issues/2500#issuecomment-1640545912)) from [llvm-project](https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.7). | ||
|
||
- Make sure to add `path\to\bin\libclang.dll` to environment variable `LIBCLANG_PATH`. | ||
- Make sure option `MSVC`, `Windows SDK` and `C++ CMake tool for Windows` is selected when installing `Desktop Development with C++` build tool by using [Visual Studio Build Tools 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16) | ||
|
||
1. Install [CMake](https://cmake.org/download/), and configure enivronment variable. | ||
|
||
2. Restart `VSCode` instance to reload the environment variables. Then, build the library, and it should be successfully build 😀! | ||
|
||
<!-- [Broken] For triplet `x86_64-pc-windows-gnu` | ||
1. Install rust to use triplet `x86_64-pc-windows-gnu`. | ||
|
||
2. Install [MSYS2](https://www.msys2.org/). | ||
|
||
- Make sure to add `msys\usr\bin` to environment variable `PATH`. | ||
|
||
3. Use MSYS2 package manager to install neccessary build tools: | ||
|
||
```{bash} | ||
pacman -S --needed make mingw-w64-x86_64-cmake mingw-w64-x86_64-rust mingw-w64-x86-64-clang | ||
``` | ||
|
||
- Make sure to add `msys\mingw64\bin` to environment variable `PATH`. | ||
- Make sure to add `path\to\bin\libclang.dll` to environment variable `LIBCLANG_PATH`. | ||
|
||
4. Restart VCCode instance to reload the environment variables. Then, build the library, and it should be successfully build 😀! --> | ||
|
||
## Other Unix/Linux-Based OS | ||
|
||
1. Install `build-essential` and `clang >= 5.0 <=15.0` [bindgen requirements](https://rust-lang.github.io/rust-bindgen/requirements.html). | ||
2. Build the library, and it should be successfully build 😀! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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()
ormdbx_env_delete()
should be using.Please contact me if you have questions/feedback, or need more API.
Regards.