Skip to content
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

feat: initial support for c bindings #948

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a8edbcd
feat: initial support for c bindings
b5 Apr 12, 2023
47efc12
refactor: use safer_ffi
b5 Apr 24, 2023
39e02a9
working on iOS support
b5 May 4, 2023
151750f
WIP: iOS compilation
b5 May 5, 2023
6b72f06
switch -> iroh-ffi
b5 May 5, 2023
dec7a5f
update for get FSM API
b5 May 5, 2023
34f4310
rename iroh lib to iroh_ffi
b5 May 6, 2023
d76f48e
working on swift compilation
b5 May 16, 2023
c998696
prefix ffi bindings with 'iroh_'
b5 May 16, 2023
f3e9ec0
update c test
b5 May 19, 2023
450e969
refactor: cleanup makefile, Cargo.toml
b5 May 22, 2023
8864622
WIP
b5 Jul 13, 2023
15c45a2
WIP 2
b5 Jul 13, 2023
80cdef8
WIP
b5 Jul 14, 2023
92c15ad
WIP
b5 Jul 14, 2023
d8866b5
WIP
b5 Jul 14, 2023
ad0e3a6
higher ranked lifetime error
b5 Jul 15, 2023
7ba860d
fix runtime execution
dignifiedquire Jul 15, 2023
8591f16
cleanups
b5 Jul 15, 2023
ac98e7d
WIP
b5 Jul 17, 2023
657085e
refactor: move c-header generation into a test
dignifiedquire Jul 18, 2023
30667fd
Merge remote-tracking branch 'origin/main' into b5/irohc
dignifiedquire Jul 18, 2023
b2309ef
add iroh.pc generation
dignifiedquire Jul 18, 2023
4625e7b
make c example program work
dignifiedquire Jul 18, 2023
ec01446
ffi: adjust Cargo.toml
dignifiedquire Jul 18, 2023
eea3c90
Merge remote-tracking branch 'origin/main' into b5/irohc
dignifiedquire Jul 18, 2023
58d1a19
fixup examples and dial
dignifiedquire Jul 18, 2023
a487383
download the full collection into a folder
dignifiedquire Jul 18, 2023
0ed812c
update swift package, build xcframework build script
b5 Jul 19, 2023
facc08c
WIP
b5 Jul 20, 2023
376675a
chore(ci): add ffi bindings to CI (#1270)
Arqu Jul 21, 2023
5ea389b
use patched system-configuration
dignifiedquire Jul 31, 2023
39df477
cleanup
dignifiedquire Jul 31, 2023
1047750
Merge pull request #1318 from n0-computer/fix-swift
dignifiedquire Jul 31, 2023
429d032
Merge remote-tracking branch 'origin/main' into b5/irohc
dignifiedquire Jul 31, 2023
9ffab35
fixup merge
dignifiedquire Jul 31, 2023
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
67 changes: 67 additions & 0 deletions .github/workflows/bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: FFI-CI

on:
pull_request:
push:
branches:
- main

env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.66"

jobs:
build_and_test_ffi_bindings:
name: Build and test ffi bindings
runs-on: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
name: [macOS-latest]
rust: [nightly, stable]
steps:
- name: Checkout
uses: actions/checkout@master
with:
submodules: recursive

- name: Install ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Create a copy of iroh.h
run: |
cd iroh-ffi
touch iroh.h
cp iroh.h iroh.compare.h

- name: tests (all features)
run: |
cd iroh-ffi
cargo test --all-features --lib --bins --tests

- name: tests (no features)
run: |
cd iroh-ffi
cargo test --no-default-features --lib --bins --tests

- name: tests (default features)
run: |
cd iroh-ffi
cargo test --lib --bins --tests

- name: Build and test bindings
run: |
cd iroh-ffi
cargo build --release
cd c/
make build

- name: Compare iroh.h
run: |
cd iroh-ffi
diff iroh.h iroh.compare.h
cmp --silent iroh.h iroh.compare.h || (echo -e "iroh.h file has changed." & (exit 1))
1 change: 1 addition & 0 deletions .github/workflows/netsim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.66"

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
iroh.config.toml
/build
191 changes: 187 additions & 4 deletions Cargo.lock

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

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[workspace]
members = [
"iroh",
"iroh-net",
"iroh-bytes",
"iroh-ffi",
"iroh-metrics",
"iroh-net",
]

[profile.optimized-release]
Expand All @@ -13,3 +14,11 @@ debug-assertions = false
opt-level = 3
panic = 'abort'
incremental = false

[profile.ffi]
inherits = 'release'
strip = "symbols"

[patch.crates-io]
# https://github.com/mullvad/system-configuration-rs/pull/42
system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", branch = "ios-hack" }
Loading
Loading