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(bindings): pin jobserver in more places and run cargo publish --dry-run in generate.sh #4255

Merged
merged 5 commits into from
Nov 16, 2023
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
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" ]]
Loading