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

Update libcoap to 4.3.5, bump dependencies, improve linking (incl. ESP32) #15

Merged
merged 12 commits into from
Jul 2, 2024
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
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
crate: [libcoap-sys, libcoap-rs]
dtls_backend: [openssl, gnutls, tinydtls]
dtls_backend: [openssl, gnutls, tinydtls, mbedtls]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -33,9 +33,13 @@ jobs:
with:
packages: libgnutls28-dev libgnutls30
version: 1.0
- if: matrix.crate == 'libcoap-rs'
- if: matrix.crate == 'libcoap-rs' && matrix.dtls_backend != 'gnutls'
JKRhb marked this conversation as resolved.
Show resolved Hide resolved
run: cargo test -p ${{ matrix.crate }} --no-default-features --features dtls,tcp,vendored --features dtls_${{ matrix.dtls_backend }} --features dtls_${{ matrix.dtls_backend }}_vendored --no-fail-fast -- -Z unstable-options --report-time --ensure-time
- if: matrix.crate == 'libcoap-rs' && matrix.dtls_backend == 'gnutls'
run: cargo test -p ${{ matrix.crate }} --no-default-features --features dtls,tcp,vendored --features dtls_${{ matrix.dtls_backend }} --no-fail-fast -- -Z unstable-options --report-time --ensure-time
- if: matrix.crate == 'libcoap-sys'
- if: matrix.crate == 'libcoap-sys' && matrix.dtls_backend != 'gnutls'
run: cargo test -p ${{ matrix.crate }} --features dtls,dtls_backend_${{ matrix.dtls_backend }},dtls_backend_${{ matrix.dtls_backend }}_vendored --no-fail-fast -- -Z unstable-options --report-time --ensure-time
- if: matrix.crate == 'libcoap-sys' && matrix.dtls_backend == 'gnutls'
run: cargo test -p ${{ matrix.crate }} --features dtls,dtls_backend_${{ matrix.dtls_backend }} --no-fail-fast -- -Z unstable-options --report-time --ensure-time

lint:
Expand Down
1 change: 1 addition & 0 deletions .idea/libcoap-rs.iml

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

10 changes: 7 additions & 3 deletions .idea/runConfigurations/Test.xml

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

5 changes: 2 additions & 3 deletions .idea/vcs.xml

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ members = [
"libcoap",
"libcoap-sys",
]
resolver = "2"
31 changes: 22 additions & 9 deletions libcoap-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ authors = ["Hugo Hakim Damer <[email protected]>"]
categories = ["external-ffi-bindings", "network-programming", "embedded"]
keywords = ["coap", "libcoap"]
exclude = ["src/libcoap/ext/"]
resolver = "2"

[features]
# The default features match those of libcoaps configure script, except for dtls, which is disabled here because it
Expand All @@ -34,10 +35,13 @@ default = ["server", "client", "tcp", "async", "epoll", "vendored", "static"]
# different backends), we select one based on the auto-detection order specified in
# https://github.com/obgm/libcoap/blob/develop/configure.ac#L494 (gnutls > openssl > mbedtls > tinydtls).
dtls = []
dtls_backend_openssl = ["dtls", "openssl-sys"]
dtls_backend_gnutls = ["dtls", "gnutls-sys"]
dtls_backend_mbedtls = ["dtls", "mbedtls-sys-auto"]
dtls_backend_tinydtls = ["dtls", "tinydtls-sys"]
dtls_backend_openssl = ["dtls", "dep:openssl-sys"]
dtls_backend_openssl_vendored = ["dtls_backend_openssl", "openssl-sys/vendored"]
dtls_backend_gnutls = ["dtls"]
dtls_backend_mbedtls = ["dtls"] # can't use mbedtls-sys-auto to generate linker flags here, as the crate doesn't support mbedtls >= 3.0.0
dtls_backend_mbedtls_vendored = ["dep:mbedtls-sys-auto", "dtls_backend_mbedtls"]
dtls_backend_tinydtls = ["dtls", "dep:tinydtls-sys", "tinydtls-sys/ecc", "tinydtls-sys/psk"]
dtls_backend_tinydtls_vendored = ["dtls_backend_tinydtls", "tinydtls-sys/vendored"]
# Enabling this feature will force libcoap-sys to be built with and statically linked to a vendored version of libcoap,
# which will be built by the build-script before building libcoap-sys.
# This way, it is no longer required to have libcoap installed to use this crate.
Expand All @@ -61,17 +65,26 @@ client = []
epoll = []

[dependencies]
gnutls-sys = {version = "^0.1.2", optional = true}
openssl-sys = {version = "^0.9.74", optional = true}
mbedtls-sys-auto = {version = "^2.26", optional = true}
openssl-sys = { version = "^0.9.74", optional = true }
mbedtls-sys-auto = { version = "^2.26", optional = true }
libc = "^0.2.126"
tinydtls-sys = {version = "^0.1.2", optional = true}
tinydtls-sys = { version = "^0.2.0", default-features = false, optional = true }

[target.'cfg(target_os="espidf")'.dependencies]
esp-idf-sys = { version = "0.35.0" }

[build-dependencies]
bindgen = "^0.65.1"
bindgen = "0.69.4"
autotools = "^0.2.3"
fs_extra = "^1.2"
pkg-config = "^0.3.24"
regex = "1.10.5"
embuild = { version = "0.32.0", features = ["bindgen", "espidf", "cmake"] }
version-compare = "0.2.0"

[package.metadata.docs.rs]
features = ["dtls", "dtls_backend_openssl", "vendored"]

[[package.metadata.esp-idf-sys.extra_components]]
remote_component = { name = "espressif/coap", version = "4.3.4~3" }
bindings_header = "src/wrapper.h"
Loading
Loading