|
79 | 79 | ~/.cargo/
|
80 | 80 | key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
81 | 81 |
|
| 82 | + # Ensure that Cargo resolves the minimum possible syn version so that if we |
| 83 | + # accidentally make a change which depends upon features added in more |
| 84 | + # recent versions of syn, we'll catch it in CI. |
| 85 | + - name: Pin syn dependency |
| 86 | + run: | |
| 87 | + set -eo pipefail |
| 88 | + # Override the exising `syn` dependency with one which requires an exact |
| 89 | + # version. |
| 90 | + cargo add -p zerocopy-derive 'syn@=2.0.31' |
| 91 | +
|
82 | 92 | - name: Configure environment variables
|
83 | 93 | run: |
|
84 | 94 | set -eo pipefail
|
@@ -318,49 +328,6 @@ jobs:
|
318 | 328 | diff <(./generate-readme.sh) README.md
|
319 | 329 | exit $?
|
320 | 330 |
|
321 |
| - check_msrv: |
322 |
| - needs: generate_cache |
323 |
| - runs-on: ubuntu-latest |
324 |
| - name: Check MSRVs match |
325 |
| - steps: |
326 |
| - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
327 |
| - |
328 |
| - - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 |
329 |
| - with: |
330 |
| - path: | |
331 |
| - ~/.cargo/ |
332 |
| - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} |
333 |
| - |
334 |
| - # Make sure that the MSRV in zerocopy's and zerocopy-derive's `Cargo.toml` |
335 |
| - # files are the same. In CI, we test with a single MSRV (the one indicated |
336 |
| - # in zerocopy's `Cargo.toml`), so it's important that: |
337 |
| - # - zerocopy-derive's MSRV is not lower than zerocopy's (we don't test with |
338 |
| - # a lower MSRV in CI, so we couldn't guarantee that zerocopy-derive |
339 |
| - # actually built and ran on a lower MSRV) |
340 |
| - # - zerocopy-derive's MSRV is not higher than zerocopy's (this would mean |
341 |
| - # that compiling zerocopy with the `derive` feature enabled would fail |
342 |
| - # on its own published MSRV) |
343 |
| - - name: Check MSRVs match |
344 |
| - run: | |
345 |
| - set -eo pipefail |
346 |
| -
|
347 |
| - # Usage: msrv <crate-name> |
348 |
| - function msrv { |
349 |
| - cargo metadata --format-version 1 | jq -r ".packages[] | select(.name == \"$1\").rust_version" |
350 |
| - } |
351 |
| -
|
352 |
| - ver_zerocopy=$(msrv zerocopy) |
353 |
| - ver_zerocopy_derive=$(msrv zerocopy-derive) |
354 |
| -
|
355 |
| - if [[ "$ver_zerocopy" == "$ver_zerocopy_derive" ]]; then |
356 |
| - echo "Same MSRV ($ver_zerocopy) found for zerocopy and zerocopy-derive." | tee -a $GITHUB_STEP_SUMMARY |
357 |
| - exit 0 |
358 |
| - else |
359 |
| - echo "Different MSRVs found for zerocopy ($ver_zerocopy) and zerocopy-derive ($ver_zerocopy_derive)." \ |
360 |
| - | tee -a $GITHUB_STEP_SUMMARY >&2 |
361 |
| - exit 1 |
362 |
| - fi |
363 |
| -
|
364 | 331 | check_versions:
|
365 | 332 | needs: generate_cache
|
366 | 333 | runs-on: ubuntu-latest
|
@@ -454,6 +421,9 @@ jobs:
|
454 | 421 |
|
455 | 422 | - name: Populate cache
|
456 | 423 | run: |
|
| 424 | + # See comment on "Pin syn dependency" job for why we do this. |
| 425 | + cargo add -p zerocopy-derive 'syn@=2.0.31' |
| 426 | +
|
457 | 427 | # Ensure all dependencies are downloaded - both for our crates and for
|
458 | 428 | # tools we use in CI. We don't care about these tools succeeding for
|
459 | 429 | # two reasons: First, this entire job is best-effort since it's just a
|
@@ -484,7 +454,7 @@ jobs:
|
484 | 454 | # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
|
485 | 455 | if: failure()
|
486 | 456 | runs-on: ubuntu-latest
|
487 |
| - needs: [build_test, kani, check_fmt, check_readme, check_msrv, check_versions, generate_cache] |
| 457 | + needs: [build_test, kani, check_fmt, check_readme, check_versions, generate_cache] |
488 | 458 | steps:
|
489 | 459 | - name: Mark the job as failed
|
490 | 460 | run: exit 1
|
0 commit comments