Skip to content

Commit f45336b

Browse files
iMacTiaclaude
andcommitted
Merge main to pick up the 1.97.1 toolchain and the reworked CI
No conflicts. This branch had drifted nine commits behind and still pinned Rust 1.92.0, while `main` moved to 1.97.1 in rubyatscale#52 and reworked all four workflow files in rubyatscale#51, rubyatscale#55 and rubyatscale#57. So a CI run on the old tip would have tested this against a toolchain and a workflow set that no longer exist, which is worth avoiding given no run has ever been approved here. `recorded_key()` and the two comparison sites are untouched by the merge. The only changes reaching this branch's own code are main's clippy fixes in the `build_stale_violations` error paths, which arrived cleanly. Verified on the merged tree with the 1.97.1 toolchain the merge brings in: `cargo test --no-fail-fast` 258 passed 0 failed, `cargo clippy --all-targets --all-features -- -Dwarnings` clean, `cargo fmt --check` clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2 parents e198118 + 54014ec commit f45336b

35 files changed

Lines changed: 661 additions & 176 deletions

.github/workflows/audit.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@ on:
99
- '**/Cargo.lock'
1010
pull_request:
1111

12+
permissions: {}
13+
1214
jobs:
1315
audit:
16+
permissions:
17+
contents: read
1418
runs-on: ubuntu-latest
1519
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions-rs/audit-check@v1
20+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21+
with:
22+
persist-credentials: false
23+
# Installs a prebuilt cargo-audit from the upstream GitHub releases and
24+
# verifies its SHA256 checksum. `actions-rs/audit-check` built it with
25+
# `cargo install`, which broke once cargo-audit's dependencies outran the
26+
# runner's toolchain. `fallback: none` keeps that compile path from
27+
# silently coming back if the download ever fails.
28+
- uses: taiki-e/install-action@5b4d68e2e660441203ab128a23676f1e4faf1532 # v2.86.3
1829
with:
19-
token: ${{ secrets.GITHUB_TOKEN }}
30+
tool: cargo-audit
31+
fallback: none
32+
- run: cargo audit

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@ on:
1717
env:
1818
CARGO_TERM_COLOR: always
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
check:
2225
name: Check
2326
runs-on: ubuntu-latest
2427
steps:
2528
- name: Checkout sources
26-
uses: actions/checkout@v2
29+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
persist-credentials: false
2732

2833
- name: Run cargo check
2934
run: cargo check
@@ -32,7 +37,9 @@ jobs:
3237
runs-on: ubuntu-latest
3338
steps:
3439
- name: Checkout sources
35-
uses: actions/checkout@v2
40+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41+
with:
42+
persist-credentials: false
3643

3744
- name: Run cargo test with backtrace
3845
run: cargo test -- --nocapture
@@ -45,7 +52,9 @@ jobs:
4552
RUSTFLAGS: '-Dwarnings'
4653
steps:
4754
- name: Checkout sources
48-
uses: actions/checkout@v2
55+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56+
with:
57+
persist-credentials: false
4958

5059
- name: Run cargo fmt
5160
run: cargo fmt --all -- --check

