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

Update to rust 1.44.0 #10585

Merged
merged 16 commits into from
Jun 16, 2020
Merged

Update to rust 1.44.0 #10585

merged 16 commits into from
Jun 16, 2020

Conversation

ryoqun
Copy link
Contributor

@ryoqun ryoqun commented Jun 15, 2020

Problem

Using older rust.

Summary of Changes

Update it

Credits

@svenski123 Special thanks for previous works at #10445. That pr greatly reduced required efforts in this pr!

prev: #9754

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 15, 2020

I'm preparing nightly now.

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 15, 2020

Also, I'm aware of rust 1.44.1 is baking now, but not bothered with waiting after reviewing its pending release notes: rust-lang/rust#73238

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 15, 2020

Hmm, it looks like updating rust and rust-nightly is tightly coupled at the moment...

CI failed...

@@ -2,23 +2,26 @@ 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).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find this job?

Copy link
Contributor

Choose a reason for hiding this comment

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

This was stale information

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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... ;)

ci/docker-run.sh Outdated
@@ -60,6 +60,10 @@ if [[ -z "$SOLANA_DOCKER_RUN_NOSETUID" ]]; then
ARGS+=(--user "$(id -u):$(id -g)")
fi

if [[ -n $SOLANA_ALLOCATE_TTY ]]; then
ARGS+=(--tty)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm impatient so I wanna view a rainbow progress bar in terminal. :)

@@ -115,7 +115,7 @@ fn main() {
// Sort keypairs so that do_bench_tps() uses the same subset of accounts for each run.
// This prevents the amount of storage needed for bench-tps accounts from creeping up
// across multiple runs.
keypairs.sort_by(|x, y| x.pubkey().to_string().cmp(&y.pubkey().to_string()));
keypairs.sort_by_key(|x| x.pubkey().to_string());
Copy link
Contributor Author

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?

Copy link
Contributor

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!

Copy link
Contributor Author

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.

@@ -11,7 +11,11 @@ annotate() {
source ci/upload-ci-artifact.sh
source scripts/ulimit-n.sh

scripts/coverage.sh
scripts/coverage.sh "$@"
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 15, 2020

I'm proud of having some perseverance. But... CI is very unstable now:

image

@codecov
Copy link

codecov bot commented Jun 16, 2020

Codecov Report

Merging #10585 into master will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff            @@
##           master   #10585    +/-   ##
========================================
  Coverage    81.8%    81.9%            
========================================
  Files         301      301            
  Lines       70637    70204   -433     
========================================
- Hits        57833    57504   -329     
+ Misses      12804    12700   -104     

scripts/coverage.sh
scripts/coverage.sh "$@"

if [[ -z $CI ]]; then
Copy link
Contributor Author

@ryoqun ryoqun Jun 16, 2020

Choose a reason for hiding this comment

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

@@ -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")
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 15 seconds to 180 to prevent another sorrow. ;)

@@ -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
Copy link
Contributor Author

@ryoqun ryoqun Jun 16, 2020

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet, thanks!

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 16, 2020

@svenski123 FYI, we're about to go rust 1.45 based on your previous efforts at #10445. Thank you very much! :)

@ryoqun ryoqun changed the title Update rust 1.44.0 Update to rust 1.44.0 Jun 16, 2020
@ryoqun ryoqun requested a review from mvines June 16, 2020 07:50
@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 16, 2020

@mvines Finally, this got ready for review and merge! I've updated relevant docs and fiddled scripts a bit while doing this for the first time. Could you review these?

ARG date

RUN set -x \
&& rustup install nightly-$date \
&& rustup component add clippy --toolchain=nightly-$date \
&& rustup component add rustfmt --toolchain=nightly-$date \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ryoqun
Copy link
Contributor Author

ryoqun commented Jun 17, 2020

Postmotem: I needed quick fixup PRs: #10633, #10634, #10640 and fixed the root cause to prevent it from re-occuring: #10651

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants