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

ci: fix dependabot, commit & check Cargo.toml #5065

Merged
merged 9 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ updates:
# restricted-MSRV, so don't do batch updates
- package-ecosystem: "cargo"
directories:
- "/bindings/rust"
- "/bindings/rust/standard"
- "/bindings/rust/extended"
schedule:
interval: "daily"
47 changes: 47 additions & 0 deletions .github/workflows/check_cargo.yml
goatgoose marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Check Cargo

on:
pull_request:
branches: [main]

env:
# Extended support MSRV
ROOT_PATH: bindings/rust/extended

jobs:
generate:
goatgoose marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
id: toolchain
run: |
rustup toolchain install stable
rustup override set stable

# https://github.com/aws/aws-lc-rs/blob/main/aws-lc-fips-sys/README.md#build-prerequisites
# go required for generate.sh to build aws-lc-rs in FIPS mode
- name: Install go
uses: actions/setup-go@v5
with:
go-version: '>=1.18'
goatgoose marked this conversation as resolved.
Show resolved Hide resolved

- uses: camshaft/rust-cache@v1

- name: Generate
run: ${{env.ROOT_PATH}}/generate.sh

- name: Compare Cargo
working-directory: ${{env.ROOT_PATH}}/s2n-tls-sys
id: diff
run: git diff --exit-code Cargo.toml
continue-on-error: true

- name: Failure
if: steps.diff.outcome != 'success'
run: |
echo "Please update the Cargo.toml in s2n-tls-sys"
exit 1

goatgoose marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion bindings/rust/extended/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ s2n-tls-sys/lib
s2n-tls-sys/src/api.rs
s2n-tls-sys/src/tests.rs
s2n-tls-sys/src/features*
s2n-tls-sys/Cargo.toml
8 changes: 4 additions & 4 deletions bindings/rust/extended/generate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ fn main() {
}

// generate a cargo.toml that defines the correct features
let features_definition_token = unstable_headers
let mut features_definition_token = unstable_headers
.iter()
.map(|(header_name, _header)| format!("unstable-{header_name} = []"))
.collect::<Vec<String>>()
.join("\n");
.collect::<Vec<String>>();
features_definition_token.sort();
let cargo_template = out_dir.join("templates/Cargo.template");
let cargo_template = read_to_string(cargo_template).expect("unable to read cargo template");
let cargo_toml = cargo_template.replace(FEATURE_TOKEN_PLACEHOLDER, &features_definition_token);
let cargo_toml = cargo_template.replace(FEATURE_TOKEN_PLACEHOLDER, &(features_definition_token.join("\n")));
fs::write(out_dir.join("Cargo.toml"), cargo_toml).unwrap();

// generate a features.rs that includes the correct modules
Expand Down
1 change: 0 additions & 1 deletion bindings/rust/extended/rust-toolchain

This file was deleted.

2 changes: 2 additions & 0 deletions bindings/rust/extended/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.63.0"
57 changes: 57 additions & 0 deletions bindings/rust/extended/s2n-tls-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "s2n-tls-sys"
description = "A C99 implementation of the TLS/SSL protocols"
version = "0.3.10"
authors = ["AWS s2n"]
edition = "2021"
rust-version = "1.63.0"
links = "s2n-tls"
repository = "https://github.com/aws/s2n-tls"
license = "Apache-2.0"
include = [
"build.rs",
"Cargo.toml",
"files.rs",
"lib/**/*.c",
"lib/**/*.h",
"lib/**/*.S",
"lib/CMakeLists.txt",
"lib/**/*.cmake",
"lib/**/*.flags", # for feature probes
"src/**/*.rs",
"tests/**/*.rs",
]

[features]
default = []
# preserve the cmake feature in case any consumers had it enabled before
cmake = []
quic = []
fips = ["aws-lc-rs/fips"]
pq = []
internal = []
stacktrace = []
unstable-cleanup = []
unstable-crl = []
unstable-fingerprint = []
unstable-ktls = []
unstable-npn = []
unstable-renegotiate = []
# e.g. something like
# unstable-foo = []

[dependencies]
# aws-lc-rs 1.6.4 adds DEP_AWS_LC environment variables which are required to build s2n-tls-sys:
# https://github.com/aws/aws-lc-rs/pull/335
aws-lc-rs = { version = "1.6.4" }
# aws-lc-rs 1.6.4 depends on aws-lc-sys 0.14.0, which requires libc 0.2.121:
# https://github.com/aws/aws-lc-rs/blob/2298ca861234d4f43aecef2c7d7e822c60bc488a/aws-lc-sys/Cargo.toml#L65
libc = "0.2.121"

[build-dependencies]
cc = { version = "1.0.100", features = ["parallel"] }

[dev-dependencies]
home = "=0.5.5" # newer versions require rust 1.70, see https://github.com/aws/s2n-tls/issues/4395
regex = "=1.9.6" # newer versions require rust 1.65, see https://github.com/aws/s2n-tls/issues/4242
zeroize = "=1.7.0" # newer versions require rust 1.72, see https://github.com/aws/s2n-tls/issues/4518
1 change: 0 additions & 1 deletion bindings/rust/standard/bench/rust-toolchain

This file was deleted.

2 changes: 2 additions & 0 deletions bindings/rust/standard/bench/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "stable"
1 change: 0 additions & 1 deletion bindings/rust/standard/rust-toolchain

This file was deleted.

2 changes: 2 additions & 0 deletions bindings/rust/standard/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.74.0"
Loading