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

Upgrades Rust to 1.84.0 #4439

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Jan 13, 2025

Upgrades Rust to 1.84.0

https://releases.rs/docs/1.84.0/

I also built this commit and ran it on a validator, which was able to catch up successfully.

@brooksprumo
Copy link
Author

@yihau Can the CI images be updated to include rust 1.84.0 and rust nightly 2024-11-22, please?

@yihau
Copy link
Member

yihau commented Jan 14, 2025

sure! just pushed and it looks like checks1 needs some love 🫠

@brooksprumo
Copy link
Author

brooksprumo commented Jan 14, 2025

sure! just pushed and it looks like checks1 needs some love 🫠

I've reverted rust nightly due to the program/sbf errors:

error: unexpected `cfg` condition value: `custom-heap`
  --> rust/mem/src/lib.rs:13:1
   |
13 | solana_program::entrypoint_no_alloc!(process_instruction);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: no expected values for `feature`
   = help: consider adding `custom-heap` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `-D unexpected-cfgs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
   = note: this error originates in the macro `$crate::custom_heap_default` which comes from the expansion of the macro `solana_program::entrypoint_no_alloc` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `cfg` condition value: `solana`
  --> rust/mem/src/lib.rs:13:1
   |
13 | solana_program::entrypoint_no_alloc!(process_instruction);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, and `vita` and 6 more
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this error originates in the macro `$crate::custom_heap_default` which comes from the expansion of the macro `solana_program::entrypoint_no_alloc` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `cfg` condition value: `custom-panic`
  --> rust/mem/src/lib.rs:13:1
   |
13 | solana_program::entrypoint_no_alloc!(process_instruction);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: no expected values for `feature`
   = help: consider adding `custom-panic` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this error originates in the macro `$crate::custom_panic_default` which comes from the expansion of the macro `solana_program::entrypoint_no_alloc` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `cfg` condition value: `solana`
  --> rust/mem/src/lib.rs:13:1
   |
13 | solana_program::entrypoint_no_alloc!(process_instruction);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, and `vita` and 6 more
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this error originates in the macro `$crate::custom_panic_default` which comes from the expansion of the macro `solana_program::entrypoint_no_alloc` (in Nightly builds, run with -Z macro-backtrace for more info)

[..]

@yihau Sorry, can you revert the CI rust nightly back to 2024-08-08, please?

@brooksprumo
Copy link
Author

I've reverted rust nightly due to the program/sbf errors:

@pgarg66 I think I need some help to figure out how to resolve these build errors (#4439 (comment)) when using rust nightly 2024-11-22. Can someone on your team take a look, please?

Even when I try adding the following into the programs/sbf/Cargo.toml and the programs/sbf/rust/*/Cargo.toml files I still get the errors.

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
    'cfg(target_os, values("solana"))',
    'cfg(feature, values("custom-heap", "custom-panic"))',
]

@pgarg66
Copy link

pgarg66 commented Jan 14, 2025

I've reverted rust nightly due to the program/sbf errors:

@pgarg66 I think I need some help to figure out how to resolve these build errors (#4439 (comment)) when using rust nightly 2024-11-22. Can someone on your team take a look, please?

Even when I try adding the following into the programs/sbf/Cargo.toml and the programs/sbf/rust/*/Cargo.toml files I still get the errors.

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
    'cfg(target_os, values("solana"))',
    'cfg(feature, values("custom-heap", "custom-panic"))',
]

Hey @LucasSte, could you take a look at it?

@LucasSte
Copy link

I'll have a look. I'm just finishing something. What was the command you were trying? Clippy?

@brooksprumo
Copy link
Author

What was the command you were trying? Clippy?

It's checks1 from CI. So go to programs/sbf and do

cargo +nightly-2024-11-22 check --locked --workspace --all-targets --features dummy-for-ci-check,frozen-abi

@brooksprumo
Copy link
Author

@yihau I think I need your help... Take a look at local-cluster 1 of 10 here: https://buildkite.com/anza/agave/builds/17124#019465f2-d947-441c-bd22-278558506ea0

It failed, but because there were zero tests to run.

    Finished `test` profile [unoptimized + debuginfo] target(s) in 1m 56s
------------
 Nextest run ID e7c5c045-de26-4a0c-bbf7-eb148f54c497 with nextest profile: ci
    Starting 0 tests across 1 binary (52 tests skipped)
------------
     Summary [   0.001s] 0 tests run: 0 passed, 52 skipped
error: no tests to run
(hint: use `--no-tests` to customize)
🚨 Error: The command exited with status 4

I'm not sure why there are zero tests? I'm also not sure if that should be an error?

@yihau yihau mentioned this pull request Jan 14, 2025
@yihau
Copy link
Member

yihau commented Jan 14, 2025

the PR should help 🫠

@LucasSte
Copy link

Crates in programs/sbf must now inherit the lints from the workspace manually, so I needed to set workspace = true for all the erroring ones.

#4463

@brooksprumo brooksprumo marked this pull request as ready for review January 15, 2025 03:33
@brooksprumo
Copy link
Author

Now that #4463 has merged, I've re-upgraded rust nightly back to 2024-11-22.

@brooksprumo brooksprumo force-pushed the rust-1.84.0/upgrade branch 3 times, most recently from db4296c to 4792547 Compare January 15, 2025 18:13
@brooksprumo
Copy link
Author

Ugh... More nightly clippy lints to deal with... re-re-revert nightly 🫠

Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

Let's goooo. Always nice to get this done before creating the new stable branch

@brooksprumo brooksprumo merged commit 535b0db into anza-xyz:master Jan 15, 2025
19 checks passed
@brooksprumo brooksprumo deleted the rust-1.84.0/upgrade branch January 15, 2025 20:10
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