Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ci/buildkite-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ wait_step() {

all_test_steps() {
command_step checks1 "ci/docker-run-default-image.sh ci/test-checks.sh" 20 check
command_step checks2 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-bins" 15 check
command_step checks2b "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-bins" 15 check
command_step checks2l "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-lib" 15 check
command_step checks2bl "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-bins-and-lib" 15 check
command_step checks3 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-all-targets" 15 check
command_step miri "ci/docker-run-default-image.sh ci/test-miri.sh" 5 check
wait_step
Expand Down
41 changes: 38 additions & 3 deletions scripts/check-dev-context-only-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ allowed="${allowed%,}"

mode=${1:-full}
case "$mode" in
tree | check-bins | check-all-targets | full)
tree | check-bins | check-lib | check-bins-and-lib | check-all-targets | full)
;;
*)
echo "$0: unrecognized mode: $mode";
Expand Down Expand Up @@ -156,8 +156,43 @@ fi
# consistency with other CI steps and for the possibility of new similar lints.
export RUSTFLAGS="-D warnings -Z threads=8 $RUSTFLAGS"

if [[ $mode = "check-bins" || $mode = "full" ]]; then
_ cargo "+${rust_nightly}" hack check --bins
if [[ $mode = "check-bins" || $mode = "check-lib" || $mode = "check-bins-and-lib" || $mode = "full" ]]; then
# Until https://github.com/rust-lang/cargo/pull/14163 is applied for our
# chosen nightly toolchain, dcou needs custom-built cargo to avoid
# false-negatives.

# This clone will fail every time we update our nightly toolchain because
# ${rust_nightly} is embedded in the branch name. This is intentional to
# force to re-cheery-pick the patch for the new nightly.
#
# Steps:
# 1. Clone the forked cargo repo.
# 2. Check out the commit hash printed by `/solana/cargo nightly --version
# --verbose` _using the new toolchain_.
# 3. Cherry-pick old branch's tip commit titled as "Unify no-library-target
# error into no-target warn".
# 4. Push new branch with its name updated with the new nightly version.
_ git clone --depth 1 --no-tags \
--branch "no-no-library-target-error-${rust_nightly}" \
https://github.com/anza-xyz/cargo.git cargo-for-dcou
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add nightly version to ./cargo-for-dcou/ dir..


# Now build the patched cargo
(
cd ./cargo-for-dcou/
_ cargo "+${rust_nightly}" build --release --bin cargo
)
Comment on lines +175 to +183
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip this if cargo is already built.


# Use `cargo "+${rust_nightly}" hack ..` once we stop using custom-built one.
if [[ $mode = "check-bins" ]]; then
PATH="./cargo-for-dcou/target/release:$PATH" \
RUSTUP_TOOLCHAIN="${rust_nightly}" _ cargo hack check --bins
elif [[ $mode = "check-lib" ]]; then
PATH="./cargo-for-dcou/target/release:$PATH" \
RUSTUP_TOOLCHAIN="${rust_nightly}" _ cargo hack check --lib
else
PATH="./cargo-for-dcou/target/release:$PATH" \
RUSTUP_TOOLCHAIN="${rust_nightly}" _ cargo hack check --bins --lib
fi
fi
if [[ $mode = "check-all-targets" || $mode = "full" ]]; then
_ cargo "+${rust_nightly}" hack check --all-targets
Expand Down