Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump rust to 1.80.1 / 2024-08-08 #2487

Merged
merged 8 commits into from
Aug 16, 2024
Merged

bump rust to 1.80.1 / 2024-08-08 #2487

merged 8 commits into from
Aug 16, 2024

Conversation

yihau
Copy link
Member

@yihau yihau commented Aug 8, 2024

Summary of Changes

@yihau
Copy link
Member Author

yihau commented Aug 9, 2024

they released a new patch. will use it

https://blog.rust-lang.org/2024/08/08/Rust-1.80.1.html

@yihau
Copy link
Member Author

yihau commented Aug 13, 2024

looking at the latest 3 anchor releases (0.29.0, 0.30.0, 0.30.1), they all depend on time v0.3.29, and Rust 1.80.1 is not happy with this version:

Screenshot 2024-08-14 at 00 04 22

not sure if it's a good idea to just run anchor test with their master branch: 86848e3

cc @joncinque

@yihau yihau marked this pull request as ready for review August 13, 2024 17:11
@yihau yihau requested review from brooksprumo and steviez August 13, 2024 17:12
@joncinque
Copy link

@yihau I think it's reasonable to use master until a release is tagged with the fix. We might be able to follow along at coral-xyz/anchor#3143

@yihau
Copy link
Member Author

yihau commented Aug 13, 2024

thank you for the confirmation @joncinque 🫶 I just submitted an issue as a reminder: #2577

brooksprumo
brooksprumo previously approved these changes Aug 13, 2024
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

👻

@ryoqun
Copy link
Member

ryoqun commented Aug 14, 2024

could be done by a follow up pr but seems coverage build is broken...

https://buildkite.com/anza/agave/builds/9332#01914c6e-206a-46bc-bcd5-bd45f56c72e2/6-12191:

