Skip to content

Commit 595e4dc

Browse files
authored
ci: key Rust cache on resolved Python version (#1554)
* ci: key Rust cache on resolved Python version The Swatinem/rust-cache key didn't include Python's patch version, so when the runner image bumped Python (e.g. 3.14.4 -> 3.14.5) the restored build artifacts kept absolute LIBPATH entries pointing at the prior install dir and the link step failed with LNK1181 looking for python3.lib in the old 3.14.4 path. Reorder setup-python before rust-cache so its output is available, and append the full python-version to the cache key. * ci: use env.pythonLocation as Rust cache key Replace the steps-output approach with the env var setup-python sets automatically, removing the need to assign each step an id.
1 parent ac6d486 commit 595e4dc

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/build-binaries.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
with:
4848
cache-bin: false
4949
workspaces: temporalio/bridge -> target
50+
key: ${{ env.pythonLocation }}
5051
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
5152
- run: uv sync --all-extras
5253

.github/workflows/ci.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ jobs:
4242
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
4343
with:
4444
components: "clippy"
45-
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
46-
with:
47-
workspaces: temporalio/bridge -> target
4845
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
4946
with:
5047
python-version: ${{ matrix.pythonOverride || matrix.python }}
48+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
49+
with:
50+
workspaces: temporalio/bridge -> target
51+
key: ${{ env.pythonLocation }}
5152
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
5253
with:
5354
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
@@ -107,12 +108,13 @@ jobs:
107108
with:
108109
submodules: recursive
109110
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
110-
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
111-
with:
112-
workspaces: temporalio/bridge -> target
113111
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
114112
with:
115113
python-version: "3.10"
114+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
115+
with:
116+
workspaces: temporalio/bridge -> target
117+
key: ${{ env.pythonLocation }}
116118
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
117119
with:
118120
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
@@ -143,12 +145,13 @@ jobs:
143145
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
144146
with:
145147
components: "clippy"
146-
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
147-
with:
148-
workspaces: temporalio/bridge -> target
149148
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
150149
with:
151150
python-version: "3.13"
151+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
152+
with:
153+
workspaces: temporalio/bridge -> target
154+
key: ${{ env.pythonLocation }}
152155
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
153156
with:
154157
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
@@ -181,12 +184,13 @@ jobs:
181184
with:
182185
submodules: recursive
183186
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
184-
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
185-
with:
186-
workspaces: temporalio/bridge -> target
187187
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
188188
with:
189189
python-version: "3.14"
190+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
191+
with:
192+
workspaces: temporalio/bridge -> target
193+
key: ${{ env.pythonLocation }}
190194
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
191195
with:
192196
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed

.github/workflows/run-bench.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ jobs:
3535
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3636
with:
3737
toolchain: stable
38+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
39+
with:
40+
python-version: "3.13"
3841
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
3942
with:
4043
cache-bin: false
4144
workspaces: temporalio/bridge -> target
42-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
43-
with:
44-
python-version: "3.13"
45+
key: ${{ env.pythonLocation }}
4546
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
4647
with:
4748
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed

0 commit comments

Comments
 (0)