@@ -261,19 +261,6 @@ jobs:
261261 - name : Populate cache
262262 uses : ./.github/actions/cache
263263
264- # Ensure that Cargo resolves the minimum possible syn version so that if we
265- # accidentally make a change which depends upon features added in more
266- # recent versions of syn, we'll catch it in CI.
267- #
268- # TODO(#1595): Debug why this step is still necessary after #1564 and maybe
269- # remove it.
270- - name : Pin syn dependency
271- run : |
272- set -eo pipefail
273- # Override the exising `syn` dependency with one which requires an exact
274- # version.
275- cargo add -p zerocopy-derive 'syn@=2.0.46'
276-
277264 - name : Configure environment variables
278265 env :
279266 TOOLCHAIN : ${{ matrix.toolchain }}
@@ -460,6 +447,15 @@ jobs:
460447 run : |
461448 set -eo pipefail
462449
450+ # FIXME(#2906): We do this because `cargo vendor` doesn't currently
451+ # support vendoring std's dependencies (required in order to build std
452+ # from source, which Miri does). As a workaround, we simply temporarily
453+ # remove the cargo config and bypass vendoring altogether. Eventually,
454+ # we should get vendoring working for std's dependencies too.
455+ #
456+ # See also: https://github.com/rust-lang/wg-cargo-std-aware/issues/23
457+ mv .cargo/config.toml .cargo/config.toml.bak
458+
463459 # Work around https://github.com/rust-lang/miri/issues/3125
464460 [ "$TARGET" == "aarch64-unknown-linux-gnu" ] && cargo clean
465461
@@ -479,6 +475,8 @@ jobs:
479475 --target $TARGET \
480476 $FEATURES
481477 done
478+
479+ mv .cargo/config.toml.bak .cargo/config.toml
482480 # Only nightly has a working Miri, so we skip installing on all other
483481 # toolchains.
484482 #
@@ -567,6 +565,18 @@ jobs:
567565 echo "ZC_SKIP_CARGO_SEMVER_CHECKS=1" >> $GITHUB_ENV
568566 fi
569567
568+ # FIXME(#2906): We do this because `cargo semver-checks` fetches the latest
569+ # zerocopy from crates.io, but `.cargo/config.toml` causes that to resolve
570+ # in our vendor directory, and we don't vendor zerocopy. Removing this file
571+ # has the effect of causing the subsequent build to use crates.io rather
572+ # than vendored dependencies, which is fine since we only run this on the
573+ # stable toolchain. Eventually, we should update this job to use the
574+ # `--baseline-rev` option to use a previous git commit as the baseline for
575+ # checking compatibility (rather than the most recent published version),
576+ # which will make this unnecessary.
577+ - name : Remove Cargo config
578+ run : rm .cargo/config.toml
579+
570580 # Check semver compatibility with the most recently-published version on
571581 # crates.io. We do this in the matrix rather than in its own job so that it
572582 # gets run on different targets. Some of our API is target-specific (e.g.,
@@ -685,7 +695,19 @@ jobs:
685695 toolchain : ${{ env.ZC_TOOLCHAIN }}
686696 components : clippy, rust-src
687697 - name : Check big endian for aarch64_be-unknown-linux-gnu target
688- run : ./cargo.sh +nightly build --target=aarch64_be-unknown-linux-gnu -Zbuild-std --features simd
698+ run : |
699+ set -eo pipefail
700+
701+ # FIXME(#2906): We do this because `cargo vendor` doesn't currently
702+ # support vendoring std's dependencies (required in order to build
703+ # std from source, as we do here). As a workaround, we simply nuke
704+ # the cargo config and bypass vendoring altogether. Eventually, we
705+ # should get vendoring working for std's dependencies too.
706+ #
707+ # See also: https://github.com/rust-lang/wg-cargo-std-aware/issues/23
708+ rm .cargo/config.toml
709+
710+ ./cargo.sh +nightly build --target=aarch64_be-unknown-linux-gnu -Zbuild-std --features simd
689711
690712 # We can't use this as part of the build matrix because rustup doesn't support
691713 # the `avr-none` target.
@@ -716,6 +738,15 @@ jobs:
716738 with :
717739 toolchain : ${{ env.ZC_TOOLCHAIN }}
718740 components : clippy, rust-src
741+ # FIXME(#2906): We do this because `cargo vendor` doesn't currently
742+ # support vendoring std's dependencies (required in order to build std
743+ # from source, as we do here). As a workaround, we simply nuke the cargo
744+ # config and bypass vendoring altogether. Eventually, we should get
745+ # vendoring working for std's dependencies too.
746+ #
747+ # See also: https://github.com/rust-lang/wg-cargo-std-aware/issues/23
748+ - name : Remove Cargo config
749+ run : rm .cargo/config.toml
719750 # NOTE: We cannot check tests because of a number of different issues (at
720751 # the time of writing):
721752 # - No `alloc::sync`
@@ -851,14 +882,6 @@ jobs:
851882 #
852883 # [1] https://stackoverflow.com/a/42139535/836390
853884
854- # See comment on "Pin syn dependency" job for why we do this. It needs
855- # to happen before the subsequent `cargo check`, so we don't
856- # background it.
857- #
858- # TODO(#1595): Debug why this step is still necessary after #1564 and
859- # maybe remove it.
860- cargo add -p zerocopy-derive 'syn@=2.0.46' &> /dev/null
861-
862885 cargo check --workspace --tests &> /dev/null &
863886 # On our MSRV toolchain, updating the Cargo index takes a long time, so
864887 # it is worth specifically caching the MSRV index.
@@ -947,6 +970,8 @@ jobs:
947970 persist-credentials : false
948971 - uses : zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
949972 with :
973+ # Only scan the .github directory to avoid scanning vendored dependencies
974+ inputs : .github
950975 # We don't want to use GitHub Advanced Security because we want to
951976 # block the merge on zizmor failure, and the only way to do that
952977 # (without manually configuring a ruleset) is to fail the job, which
0 commit comments