Skip to content

Commit 167e76a

Browse files
Create initial Rust wrapper structure
Generate bindings to C library with bindgen Add github CI workflow to build Rust wrapper
1 parent dc421a0 commit 167e76a

File tree

14 files changed

+491
-1
lines changed

14 files changed

+491
-1
lines changed

.github/workflows/rust-wrapper.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Rust Wrapper
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfssl:
17+
name: Build wolfSSL Rust Wrapper
18+
if: github.repository_owner == 'wolfssl'
19+
runs-on: ubuntu-24.04
20+
# This should be a safe limit for the tests to run.
21+
timeout-minutes: 10
22+
steps:
23+
- name: Build wolfSSL
24+
uses: wolfSSL/actions-build-autotools-project@v1
25+
with:
26+
path: wolfssl
27+
configure: --enable-all
28+
- name: Build Rust Wrapper
29+
working-directory: wolfssl
30+
run: make -C wrapper/rust

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ aclocal.m4
3333
aminclude.am
3434
lt*.m4
3535
Makefile.in
36-
Makefile
36+
/Makefile
3737
depcomp
3838
missing
3939
libtool
@@ -457,6 +457,9 @@ wrapper/Ada/config/
457457
wrapper/Ada/lib/
458458
wrapper/Ada/obj/
459459

460+
# Rust wrapper files
461+
/wrapper/rust/*/target/
462+
460463
# PlatformIO
461464
/**/.pio
462465
/**/.vscode/.browse.c_cpp.db*

wrapper/rust/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: all
2+
all:
3+
+$(MAKE) -C wolfssl-sys
4+
+$(MAKE) -C wolfssl
5+
6+
.PHONY: clean
7+
clean:
8+
+$(MAKE) -C wolfssl-sys clean
9+
+$(MAKE) -C wolfssl clean

wrapper/rust/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# wolfSSL Rust Wrapper
2+
3+
## Building the wolfssl Rust Wrapper
4+
5+
First, configure and build wolfssl C library.
6+
7+
Then build the wolfssl Rust wrapper with:
8+
9+
make -C wrapper/rust
10+
11+
## Repository Directory Structure
12+
13+
| Repository Directory | Description |
14+
| --- | --- |
15+
| `/wrapper/rust` | Top level container for all Rust wrapper functionality. |
16+
| `/wrapper/rust/wolfssl` | Top level for the `wolfssl` library crate. This crate contains high-level Rust sources that use the bindings from the `wolfssl-sys` crate. |
17+
| `/wrapper/rust/wolfssl-sys` | Top level for the `wolfssl-sys` library crate. This crate contains only automatically generated bindings to the `wolfssl` C library. |

wrapper/rust/wolfssl-sys/Cargo.lock

Lines changed: 293 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "wolfssl-sys"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[features]
7+
std = []
8+
9+
[build-dependencies]
10+
bindgen = "0.72.1"
11+
12+
[profile.release]
13+
strip = true
14+
opt-level = "s"
15+
lto = true
16+
codegen-units = 1
17+
panic = "abort"

wrapper/rust/wolfssl-sys/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: all
2+
all:
3+
cargo build
4+
5+
.PHONY: clean
6+
clean:
7+
cargo clean

0 commit comments

Comments
 (0)