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

fix(api/unstable): make all api methods visible #4015

Merged
merged 17 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 11 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: 8 additions & 2 deletions .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ jobs:
run: cargo test

- name: Test external build
# if this test is failing, make sure that api headers are appropriately
# included. For a symbol to be visible in a shared lib, the
# __attribute__((visibility("default"))) label must be on a declaration
# in the same unit of compilation as the definition. Generally this just
# means that if the linker can't resolve foo_method in tls/foo.c, you
# forgot to include api/unstable/foo.h in tls/foo.c
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cmake . -Bbuild -DBUILD_SHARED_LIBS=on -DBUILD_TESTING=off
cmake --build build
cmake --build build -- -j $(nproc)

export S2N_TLS_LIB_DIR=`pwd`/build/lib
export S2N_TLS_INCLUDE_DIR=`pwd`/api
Expand Down Expand Up @@ -124,7 +130,7 @@ jobs:
run: grep "rust-version = \"$(cat ${{env.ROOT_PATH}}/rust-toolchain)\"" ${{env.ROOT_PATH}}/s2n-tls/Cargo.toml

- name: Check MSRV of s2n-tls-sys
run: grep "rust-version = \"$(cat ${{env.ROOT_PATH}}/rust-toolchain)\"" ${{env.ROOT_PATH}}/s2n-tls-sys/Cargo.toml
run: grep "rust-version = \"$(cat ${{env.ROOT_PATH}}/rust-toolchain)\"" ${{env.ROOT_PATH}}/s2n-tls-sys/templates/Cargo.template

- name: Check MSRV of s2n-tokio
run: grep "rust-version = \"$(cat ${{env.ROOT_PATH}}/rust-toolchain)\"" ${{env.ROOT_PATH}}/s2n-tls-tokio/Cargo.toml
Expand Down
3 changes: 2 additions & 1 deletion bindings/rust/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Cargo.lock
s2n-tls-sys/files.rs
s2n-tls-sys/lib
s2n-tls-sys/src/api.rs
s2n-tls-sys/src/quic.rs
s2n-tls-sys/src/tests.rs
s2n-tls-sys/src/features*
Cargo.toml
7 changes: 6 additions & 1 deletion bindings/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[workspace]
members = [
"generate",
"integration",
"s2n-tls",
"s2n-tls-sys",
"s2n-tls-tokio",
]
# generate can't be included in the workspace because of a bootstrapping problem
# s2n-tls-sys/Cargo.toml (part of the workspace) is generated by
# generate/main.rs
exclude = [
"generate"
]

[profile.release]
lto = true
Expand Down
9 changes: 4 additions & 5 deletions bindings/rust/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")"
rm -rf s2n-tls-sys/lib
mkdir -p s2n-tls-sys/lib
mkdir -p s2n-tls-sys/lib/tests
mkdir -p s2n-tls-sys/src/features

# we copy the C sources into the `lib` directory so they get published in the
# actual crate artifact.
Expand All @@ -36,16 +37,14 @@ cp -r \
# generate the bindings modules from the copied sources
pushd generate
cargo run -- ../s2n-tls-sys
popd
popd

# make sure everything builds and passes sanity checks
pushd s2n-tls-sys
cargo test
cargo test --features pq
cargo test --features quic
cargo test --features internal
cargo test --all-features
cargo test --release
cargo publish --dry-run --allow-dirty
cargo publish --dry-run --allow-dirty
cargo publish --dry-run --allow-dirty --all-features
popd

Expand Down
3 changes: 2 additions & 1 deletion bindings/rust/generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ license = "Apache-2.0"
publish = false

[dependencies]
bindgen = "0.58"
bindgen = "0.65"
glob = "0.3"
regex = "1"
Loading