You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/ci-build/sdk-lockfiles/README.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,41 @@ sdk-lockfiles
2
2
=============
3
3
4
4
This CLI tool audits the `Cargo.lock` files in the `smithy-rs` repository. These lockfiles are used to ensure
5
-
reproducible builds. The `sdk-lockfiles` tool specifically audits the following lockfiles:
6
-
- The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/rust-runtime/Cargo.lock) for Smithy runtime crates
7
-
- The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/rust-runtime/Cargo.lock) for AWS runtime crates
8
-
- The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/rust-runtime/aws-config/Cargo.lock) for the `aws-config` crate
9
-
- The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/sdk/Cargo.lock) for the workspace containing code-generated AWS SDK crates (*)
5
+
reproducible builds during our release process for both `smithy-rs` and `aws-sdk-rust`. When a crate dependency is not
6
+
pinned to a fixed version, it risks being affected by newer versions of that dependency published to crates.io, which
7
+
could potentially break the build.
10
8
11
-
Specifically, the tool ensures that the lockfile marked with (*) is a superset containing all dependencies listed in
12
-
the rest of the runtime lockfiles. If it detects a new dependency in the AWS SDK crates introduced by any of the runtime
13
-
lockfiles (unless the dependency is introduced by a server runtime crate), it will output a message similar to the
14
-
following:
9
+
We track the following lockfiles in the `smithy-rs` repository:
10
+
1. The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/rust-runtime/Cargo.lock) for Smithy runtime crates
11
+
2. The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/rust-runtime/Cargo.lock) for AWS runtime crates
12
+
3. The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/rust-runtime/aws-config/Cargo.lock) for the `aws-config` crate
13
+
4. The [lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/sdk/Cargo.lock) for the workspace containing code-generated AWS SDK crates
14
+
15
+
The first three lockfiles can be easily updated during development with a `cargo` command. However, the fourth lockfile
16
+
, known as the SDK lockfile, is generated by the code generator and is not checked into to the `smithy-rs` repository as
17
+
frequently as the first three runtime lockfiles. As a result, new dependencies added to any of the runtime lockfiles may
18
+
not be reflected in the SDK lockfile.
19
+
20
+
The `sdk-lockfiles` tool ensures that the SDK lockfile is a superset containing all dependencies listed in the three
21
+
runtime lockfiles. If it detects a new dependency in the AWS SDK crates introduced by any of the runtime lockfiles it
22
+
will output a message similar to the following (unless the dependency is introduced by a server specific runtime crate):
15
23
```
16
24
$ sdk-lockfiles audit
17
25
2024-09-10T16:48:38.460518Z INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
18
26
2024-09-10T16:48:38.489879Z INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
19
27
2024-09-10T16:48:38.490306Z INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
20
-
`minicbor` (0.24.2), used by `rust-runtime/Cargo.lock`, is not contained in SDK lockfile!
28
+
`minicbor` (0.24.2), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
21
29
Error: there are lockfile audit failures
22
30
```
23
31
24
32
This tool is intended for automated use.
33
+
34
+
## Limitation
35
+
The `sdk-lockfiles` tool does not verify whether new dependencies introduced in [CargoDependency.kt](https://github.com/smithy-lang/smithy-rs/blob/main/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt)
36
+
are included in the SDK lockfile. This is because dependencies in `CargoDependency.kt` are represented as a Kotlin data
37
+
class. Consequently, dependencies added via the code generator, `inlineable`, or `aws-inlineable` are not considered by
38
+
`sdk-lockfiles`.
39
+
40
+
This limitation is acceptable for our operational purposes. Our release script always executes
41
+
`./gradlew aws:sdk:syncAwsSdkLockfile`, which ensures that any dependencies added in `CargoDependency.kt` are properly
0 commit comments