-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Update to rust 1.44.0 #10585
Update to rust 1.44.0 #10585
Changes from all commits
42168b8
e01abc5
3ab49d8
78dc87d
4db7afd
93e45ce
6eb0307
811a39b
b94e5fa
acd8455
b614fab
82a7e50
56f1dc1
a60ab54
0833a68
3b99559
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
FROM solanalabs/rust:1.43.0 | ||
FROM solanalabs/rust:1.44.0 | ||
ARG date | ||
|
||
RUN set -x \ | ||
&& rustup install nightly-$date \ | ||
&& rustup component add clippy --toolchain=nightly-$date \ | ||
&& rustup component add rustfmt --toolchain=nightly-$date \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
&& rustup show \ | ||
&& rustc --version \ | ||
&& cargo --version \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,27 @@ Docker image containing rust nightly and some preinstalled crates used in CI. | |
|
||
This image may be manually updated by running `CI=true ./build.sh` if you are a member | ||
of the [Solana Labs](https://hub.docker.com/u/solanalabs/) Docker Hub | ||
organization, but it is also automatically updated periodically by | ||
[this automation](https://buildkite.com/solana-labs/solana-ci-docker-rust-nightly). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find this job? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was stale information |
||
organization. | ||
|
||
## Moving to a newer nightly | ||
|
||
NOTE: Follow instructions in docker-rust/README.md before this when updating the stable | ||
rust version as well. | ||
|
||
We pin the version of nightly (see the `ARG nightly=xyz` line in `Dockerfile`) | ||
to avoid the build breaking at unexpected times, as occasionally nightly will | ||
introduce breaking changes. | ||
|
||
To update the pinned version: | ||
1. Edit `Dockerfile` to match the desired stable rust version to base on if needed. | ||
1. Run `ci/docker-rust-nightly/build.sh` to rebuild the nightly image locally, | ||
or potentially `ci/docker-rust-nightly/build.sh YYYY-MM-DD` if there's a | ||
specific YYYY-MM-DD that is desired (default is today's build). | ||
Check https://rust-lang.github.io/rustup-components-history/ for build | ||
status | ||
1. Update `ci/rust-version.sh` to reflect the new nightly `YYY-MM-DD` | ||
1. Run `SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:YYYY-MM-DD ci/test-coverage.sh` | ||
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` | ||
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]...` | ||
to confirm the new nightly image builds. Fix any issues as needed | ||
1. Run `docker login` to enable pushing images to Docker Hub, if you're authorized. | ||
1. Run `CI=true ci/docker-rust-nightly/build.sh YYYY-MM-DD` to push the new nightly image to dockerhub.com. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Docker image containing rust and some preinstalled packages used in CI. | ||
|
||
NOTE: Recreate rust-nightly docker image after this when updating the stable rust | ||
version! Both of docker images must be updated in tandem. | ||
|
||
This image manually maintained: | ||
1. Edit `Dockerfile` to match the desired rust version | ||
2. Run `./build.sh` to publish the new image, if you are a member of the [Solana | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I didn't know it's not needed to manually increment those numbers... ;) |
||
1. Run `docker login` to enable pushing images to Docker Hub, if you're authorized. | ||
1. Run `./build.sh` to publish the new image, if you are a member of the [Solana | ||
Labs](https://hub.docker.com/u/solanalabs/) Docker Hub organization. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,11 @@ annotate() { | |
source ci/upload-ci-artifact.sh | ||
source scripts/ulimit-n.sh | ||
|
||
scripts/coverage.sh | ||
scripts/coverage.sh "$@" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to do like this: $ SOLANA_ALLOCATE_TTY=1 SOLANA_DOCKER_RUN_NOSETUID=1 ci/docker-run.sh --nopull solanalabs/rust-nightly:2020-06-15 ci/test-coverage.sh -p solana-sdk test_slot_duration_from_slots_per_year |
||
|
||
if [[ -z $CI ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this manual use case: https://github.com/solana-labs/solana/pull/10585/files#diff-1143f3dc73bf3e79cf89244ccda0fe97R25 |
||
exit | ||
fi | ||
|
||
report=coverage-"${CI_COMMIT:0:9}".tar.gz | ||
mv target/cov/report.tar.gz "$report" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,7 +285,7 @@ setup_validator_accounts() { | |
return 0 | ||
} | ||
|
||
rpc_url=$($solana_gossip rpc-url --entrypoint "$gossip_entrypoint") | ||
rpc_url=$($solana_gossip rpc-url --timeout 180 --entrypoint "$gossip_entrypoint") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, was hard to debug.... Well, this depended on exact build timing. ;) Greatly increase from the default |
||
|
||
[[ -r "$identity" ]] || $solana_keygen new --no-passphrase -so "$identity" | ||
[[ -r "$vote_account" ]] || $solana_keygen new --no-passphrase -so "$vote_account" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,10 +40,12 @@ pub fn years_as_slots(years: f64, tick_duration: &Duration, ticks_per_slot: u64) | |
|
||
/// From slots per year to slot duration | ||
pub fn slot_duration_from_slots_per_year(slots_per_year: f64) -> Duration { | ||
// Regarding division by zero potential below: for some reason, if Rust stores an `inf` f64 and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @CriesofCarrots This is added by https://github.com/solana-labs/solana/pull/7130/files#diff-826aa0353ee517a070e3c98cc61423eaR43 FYI, rust (stable rust 1.45+; this will be affected in our nightly CI builds after this pr) is actually fixing this behavior: https://github.com/rust-lang/rust/blob/master/RELEASES.md#compatibility-notes I'm preserving the current behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sweet, thanks! |
||
// then converts it to a u64 on use, it always returns 0, as opposed to std::u64::MAX or any | ||
// other huge value | ||
let slot_in_ns = (SECONDS_PER_YEAR * 1_000_000_000.0) / slots_per_year; | ||
// Recently, rust changed from infinity as usize being zero to 2^64-1; ensure it's zero here | ||
let slot_in_ns = if slots_per_year != 0.0 { | ||
(SECONDS_PER_YEAR * 1_000_000_000.0) / slots_per_year | ||
} else { | ||
0.0 | ||
}; | ||
Duration::from_nanos(slot_in_ns as u64) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sakridge, @jstarry: I wonder why this is sorted in terms of base58...? Well, why
.to_string()
is needed? Plain binary byte-for-byte ordering isn't enough?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryoqun I can't think of a good reason. binary comparison sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this as a separate pr for back-porting.