Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 40ccade

Browse files
authored
Update to rust 1.44.0 (#10585)
* Update rust 1.44.0 * Update rust nightly 1.46.0 * Update docs * Fix clippy errors * Compile all source code with stable and nightly * Add another note * script tweaks * Fix a test... * Add another workaround * Add hack * Increase timeout... * Revert "Add hack" This reverts commit 5960f08. * Revert "Add another workaround" This reverts commit e14300d. * Require nightly rustfmt and use older nightly a bit * Improve document a bit * Revert now not-existing clippy check...
1 parent 2d2e23a commit 40ccade

File tree

11 files changed

+41
-17
lines changed

11 files changed

+41
-17
lines changed

bench-tps/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn main() {
115115
// Sort keypairs so that do_bench_tps() uses the same subset of accounts for each run.
116116
// This prevents the amount of storage needed for bench-tps accounts from creeping up
117117
// across multiple runs.
118-
keypairs.sort_by(|x, y| x.pubkey().to_string().cmp(&y.pubkey().to_string()));
118+
keypairs.sort_by_key(|x| x.pubkey().to_string());
119119
(keypairs, None)
120120
} else {
121121
generate_and_fund_keypairs(

ci/docker-run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ if [[ -z "$SOLANA_DOCKER_RUN_NOSETUID" ]]; then
6060
ARGS+=(--user "$(id -u):$(id -g)")
6161
fi
6262

63+
if [[ -n $SOLANA_ALLOCATE_TTY ]]; then
64+
# Colored output, progress bar and Ctrl-C:
65+
# https://stackoverflow.com/a/41099052/10242004
66+
ARGS+=(--interactive --tty)
67+
fi
68+
6369
# Environment variables to propagate into the container
6470
ARGS+=(
6571
--env BUILDKITE

ci/docker-rust-nightly/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM solanalabs/rust:1.43.0
1+
FROM solanalabs/rust:1.44.0
22
ARG date
33

44
RUN set -x \
55
&& rustup install nightly-$date \
66
&& rustup component add clippy --toolchain=nightly-$date \
7+
&& rustup component add rustfmt --toolchain=nightly-$date \
78
&& rustup show \
89
&& rustc --version \
910
&& cargo --version \

ci/docker-rust-nightly/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@ Docker image containing rust nightly and some preinstalled crates used in CI.
22

33
This image may be manually updated by running `CI=true ./build.sh` if you are a member
44
of the [Solana Labs](https://hub.docker.com/u/solanalabs/) Docker Hub
5-
organization, but it is also automatically updated periodically by
6-
[this automation](https://buildkite.com/solana-labs/solana-ci-docker-rust-nightly).
5+
organization.
76

87
## Moving to a newer nightly
98

9+
NOTE: Follow instructions in docker-rust/README.md before this when updating the stable
10+
rust version as well.
11+
1012
We pin the version of nightly (see the `ARG nightly=xyz` line in `Dockerfile`)
1113
to avoid the build breaking at unexpected times, as occasionally nightly will
1214
introduce breaking changes.
1315

1416
To update the pinned version:
17+
1. Edit `Dockerfile` to match the desired stable rust version to base on if needed.
1518
1. Run `ci/docker-rust-nightly/build.sh` to rebuild the nightly image locally,
1619
or potentially `ci/docker-rust-nightly/build.sh YYYY-MM-DD` if there's a
1720
specific YYYY-MM-DD that is desired (default is today's build).
1821
Check https://rust-lang.github.io/rustup-components-history/ for build
1922
status
2023
1. Update `ci/rust-version.sh` to reflect the new nightly `YYY-MM-DD`
21-
1. Run `SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:YYYY-MM-DD ci/test-coverage.sh`
24+
1. Run `SOLANA_ALLOCATE_TTY=1 SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:YYYY-MM-DD ci/test-checks.sh`
25+
and `SOLANA_ALLOCATE_TTY=1 SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:YYYY-MM-DD ci/test-coverage.sh [args]...`
2226
to confirm the new nightly image builds. Fix any issues as needed
2327
1. Run `docker login` to enable pushing images to Docker Hub, if you're authorized.
2428
1. Run `CI=true ci/docker-rust-nightly/build.sh YYYY-MM-DD` to push the new nightly image to dockerhub.com.

ci/docker-rust/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Note: when the rust version is changed also modify
22
# ci/rust-version.sh to pick up the new image tag
3-
FROM rust:1.43.0
3+
FROM rust:1.44.0
44

55
# Add Google Protocol Buffers for Libra's metrics library.
66
ENV PROTOC_VERSION 3.8.0

ci/docker-rust/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Docker image containing rust and some preinstalled packages used in CI.
22

3+
NOTE: Recreate rust-nightly docker image after this when updating the stable rust
4+
version! Both of docker images must be updated in tandem.
5+
36
This image manually maintained:
47
1. Edit `Dockerfile` to match the desired rust version
5-
2. Run `./build.sh` to publish the new image, if you are a member of the [Solana
8+
1. Run `docker login` to enable pushing images to Docker Hub, if you're authorized.
9+
1. Run `./build.sh` to publish the new image, if you are a member of the [Solana
610
Labs](https://hub.docker.com/u/solanalabs/) Docker Hub organization.
711

ci/rust-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.43.0
21+
stable_version=1.44.0
2222
fi
2323

2424
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
2525
nightly_version="$RUST_NIGHTLY_VERSION"
2626
else
27-
nightly_version=2020-04-23
27+
nightly_version=2020-06-10
2828
fi
2929

3030

ci/test-checks.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ echo --- build environment
2828
export RUST_BACKTRACE=1
2929
export RUSTFLAGS="-D warnings"
3030

31-
if _ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets; then
31+
# Exclude --benches as it's not available in rust stable yet
32+
if _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" check --locked --tests --bins --examples; then
3233
true
3334
else
3435
check_status=$?
35-
echo "Some Cargo.lock is outdated; please update them as well"
36+
echo "Some Cargo.lock might be outdated; update them (or just be a compilation error?)"
3637
echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh [check|update] ..."
3738
exit "$check_status"
3839
fi
40+
# Ensure nightly and --benches
41+
_ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets
3942

4043
_ ci/order-crates-for-publishing.py
4144
_ cargo +"$rust_stable" fmt --all -- --check

ci/test-coverage.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ annotate() {
1111
source ci/upload-ci-artifact.sh
1212
source scripts/ulimit-n.sh
1313

14-
scripts/coverage.sh
14+
scripts/coverage.sh "$@"
15+
16+
if [[ -z $CI ]]; then
17+
exit
18+
fi
1519

1620
report=coverage-"${CI_COMMIT:0:9}".tar.gz
1721
mv target/cov/report.tar.gz "$report"

multinode-demo/validator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ setup_validator_accounts() {
285285
return 0
286286
}
287287

288-
rpc_url=$($solana_gossip rpc-url --entrypoint "$gossip_entrypoint")
288+
rpc_url=$($solana_gossip rpc-url --timeout 180 --entrypoint "$gossip_entrypoint")
289289

290290
[[ -r "$identity" ]] || $solana_keygen new --no-passphrase -so "$identity"
291291
[[ -r "$vote_account" ]] || $solana_keygen new --no-passphrase -so "$vote_account"

0 commit comments

Comments
 (0)