.github/workflows/release.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
env:
5757
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5858
steps:
59-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
6060
with:
6161
persist-credentials: false
6262
submodules: recursive
@@ -66,7 +66,7 @@ jobs:
6666
shell: bash
6767
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
6868
- name: Cache dist
69-
uses: actions/upload-artifact@v4
69+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
7070
with:
7171
name: cargo-dist-cache
7272
path: ~/.cargo/bin/dist
@@ -82,7 +82,7 @@ jobs:
8282
cat plan-dist-manifest.json
8383
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8484
- name: "Upload dist-manifest.json"
85-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
8686
with:
8787
name: artifacts-plan-dist-manifest
8888
path: plan-dist-manifest.json
@@ -120,7 +120,7 @@ jobs:
120120
- name: enable windows longpaths
121121
run: |
122122
git config --global core.longpaths true
123-
- uses: actions/checkout@v4
123+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
124124
with:
125125
persist-credentials: false
126126
submodules: recursive
@@ -135,7 +135,7 @@ jobs:
135135
run: ${{ matrix.install_dist.run }}
136136
# Get the dist-manifest
137137
- name: Fetch local artifacts
138-
uses: actions/download-artifact@v4
138+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
139139
with:
140140
pattern: artifacts-*
141141
path: target/distrib/
@@ -149,7 +149,7 @@ jobs:
149149
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
150150
echo "dist ran successfully"
151151
- name: Attest
152-
uses: actions/attest-build-provenance@v2
152+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be
153153
with:
154154
subject-path: "target/distrib/*${{ join(matrix.targets, ', ') }}*"
155155
- id: cargo-dist
@@ -166,7 +166,7 @@ jobs:
166166
167167
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
168168
- name: "Upload artifacts"
169-
uses: actions/upload-artifact@v4
169+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
170170
with:
171171
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
172172
path: |
@@ -183,19 +183,19 @@ jobs:
183183
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184184
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
185185
steps:
186-
- uses: actions/checkout@v4
186+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
187187
with:
188188
persist-credentials: false
189189
submodules: recursive
190190
- name: Install cached dist
191-
uses: actions/download-artifact@v4
191+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
192192
with:
193193
name: cargo-dist-cache
194194
path: ~/.cargo/bin/
195195
- run: chmod +x ~/.cargo/bin/dist
196196
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
197197
- name: Fetch local artifacts
198-
uses: actions/download-artifact@v4
198+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
199199
with:
200200
pattern: artifacts-*
201201
path: target/distrib/
@@ -213,7 +213,7 @@ jobs:
213213
214214
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
215215
- name: "Upload artifacts"
216-
uses: actions/upload-artifact@v4
216+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
217217
with:
218218
name: artifacts-build-global
219219
path: |
@@ -233,19 +233,19 @@ jobs:
233233
outputs:
234234
val: ${{ steps.host.outputs.manifest }}
235235
steps:
236-
- uses: actions/checkout@v4
236+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
237237
with:
238238
persist-credentials: false
239239
submodules: recursive
240240
- name: Install cached dist
241-
uses: actions/download-artifact@v4
241+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
242242
with:
243243
name: cargo-dist-cache
244244
path: ~/.cargo/bin/
245245
- run: chmod +x ~/.cargo/bin/dist
246246
# Fetch artifacts from scratch-storage
247247
- name: Fetch artifacts
248-
uses: actions/download-artifact@v4
248+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
249249
with:
250250
pattern: artifacts-*
251251
path: target/distrib/
@@ -258,14 +258,14 @@ jobs:
258258
cat dist-manifest.json
259259
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
260260
- name: "Upload dist-manifest.json"
261-
uses: actions/upload-artifact@v4
261+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
262262
with:
263263
# Overwrite the previous copy
264264
name: artifacts-dist-manifest
265265
path: dist-manifest.json
266266
# Create a GitHub Release while uploading all files to it
267267
- name: "Download GitHub Artifacts"
268-
uses: actions/download-artifact@v4
268+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
269269
with:
270270
pattern: artifacts-*
271271
path: artifacts
@@ -298,7 +298,7 @@ jobs:
298298
env:
299299
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
300300
steps:
301-
- uses: actions/checkout@v4
301+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
302302
with:
303303
persist-credentials: false
304304
submodules: recursive

.github/workflows/zizmor.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GitHub Actions Security Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
contents: read
17+
actions: read
18+
steps:
19+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20+
with:
21+
persist-credentials: false
22+
- name: Run zizmor
23+
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1

