-
Notifications
You must be signed in to change notification settings - Fork 43
feat(sdk): ffi support and swift bindings #2661
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
base: v2.0-dev
Are you sure you want to change the base?
Changes from all commits
ee755aa
6adc716
fd7ce13
1d10634
d01cd9b
efb64cf
afbb390
b76a342
85bedad
a3e7d27
bd2aa90
7df79c4
00e18fe
cdbe84e
78bb3ed
9295685
8c9642e
a43c67f
77a17e6
cb4cc31
ad333cc
21fb1b2
4a3f2db
1022009
2eb6d08
b7802d2
aa96f4c
ebfcfd2
182fe70
189b17d
2892fc0
d99bb62
33b470d
96d0ea2
a38268e
5e997f7
b73419a
a63d61e
3dacba6
a599d16
faa5933
93016ae
719e89d
d93094d
b1d3d15
a0a2be1
84eed10
8757f3a
56434ee
a54c27a
2b12a5f
ff7d5f7
2582392
81975f4
63b2b38
8b68aae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Test rs-sdk-ffi build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'packages/rs-sdk-ffi/**' | ||
- 'packages/rs-sdk/**' | ||
- '.github/workflows/tests-rs-sdk-ffi-build.yml' | ||
push: | ||
branches: | ||
- master | ||
- 'v[0-9]+\.[0-9]+-dev' | ||
paths: | ||
- 'packages/rs-sdk-ffi/**' | ||
- 'packages/rs-sdk/**' | ||
- '.github/workflows/tests-rs-sdk-ffi-build.yml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-ffi-cross-compile: | ||
name: Build FFI for Apple target | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: ./.github/actions/rust | ||
with: | ||
target: aarch64-apple-darwin | ||
|
||
- name: Install cross-compilation dependencies | ||
run: | | ||
# Install osxcross or other cross-compilation tools if needed | ||
# For now, we'll just add the target | ||
rustup target add aarch64-apple-darwin | ||
|
||
Comment on lines
+36
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Install the full cross-compilation toolchain. Simply adding the Rust target isn’t sufficient to link for - run: |
- # Install osxcross or other cross-compilation tools if needed
- # For now, we'll just add the target
- rustup target add aarch64-apple-darwin
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y clang cmake libssl-dev xz-utils
+ # (Optional) Install osxcross toolchain here if your setup requires it.
+ rustup target add aarch64-apple-darwin 🤖 Prompt for AI Agents
|
||
- name: Build FFI library for Apple target | ||
working-directory: packages/rs-sdk-ffi | ||
env: | ||
# Set up cross-compilation environment variables if needed | ||
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER: rust-lld | ||
run: | | ||
cargo build --release --target aarch64-apple-darwin | ||
|
||
- name: Verify build output | ||
run: | | ||
if [ ! -f "target/aarch64-apple-darwin/release/librs_sdk_ffi.a" ]; then | ||
echo "Error: FFI library was not built for Apple target" | ||
exit 1 | ||
fi | ||
echo "FFI library successfully built for Apple target" | ||
ls -la target/aarch64-apple-darwin/release/librs_sdk_ffi.a |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Fix branch filter pattern to use glob syntax.
The string
'v[0-9]+\.[0-9]+-dev'
is interpreted as a literal glob and won’t match branches likev1.2-dev
. Replace it with a valid glob, for example:📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
13-13: character '' is invalid for branch and tag names. only special characters [, ?, +, *, , ! can be escaped with . see
man git-check-ref-format
for more details. note that regular expression is unavailable. note: filter pattern syntax is explained at https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet(glob)
🤖 Prompt for AI Agents