Skip to content

Commit 86a9d05

Browse files
committed
Merge tag 'v0.86.8' into ci
v0.86.8 - backups: Support pinned messages
2 parents b8b0910 + ace4048 commit 86a9d05

File tree

151 files changed

+5012
-1448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+5012
-1448
lines changed

.clippy.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ disallowed-methods = [
77
{ path = "jni::JNIEnv::call_static_method_unchecked", reason = "use helper method instead" },
88
{ path = "jni::JNIEnv::new_object", reason = "use helper method instead" },
99
{ path = "jni::JNIEnv::new_object_unchecked", reason = "use helper method instead" },
10-
".." # keep any defaults
11-
]
10+
]
11+
allow-unwrap-in-tests = true

.github/actions/restore-cargo-cache/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ outputs:
2020
value: ${{ steps.calculate.outputs['cache-key-current'] }}
2121
cache-key:
2222
description: 'Full cache key used for cargo artifacts'
23-
value: ${{ steps.cache.outputs['cache-primary-key'] }}
23+
value: ${{ steps.calculate-primary-cache-key.outputs['cache-primary-key'] }}
2424
runs:
2525
using: 'composite'
2626
steps:
@@ -29,8 +29,14 @@ runs:
2929
shell: bash
3030
run: python3 "${{ github.action_path }}/calculate_cache_keys.py" --toolchain "${{ inputs.toolchain }}" >> "$GITHUB_OUTPUT"
3131

32+
- name: Calculate primary cache key
33+
id: calculate-primary-cache-key
34+
shell: bash
35+
run: echo "cache-primary-key=${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-${{ steps.calculate.outputs['cache-key-merge-base'] }}-${{ steps.calculate.outputs['cache-key-current'] }}" >> "$GITHUB_OUTPUT"
36+
3237
- name: Restore cargo cache
3338
id: cache
39+
if: ${{ env.DO_CLEAN_BUILD_AND_POPULATE_CACHE != 'true' }}
3440
uses: runs-on/cache/restore@3a15256b3556fbc5ae15f7f04598e4c7680e9c25 # v4
3541
with:
3642
# The special handling for the Windows target path comes because we overwrite
@@ -49,12 +55,16 @@ runs:
4955
# - We use the working tree hash as the final key component to ensure uniqueness per commit.
5056
# - On cache miss, we fall back, in order, to:
5157
# 1. Most recent cache from the last common ancestor with main.
58+
# 1.1. Most recent cache from the last common ancestor with main's parent.
59+
# 1.2. Most recent cache from the last common ancestor with main's grandparent.
5260
# 2. Most recent cache for this job/OS/rustc combination.
5361
# 3. Most recent cache for this job/OS combination.
5462
# This yields perfect hits on reruns while still warming cold builds with close matches.
5563
# See: https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#cache-key-matching
5664
key: ${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-${{ steps.calculate.outputs['cache-key-merge-base'] }}-${{ steps.calculate.outputs['cache-key-current'] }}
5765
restore-keys: |
5866
${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-${{ steps.calculate.outputs['cache-key-merge-base'] }}-
67+
${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-${{ steps.calculate.outputs['cache-key-merge-base-parent'] }}-
68+
${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-${{ steps.calculate.outputs['cache-key-merge-base-grandparent'] }}-
5969
${{ inputs['job-name'] }}-${{ runner.os }}-${{ steps.calculate.outputs['rustc-version'] }}-
6070
${{ inputs['job-name'] }}-${{ runner.os }}-

.github/actions/restore-cargo-cache/calculate_cache_keys.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ def get_merge_base() -> str:
4242
return output
4343

4444

45+
def get_merge_base_parent(commit: str) -> str:
46+
"""Get the parent commit of the given commit."""
47+
returncode, output, _ = run_command(
48+
['git', 'rev-parse', f'{commit}^'],
49+
check=False,
50+
)
51+
if returncode != 0 or not output:
52+
return 'none'
53+
return output
54+
55+
4556
def get_working_tree_hash() -> str:
4657
"""Get a hash representing the current working tree state."""
4758
returncode, working_tree_hash, _ = run_command(
@@ -109,16 +120,22 @@ def main() -> None:
109120
rustc_version_hash = hashlib.sha256(rustc_version.encode()).hexdigest()[:32]
110121

111122
lca = get_merge_base()
123+
lca_parent = get_merge_base_parent(lca)
124+
lca_grandparent = get_merge_base_parent(lca_parent)
112125
current = get_working_tree_hash()
113126

114127
print(f'rustc-version={rustc_version_hash}')
115128
print(f'cache-key-merge-base={lca}')
129+
print(f'cache-key-merge-base-parent={lca_parent}')
130+
print(f'cache-key-merge-base-grandparent={lca_grandparent}')
116131
print(f'cache-key-current={current}')
117132

118133
debug_parts = [
119134
f'Toolchain={toolchain}',
120135
f'RustcVersion={rustc_version}',
121136
f'LCA={lca}',
137+
f'LCAParent={lca_parent}',
138+
f'LCAGrandparent={lca_grandparent}',
122139
f'Current={current}',
123140
]
124141
print('Debug: ' + '; '.join(debug_parts), file=sys.stderr)

.github/actions/save-cargo-cache/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
using: 'composite'
99
steps:
1010
- name: Save cargo cache
11-
if: ${{ github.ref == 'refs/heads/main' }}
11+
if: ${{ env.DO_CLEAN_BUILD_AND_POPULATE_CACHE == 'true' }}
1212
uses: runs-on/cache/save@3a15256b3556fbc5ae15f7f04598e4c7680e9c25 # v4
1313
with:
1414
# Keep this path list in sync with restore-cargo-cache/action.yml.

0 commit comments

Comments
 (0)