.github/zizmor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Configuration for the zizmor GitHub Actions security linter.
2+
# See https://docs.zizmor.sh/configuration/
3+
#
4+
# Everything ignored below is in release.yml, which is autogenerated by dist
5+
# (cargo-dist) from dist-workspace.toml -- see the header comment in that file.
6+
# Editing release.yml by hand does not work: the next `dist generate` overwrites
7+
# it. Where dist offers a knob we use it (the actions in release.yml are pinned
8+
# to commits via [dist.github-action-commits] in dist-workspace.toml), and what
9+
# is left below is inherent to dist's template and has no such knob.
10+
#
11+
# These are deliberately file-scoped rather than line-scoped, because line
12+
# numbers shift whenever release.yml is regenerated.
13+
rules:
14+
excessive-permissions:
15+
ignore:
16+
# dist declares `contents: write` at the workflow level because the
17+
# announce job creates the GitHub Release. Narrowing it per-job is
18+
# dist's call, not ours.
19+
- release.yml
20+
template-injection:
21+
ignore:
22+
# dist interpolates `github.ref_name`, `needs.plan.outputs.tag*` and its
23+
# `matrix.*` build parameters straight into run blocks. The tag-derived
24+
# values only expand on `push:` of a tag, which requires push access, and
25+
# expand to '' on pull_request. The matrix values come from dist's own
26+
# plan output, not from user input.
27+
- release.yml
28+
unpinned-images:
29+
ignore:
30+
# `container: ${{ matrix.container && matrix.container.image || null }}`.
31+
# This repo configures no custom container runners, so matrix.container is
32+
# always null and no image is ever pulled.
33+
- release.yml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@ excluded, and the old behavior (analyze everything) was rarely desired.
2323
```yaml
2424
respect_gitignore: false
2525
```
26+
27+
### Internal
28+
29+
#### Replaced `serde_yaml` with `yaml_serde`
30+
31+
`serde_yaml` was discontinued in March 2024, and its `unsafe-libyaml` backend has
32+
been unreleased since. pks now depends on
33+
[`yaml_serde`](https://github.com/yaml/yaml-serde), the YAML organization's
34+
maintained fork, which is backed by `libyaml-rs` from the same org.
35+
36+
`yaml_serde` is an API-compatible fork whose only substantive changes are `no_std`
37+
support and lint cleanups, so this is behavior-preserving: the bytes pks writes to
38+
`package.yml` and `package_todo.yml` are unchanged, as are its YAML parse error
39+
messages. No action is required.

Cargo.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ repository = "https://github.com/rubyatscale/pks"
1515
[profile.dev]
1616
debug = true
1717

18+
# `cargo build --release` is what dev/run_benchmarks.sh measures and what people
19+
# build locally, so it should be optimized like the shipped binary. This profile
20+
# was previously left at cargo defaults (lto = false, codegen-units = 16), which
21+
# meant benchmarks understated the `dist` build.
22+
#
23+
# Measured on a 51k-file app: default profile 5.289s, lto="thin" 5.127s,
24+
# lto="fat" 5.433s. Fat LTO is both slower to build (42s vs 27s) and slower to
25+
# run, so "thin" it is -- which also matches the dist profile.
26+
#
27+
# codegen-units = 1 costs some release build time in exchange for a faster binary
28+
# and, just as usefully, far less run-to-run variance (+/-0.084s -> +/-0.010s),
29+
# without which changes worth a few percent cannot be told apart from noise.
30+
[profile.release]
31+
lto = "thin"
32+
codegen-units = 1
33+
1834
# The profile that 'dist' will build with
1935
[profile.dist]
2036
inherits = "release"
@@ -39,7 +55,7 @@ path-clean = "1.0.1" # Pathnam
3955
rayon = "1.7.0" # for parallel iteration
4056
regex = "1.7.3"
4157
serde = { version = "~1", features = ["derive"] } # de(serialization)
42-
serde_yaml = "0.9.19" # de(serialization)
58+
yaml_serde = "0.10.6" # de(serialization)
4359
serde_json = "1.0.96" # de(serialization)
4460
serde_magnus = "0.7.0" # permits a ruby gem to interface with this library
4561
tracing = "0.1.37" # logging

0 commit comments

Comments
 (0)