Skip to content

Commit

Permalink
fix(bindings): pin jobserver in more places and run cargo publish --…
Browse files Browse the repository at this point in the history
…dry-run in generate.sh (#4255)

* fix(bindings): pin jobserver in more places

* add back newline
  • Loading branch information
WesleyRosenblum authored Nov 16, 2023
1 parent 690298b commit 5bc8d63
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bindings/rust/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ cargo publish --dry-run --allow-dirty
cargo publish --dry-run --allow-dirty --all-features
popd

# if this version has already been published we can run
# additional validation to ensure there won't be build
# problems when a new version is published
if ! ./scripts/detect-new-release; then
pushd s2n-tls
cargo publish --dry-run --allow-dirty
popd

pushd s2n-tls-tokio
cargo publish --dry-run --allow-dirty
popd
fi

pushd integration
cargo run
popd
Expand Down
5 changes: 5 additions & 0 deletions bindings/rust/s2n-tls-tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ tokio = { version = "1", features = ["net", "time"] }
clap = { version = "3", features = ["derive"] }
rand = { version = "0.8" }
tokio = { version = "1", features = [ "io-std", "io-util", "macros", "net", "rt-multi-thread", "test-util", "time"] }
# newer versions require rust 1.66, see https://github.com/aws/s2n-tls/issues/4241
# this version pin is only needed to prevent verification failures when using
# cargo package / cargo publish, as those commands do not respect the version pin
# in downstream dev-dependencies (in s2n-tls-sys, in this case)
jobserver = "=0.1.26"
5 changes: 5 additions & 0 deletions bindings/rust/s2n-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ futures-test = "0.3"
openssl = "0.10"
temp-env = "0.3"
checkers = "0.6"
# newer versions require rust 1.66, see https://github.com/aws/s2n-tls/issues/4241
# this version pin is only needed to prevent verification failures when using
# cargo package / cargo publish, as those commands do not respect the version pin
# in downstream dev-dependencies (in s2n-tls-sys, in this case)
jobserver = "=0.1.26"
17 changes: 17 additions & 0 deletions bindings/rust/scripts/detect-new-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#

set -e

# cd into the script directory so it can be executed from anywhere
pushd "$(dirname "${BASH_SOURCE[0]}")"

LOCAL_VERSION=$(cargo metadata --manifest-path ../Cargo.toml --no-deps --format-version 1 | jq --raw-output -c '.packages[] | select(.name == "s2n-tls").version')
CRATES_IO_VERSION=$(cargo search "s2n-tls" --limit 1 | head -n 1 | cut -d'"' -f2)

# Exits with 0 if the local version has not been published to crates.io yet, otherwise exits with 1
[[ "$LOCAL_VERSION" != "$CRATES_IO_VERSION" ]]

0 comments on commit 5bc8d63

Please sign in to comment.