| 1 | # s2n-tls Rust Bindings Release Guide |
| 2 | |
| 3 | ## Version Bump Process for Bindings Releases |
| 4 | |
| 5 | This guide provides context for bumping the version of the s2n-tls Rust bindings. |
| 6 | |
| 7 | ### Prerequisites |
| 8 | |
| 9 | - Ensure you're in the `bindings/rust/extended` directory |
| 10 | - A new release MUST be committed and tagged as a release on github.com. |
| 11 | - An s2n-tls release version MUST be provided, in the format "v<MAJOR>.<MINOR>.<PATCH>". |
| 12 | - The user SHOULD tell you if this release needs a MAJOR or MINOR version bump, otherwise it's expected that this is just a PATCH release, but always double check. |
| 13 | - Sub-package version numbers MAY not match the overall release version, but SHOULD match the versioning bump with the release, e.g. if the overall project has bumped the MINOR version, the sub-packages should also increment their MINOR version (ahd implicitly, PATCH version resets to 0). |
| 14 | |
| 15 | ### Step-by-Step Instructions |
| 16 | |
| 17 | #### Checkout the s2n-tls release version provided |
| 18 | |
| 19 | `git checkout v<MAJOR>.<MINOR>.<PATCH>` |
| 20 | |
| 21 | #### Update s2n-tls-sys Template |
| 22 | |
| 23 | **File**: `bindings/rust/extended/s2n-tls-sys/templates/Cargo.template` |
| 24 | |
| 25 | **Change**: |
| 26 | ```toml |
| 27 | version = "0.3.29" |
| 28 | |
| 29 | # To: |
| 30 | version = "0.3.30" |
| 31 | ``` |
| 32 | |
| 33 | **Why**: This template is used by `generate.sh` to create the actual `s2n-tls-sys/Cargo.toml` file. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | #### Step 2: Run generate.sh |
| 38 | |
| 39 | **Command**: |
| 40 | ```bash |
| 41 | cd bindings/rust/extended |
| 42 | ./generate.sh --skip-tests |
| 43 | ``` |
| 44 | |
| 45 | **What this does**: |
| 46 | - Copies the latest C sources from the main s2n-tls codebase into `s2n-tls-sys/lib/` |
| 47 | - Generates Rust FFI bindings from the C headers |
| 48 | - Creates `s2n-tls-sys/Cargo.toml` from the template (with the new version) |
| 49 | - The `--skip-tests` flag skips running the test suite to speed things up |
| 50 | |
| 51 | **Expected output**: The script should complete successfully and regenerate `s2n-tls-sys/Cargo.toml`. |
| 52 | |
| 53 | --- |
| 54 | |
| 55 | #### Step 3: Update s2n-tls Crate |
| 56 | |
| 57 | **File**: `bindings/rust/extended/s2n-tls/Cargo.toml` |
| 58 | |
| 59 | **Changes** (2 locations): |
| 60 | |
| 61 | 1. **Package version** |
| 62 | ```toml |
| 63 | # Change from: |
| 64 | version = "0.3.29" |
| 65 | |
| 66 | # To: |
| 67 | version = "0.3.30" |
| 68 | ``` |
| 69 | |
| 70 | 2. **Dependency version** |
| 71 | ```toml |
| 72 | # Change from: |
| 73 | s2n-tls-sys = { version = "=0.3.29", path = "../s2n-tls-sys", features = ["internal"] } |
| 74 | |
| 75 | # To: |
| 76 | s2n-tls-sys = { version = "=0.3.30", path = "../s2n-tls-sys", features = ["internal"] } |
| 77 | ``` |
| 78 | |
| 79 | **Important**: Note the `=` prefix which means "exact version". Both the package version and the dependency version must match exactly. |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | #### Step 4: Update s2n-tls-tokio Crate |
| 84 | |
| 85 | **File**: `bindings/rust/extended/s2n-tls-tokio/Cargo.toml` |
| 86 | |
| 87 | **Changes** |
| 88 | |
| 89 | 1. **Package version** |
| 90 | ```toml |
| 91 | # Change from: |
| 92 | version = "0.3.29" |
| 93 | |
| 94 | # To: |
| 95 | version = "0.3.30" |
| 96 | ``` |
| 97 | |
| 98 | 2. **Dependency version** |
| 99 | ```toml |
| 100 | # Change from: |
| 101 | s2n-tls = { version = "=0.3.29", path = "../s2n-tls" } |
| 102 | |
| 103 | # To: |
| 104 | s2n-tls = { version = "=0.3.30", path = "../s2n-tls" } |
| 105 | ``` |
| 106 | |
| 107 | --- |
| 108 | |
| 109 | #### Update other dependencies |
| 110 | |
| 111 | These paths might also contain Cargo.toml files with dependencies on specific versions of the bindings; inspect them and increment as needed: |
| 112 | |
| 113 | - tests/regression/Cargo.toml |
| 114 | - tests/pcap/Cargo.toml |
| 115 | - bindings/rust/standard/s2n-tls-hyper |
| 116 | - bindings/rust/aws-kms-tls-auth |
| 117 | - **Special Note**: This crate is tested in CI and should be not have it's version dependency updated. |
| 118 | |
| 119 | |
| 120 | ### Verification Checklist |
| 121 | |
| 122 | After making all changes, verify: |
| 123 | |
| 124 | 1. `cargo build` in s2n-tls should succeed. |
| 125 | 2. Run tests: `cargo test` and `cargo test --all-features` |
| 126 | 3. Verify the changes with `git diff` |
| 127 | 4. Commit the changes with a conventional commit message in the format: "chore: Rust bindings release <MAJOR>.<MINOR>.<PATCH>" NOTE: this version is of the bindings, not the main release version number. |
| 128 | |
| 129 | --- |
| 130 | |
| 131 | ## Notes |
| 132 | |
| 133 | - All three crates must be released together due to exact version dependencies |
| 134 | - The `generate.sh` script must be run after updating the template to regenerate the actual Cargo.toml |
| 135 | - The `--skip-tests` flag is used to speed up the generation process; tests should be run separately before publishing, but will also be run in CI as part of the pull request process. |