Skip to content

Commit

Permalink
mdbx: semi-final README for all bindings, including Python's.
Browse files Browse the repository at this point in the history
Related for all bindings: #90, #147, #148, #114, etc.
  • Loading branch information
erthink committed Jun 26, 2021
1 parent 11eebec commit ba0dd1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
It seems that we should stop these experiment and never mix the build of the library itself with the binding for a runtimes/languages that have their own build/import infrastructure.

The main problem is that with this way we should to use already (reasonable) selected tools (i.e. `GNU make` and `CMake`) to build a bindings.
This lead to a build hell, since instead of using ready-made solutions, we need to re-implement them using GNU Make and CMake, simultaneously integrate with present build features and scenarios.

Therefore, the basic rules for bindings are as follows:

1. Never mix-in a bindings which requires more than GNU Make and CMake using in a traditional way (actually only C++ bindings are satisfy this).
2. Bindings MUST build _libmdbx_ by the `CMake` scripts which are provide here or should use a pre-builded and installed to a system library (e.g. in a _Buildroot_ case).
3. For bindings are proposed to use the amalgamated source code of _libmdbx_ (i.e. releases snapshots) and optionally be able to use libmdbx as a git submodule.
4. Bindings MUST use a shared variant of _libmdbx_, with exception for embedded platforms without shared libraries support.
5. Bindings MUST must be cross-interoperable each with others, i.e. MUST NOT use build options that lead to incompatibility, and thus an applications written in `Python`, `Rust` and `C++` will be able use a single DB with a single shared instance of _libmdbx_.

1 comment on commit ba0dd1d

@github-actions
Copy link

@github-actions github-actions bot commented on ba0dd1d Jun 26, 2021

Choose a reason for hiding this comment

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

@check-spelling-bot Report

Unrecognized words, please review:

  • Erro
  • gettempdir
  • interoperable
  • jnwatson
  • nosql
  • OLDAP
  • runme
  • runtimes
  • tempfile
Previously acknowledged words that are now absent LIBLOCATION prealloc
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the [email protected]:erthink/libmdbx.git repository
on the python-bindings branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/erthink/libmdbx/comments/52703550" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")
  

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u

Please sign in to comment.