Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add negentropy-ffi #4

Merged
merged 6 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,36 @@ jobs:
- name: Clippy
if: ${{ matrix.rust.version != '1.48.0' }}
run: cargo clippy ${{ matrix.build-args }} -- -D warnings

build-ffi:
name: Build FFI
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./negentropy-ffi
strategy:
matrix:
rust:
- version: stable # STABLE
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-ffi-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Set profile
run: rustup set profile minimal && rustup component add clippy
- name: Build
run: cargo build
- name: Tests
run: cargo test
- name: Clippy
run: cargo clippy -- -D warnings

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target
/Cargo.lock
*.svg
perf.data
perf.data.old
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ precommit:
cargo fmt --all -- --config format_code_in_doc_comments=true
cargo clippy -p negentropy && cargo clippy -p negentropy --no-default-features
cargo test -p negentropy && cargo test -p negentropy --no-default-features
cd ./negentropy-ffi && make precommit

bench:
RUSTFLAGS='--cfg=bench' cargo +nightly bench -p negentropy
Expand All @@ -13,4 +14,4 @@ clean:
cargo clean

loc:
@echo "--- Counting lines of .rs files (LOC):" && find src/ -type f -name "*.rs" -exec cat {} \; | wc -l
@echo "--- Counting lines of .rs files (LOC):" && find negentropy* -type f -name "*.rs" -exec cat {} \; | wc -l
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Implementation of the [negentropy](https://github.com/hoytech/negentropy) set-re
The project is split up into many crates:

* [**negentropy**](./negentropy/): Rust implementation of the negentropy set-reconciliation protocol
* [**negentropy-ffi**](./negentropy-ffi/): UniFFI bindings (Swift, Kotlin and Python) of the [negentropy](./negentropy/) crate (TODO)
* [**negentropy-ffi**](./negentropy-ffi/): UniFFI bindings (Swift, Kotlin and Python) of the [negentropy](./negentropy/) crate

## Flame Graph and perf

Expand Down
2 changes: 2 additions & 0 deletions negentropy-ffi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
ffi/
Loading