warning: /tmp/.tmpAk7rfX/profraw/default-82429-4038632013895607840_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmpAk7rfX/profraw/default-122440-2816328413332674788_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmpAk7rfX/profraw/default-152543-1154487265959453352_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
error: no profile can be merged
17:10:53 [ERROR] Error while executing llvm tools: Failure while running "/usr/local/rustup/toolchains/1.80.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" "merge" "-f" "-" "-sparse" "-o" "/tmp/.tmpAk7rfX/0/grcov.profdata"
lcov: /solana/scripts/../target/cov/39418df52/coverage/lcov.info
tar: Removing leading `/solana/ci/../' from member names
artifact: /solana/ci/../target/cov/39418df52/coverage.tar

i think we need make sure to use llvm-profdata from nightly's llvm-tools-preview.

@yihau
Copy link
Member Author

yihau commented Aug 14, 2024

let me check the coverage issue 🤔

FROM ubuntu:20.04
FROM ubuntu:22.04

Choose a reason for hiding this comment

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

This is a pretty big change. I think these should be in their own separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, actually, it will only affect the tests that use Rust 1.80.1. This means v2.0 and v1.18 won’t be affected by these changes (and old master commits that are using Rust 1.79.0). do you still have concerns if the situation is as I described? to me, it's a really good chance to upgrade those things when we introduce a new rust version haha. just like a new start!

btw, I’m still struggling with the coverage tests 😢 I will keep posting here

Choose a reason for hiding this comment

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

IMO if we can make the ubuntu upgrade separately from this PR, we should. Then we keep this PR just about the rust version bump.

Copy link
Member Author

Choose a reason for hiding this comment

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

okay! let me try! I think I figured out the coverage issue. need to rebuild the image. will push commits and ping you!

Copy link

Choose a reason for hiding this comment

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

Good callout Brooks - I'm in favor of bumping the Ubuntu version, but agree that it should be external to this PR

Copy link
Member

@ryoqun ryoqun Aug 15, 2024

Choose a reason for hiding this comment

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

@yihau hmm, maybe i should have been more explicit at my suggestion of this: #2487 (comment)

i think we should use vendorized llvm from the rust-lang, instead of installing the official llvm manually.. this is easier and natually is sync with rust nightly more. in that way, bumping ubuntu (is good thing!) can be separated from this pr.

recent nightly's coverage data is incompatible with llvm 18. it only works now with llvm 19. currently coverage is run under nightly (ie using llvm 19), yet using llvm-profdata from stable rustup toolchain (which is still using llvm 18).

$ rustup component add --toolchain 1.80.1-x86_64-unknown-linux-gnu llvm-tools-preview
info: downloading component 'llvm-tools'
info: installing component 'llvm-tools'
 31.2 MiB /  31.2 MiB (100 %)  14.8 MiB/s in  2s ETA:  0s
$ rustup component add --toolchain nightly-2024-08-08-x86_64-unknown-linux-gnu llvm-tools-preview
info: downloading component 'llvm-tools'
info: installing component 'llvm-tools'
 32.7 MiB /  32.7 MiB (100 %)  14.7 MiB/s in  2s ETA:  0s

$ /home/ryoqun/.rustup/toolchains/1.80.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata --version
LLVM (http://llvm.org/):
  LLVM version 18.1.7-rust-1.80.1-stable
  Optimized build.
$ /home/ryoqun/.rustup/toolchains/nightly-2024-08-08-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata --version
LLVM (http://llvm.org/):
  LLVM version 19.1.0-rust-1.82.0-nightly
  Optimized build.

After that, I think we need to just meddle with PATH only running the grcov.

Copy link
Member

Choose a reason for hiding this comment

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

(nevertheless, thanks for working on bumping rust. as i like to use latest and greatest rust things (yet not enough time...), i'd like to appreciate your efforts very much.)

@yihau
Copy link
Member Author

yihau commented Aug 15, 2024

sorry for the late. I pushed a new commit for fixing coverage test and rebased master for solving conflict. looks all good! it's ready for another review! 🫡

Comment on lines +15 to +18
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_feature, values("static-syscalls"))',
] }
Copy link
Member

Choose a reason for hiding this comment

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

here

Comment on lines +162 to +170
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(feature, values("frozen-abi", "no-entrypoint"))',
'cfg(RUSTC_WITH_SPECIALIZATION)',
'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
]

Copy link
Member

Choose a reason for hiding this comment

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

nit: this can be a follow up pr, but it seems it's prime time for us to finally move lints from scripts/cargo-clippy-nightly.sh

for that, i think this formatting is preferred:

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
  ...
] }

like this: https://github.com/anza-xyz/agave/pull/2487/files#r1718380391

@@ -7,6 +7,10 @@ homepage = "https://anza.xyz"
license = "Apache-2.0"
edition = "2021"

[workspace.lints.rust.unexpected_cfgs]
Copy link
Member

Choose a reason for hiding this comment

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

@ryoqun
Copy link
Member

ryoqun commented Aug 15, 2024

seems there's no notable abi-related changes in rust 1.79 and 1.80. that said,

this is a few of my select cool things from the rust change log:

also, this new panic source seems not to be affecting us:
Panic if PathBuf::set_extension would add a path separator

Comment on lines +31 to +37
# Check llvm path
llvm_profdata="$(find "$(rustc +"$rust_nightly" --print sysroot)" -name llvm-profdata)"
if [ -z "$llvm_profdata" ]; then
echo "Error: couldn't find llvm-profdata. Try installing the llvm-tools component with \`rustup component add llvm-tools-preview --toolchain=$rust_nightly\`"
exit 1
fi
llvm_path="$(dirname "$llvm_profdata")"
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Copy link
Member

@ryoqun ryoqun left a comment

Choose a reason for hiding this comment

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

lgtm with nits.

@yihau
Copy link
Member Author

yihau commented Aug 16, 2024

🪖

@yihau yihau merged commit d8e95ac into anza-xyz:master Aug 16, 2024
53 checks passed
@yihau yihau deleted the bump-rust branch August 16, 2024 03:55
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
* bump rust to 1.80

* bump nightly version to 2024-07-21

* bump rust stable to 1.80.1, nightly to 2024-08-08

* clippy: macro_metavars_in_unsafe

* fix unexpected tag

* run anchor downstream test with their master

* add no-entrypoint into workspace level lint

* use correct llvm path for coverage test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants