Skip to content

Rename toolchain#6981

Merged
LucasSte merged 1 commit intoanza-xyz:masterfrom
LucasSte:rename
Jul 16, 2025
Merged

Rename toolchain#6981
LucasSte merged 1 commit intoanza-xyz:masterfrom
LucasSte:rename

Conversation

@LucasSte
Copy link
Copy Markdown

@LucasSte LucasSte commented Jul 15, 2025

Problem

As pointed by @febo, having only +solana for the toolchain name can be confusing, since it does not inform us which rust version we are running nor the platform tools version.

Summary of Changes

From now on, we are going to link the toolchain as <rust_version>-sbpf-solana-<platform_tools_version>. The currently released will be linked as 1.84.1-sbpf-solana-v1.50.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.2%. Comparing base (30e0ad7) to head (5e73ba6).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6981   +/-   ##
=======================================
  Coverage    83.2%    83.2%           
=======================================
  Files         853      853           
  Lines      375646   375646           
=======================================
+ Hits       312626   312690   +64     
+ Misses      63020    62956   -64     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucasSte LucasSte requested review from Lichtso, febo and joncinque July 15, 2025 22:57
@LucasSte LucasSte marked this pull request as ready for review July 15, 2025 22:57
Copy link
Copy Markdown

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks good!

@LucasSte LucasSte merged commit 6f29aeb into anza-xyz:master Jul 16, 2025
42 checks passed
@LucasSte LucasSte deleted the rename branch July 16, 2025 17:14
Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks good! I wanted to make sure this wouldn't break nix-style builds, and I think it'll be ok

Comment on lines +229 to +230
let toolchain_name = generate_toolchain_name(validated_toolchain_version.as_str());
let toolchain_argument = format!("+{toolchain_name}");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: Can you move these lines under the !config.no_rustup_override branch? generate_toolchain_name won't work properly in nix-like environments

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll see what I can do. generate_toolchain_name is outside the if condition because cargo_build_args requires a &str not a String.

Why do you think it won't work correctly? Maybe we could address that instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In nix environments, there are a few considerations:

  • rustup doesn't work, so any invocation of cargo with a toolchain fails
  • there's no concept of $HOME

The logic to find the toolchain assumes that things are stored under $HOME, so we should avoid doing that if someone doesn't want to install tools. And if someone doesn't want to use rustup, we shouldn't use any commands that have cargo +{toolchain_name}, and assume that the default rust can compile solana programs.

You can see how cargo-build-sbf is wrapped at https://github.com/arijoon/solana-nix/blob/87bea8cac979d14c758c24d2b9178c44a6e95b39/solana-cli.nix#L132

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not yet the solution for nix, but I moved the function to inside the if condition: #7024.

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