File tree 5 files changed +95
-6
lines changed
5 files changed +95
-6
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ updates:
31
31
# restricted-MSRV, so don't do batch updates
32
32
- package-ecosystem : " cargo"
33
33
directories :
34
- - " /bindings/rust"
34
+ - " /bindings/rust/standard"
35
+ - " /bindings/rust/extended"
35
36
schedule :
36
37
interval : " daily"
Original file line number Diff line number Diff line change @@ -423,3 +423,35 @@ jobs:
423
423
run : |
424
424
cargo +${{env.RUST_NIGHTLY_TOOLCHAIN}} minimal-versions check --direct --ignore-private
425
425
cargo +${{env.RUST_NIGHTLY_TOOLCHAIN}} minimal-versions check --direct --ignore-private --all-features
426
+
427
+ # compare generated s2n-tls-sys/Cargo.toml with the existing one to check if it's up-to-date
428
+ # unstable features might be updated in the future, new Cargo.toml should be committed in this case
429
+ check-generated-cargo-toml :
430
+ runs-on : ubuntu-latest
431
+ steps :
432
+ - uses : actions/checkout@v4
433
+
434
+ - name : Install Rust toolchain
435
+ id : toolchain
436
+ run : |
437
+ rustup toolchain install stable
438
+ rustup override set stable
439
+
440
+ - uses : camshaft/rust-cache@v1
441
+
442
+ - name : Generate
443
+ run : ${{env.ROOT_PATH}}/generate.sh --skip-tests
444
+
445
+ - name : Compare Cargo
446
+ working-directory : ${{env.ROOT_PATH}}/s2n-tls-sys
447
+ id : diff
448
+ run : git diff --exit-code Cargo.toml
449
+ continue-on-error : true
450
+
451
+ - name : Failure
452
+ if : steps.diff.outcome != 'success'
453
+ run : |
454
+ echo "A mismatch between the existing s2n-tls-sys/Cargo.toml and the Cargo.toml generated \
455
+ from s2n-tls-sys/templates/Cargo.template has been found. Please ensure that the committed \
456
+ Cargo.toml is up-to-date by regenerating it with ${{env.ROOT_PATH}}/generate.sh"
457
+ exit 1
Original file line number Diff line number Diff line change @@ -7,4 +7,3 @@ s2n-tls-sys/lib
7
7
s2n-tls-sys /src /api.rs
8
8
s2n-tls-sys /src /tests.rs
9
9
s2n-tls-sys /src /features *
10
- s2n-tls-sys /Cargo.toml
Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ fn main() {
88
88
}
89
89
90
90
// generate a cargo.toml that defines the correct features
91
- let features_definition_token = unstable_headers
91
+ let mut features_definition_token = unstable_headers
92
92
. iter ( )
93
93
. map ( |( header_name, _header) | format ! ( "unstable-{header_name} = []" ) )
94
- . collect :: < Vec < String > > ( )
95
- . join ( " \n " ) ;
94
+ . collect :: < Vec < String > > ( ) ;
95
+ features_definition_token . sort ( ) ;
96
96
let cargo_template = out_dir. join ( "templates/Cargo.template" ) ;
97
97
let cargo_template = read_to_string ( cargo_template) . expect ( "unable to read cargo template" ) ;
98
- let cargo_toml = cargo_template. replace ( FEATURE_TOKEN_PLACEHOLDER , & features_definition_token) ;
98
+ let cargo_toml = cargo_template. replace ( FEATURE_TOKEN_PLACEHOLDER , & ( features_definition_token. join ( " \n " ) ) ) ;
99
99
fs:: write ( out_dir. join ( "Cargo.toml" ) , cargo_toml) . unwrap ( ) ;
100
100
101
101
// generate a features.rs that includes the correct modules
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " s2n-tls-sys"
3
+ description = " A C99 implementation of the TLS/SSL protocols"
4
+ version = " 0.3.10"
5
+ authors = [" AWS s2n" ]
6
+ edition = " 2021"
7
+ rust-version = " 1.63.0"
8
+ links = " s2n-tls"
9
+ repository = " https://github.com/aws/s2n-tls"
10
+ license = " Apache-2.0"
11
+ include = [
12
+ " build.rs" ,
13
+ " Cargo.toml" ,
14
+ " files.rs" ,
15
+ " lib/**/*.c" ,
16
+ " lib/**/*.h" ,
17
+ " lib/**/*.S" ,
18
+ " lib/CMakeLists.txt" ,
19
+ " lib/**/*.cmake" ,
20
+ " lib/**/*.flags" , # for feature probes
21
+ " src/**/*.rs" ,
22
+ " tests/**/*.rs" ,
23
+ ]
24
+
25
+ [features ]
26
+ default = []
27
+ # preserve the cmake feature in case any consumers had it enabled before
28
+ cmake = []
29
+ quic = []
30
+ fips = [" aws-lc-rs/fips" ]
31
+ pq = []
32
+ internal = []
33
+ stacktrace = []
34
+ unstable-cleanup = []
35
+ unstable-crl = []
36
+ unstable-fingerprint = []
37
+ unstable-ktls = []
38
+ unstable-npn = []
39
+ unstable-renegotiate = []
40
+ # e.g. something like
41
+ # unstable-foo = []
42
+
43
+ [dependencies ]
44
+ # aws-lc-rs 1.6.4 adds DEP_AWS_LC environment variables which are required to build s2n-tls-sys:
45
+ # https://github.com/aws/aws-lc-rs/pull/335
46
+ aws-lc-rs = { version = " 1.6.4" }
47
+ # aws-lc-rs 1.6.4 depends on aws-lc-sys 0.14.0, which requires libc 0.2.121:
48
+ # https://github.com/aws/aws-lc-rs/blob/2298ca861234d4f43aecef2c7d7e822c60bc488a/aws-lc-sys/Cargo.toml#L65
49
+ libc = " 0.2.121"
50
+
51
+ [build-dependencies ]
52
+ cc = { version = " 1.0.100" , features = [" parallel" ] }
53
+
54
+ [dev-dependencies ]
55
+ home = " =0.5.5" # newer versions require rust 1.70, see https://github.com/aws/s2n-tls/issues/4395
56
+ regex = " =1.9.6" # newer versions require rust 1.65, see https://github.com/aws/s2n-tls/issues/4242
57
+ zeroize = " =1.7.0" # newer versions require rust 1.72, see https://github.com/aws/s2n-tls/issues/4518
You can’t perform that action at this time.
0 commit comments