Skip to content

Commit 05bcd82

Browse files
Merge pull request #9191 from holtrop/rust-wrapper
Create initial Rust wrapper structure
2 parents 72ae012 + d2c16ba commit 05bcd82

File tree

16 files changed

+508
-1
lines changed

16 files changed

+508
-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
@@ -458,6 +458,9 @@ wrapper/Ada/config/
458458
wrapper/Ada/lib/
459459
wrapper/Ada/obj/
460460

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

wrapper/include.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
include wrapper/Ada/include.am
66
include wrapper/CSharp/include.am
7+
include wrapper/rust/include.am
78

89
EXTRA_DIST+= wrapper/python/README.md

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/include.am

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# vim:ft=automake
2+
# included from Top Level Makefile.am
3+
# All paths should be given relative to the root
4+
5+
EXTRA_DIST += wrapper/rust/Makefile
6+
EXTRA_DIST += wrapper/rust/README.md
7+
EXTRA_DIST += wrapper/rust/wolfssl-sys/Cargo.lock
8+
EXTRA_DIST += wrapper/rust/wolfssl-sys/Cargo.toml
9+
EXTRA_DIST += wrapper/rust/wolfssl-sys/Makefile
10+
EXTRA_DIST += wrapper/rust/wolfssl-sys/build.rs
11+
EXTRA_DIST += wrapper/rust/wolfssl-sys/headers.h
12+
EXTRA_DIST += wrapper/rust/wolfssl-sys/src/lib.rs
13+
EXTRA_DIST += wrapper/rust/wolfssl/Cargo.lock
14+
EXTRA_DIST += wrapper/rust/wolfssl/Cargo.toml
15+
EXTRA_DIST += wrapper/rust/wolfssl/Makefile
16+
EXTRA_DIST += wrapper/rust/wolfssl/src/lib.rs

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.

0 commit comments

Comments
 (0)