Skip to content

Commit f706610

Browse files
iMacTiaclaude
andcommitted
Merge main to pick up the 1.97.1 toolchain and the fixture isolation
One conflict, in `update`'s summary line. rubyatscale#52 bumped the toolchain to 1.97.1 and the newer clippy removed the needless borrow in `&strict_violations.len()`; this branch had renamed that binding to `unlisted_strict_violations` when it added the recorded filter. Resolved as both: the rename kept, the borrow dropped. Everything else merged clean, including `tests/common/mod.rs`, where rubyatscale#57 adds `common::Fixture` next to this branch's `RoundTripFixture`. Worth flagging that they now solve the same problem two ways: rubyatscale#57 copies a fixture to a temp dir and drops it, while `RoundTripFixture` restores the shared fixture in place. rubyatscale#57 converts `create_test.rs` and `gitignore_test.rs` only, so `update_test.rs` still uses the older mechanism. Happy to fold the three round-trip tests onto `common::Fixture` if that is preferred, in this PR or a follow-up. Verified on the merged tree with the 1.97.1 toolchain the merge brings in: `cargo test --no-fail-fast` 265 passed 0 failed, clippy with `-Dwarnings` clean, `cargo fmt --check` clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2 parents 7ba0136 + 54014ec commit f706610

32 files changed

Lines changed: 627 additions & 163 deletions

.github/workflows/audit.yml

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

12+
permissions: {}
13+
1214
jobs:
1315
audit:
1416
permissions:
15-
checks: write
1617
contents: read
17-
issues: write
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
21-
- 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
2229
with:
23-
token: ${{ secrets.GITHUB_TOKEN }}
30+
tool: cargo-audit
31+
fallback: none
32+
- run: cargo audit

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout sources
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
persist-credentials: false
3032

3133
- name: Run cargo check
3234
run: cargo check
@@ -35,7 +37,9 @@ jobs:
3537
runs-on: ubuntu-latest
3638
steps:
3739
- name: Checkout sources
38-
uses: actions/checkout@v2
40+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41+
with:
42+
persist-credentials: false
3943

4044
- name: Run cargo test with backtrace
4145
run: cargo test -- --nocapture
@@ -48,7 +52,9 @@ jobs:
4852
RUSTFLAGS: '-Dwarnings'
4953
steps:
5054
- name: Checkout sources
51-
uses: actions/checkout@v2
55+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56+
with:
57+
persist-credentials: false
5258

5359
- name: Run cargo fmt
5460
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

Cargo.toml

Lines changed: 16 additions & 0 deletions
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"

0 commit comments

Comments
 (0)