Install xargo using CI dictated cargo version if available#9068
Install xargo using CI dictated cargo version if available#9068jackcmay merged 12 commits intosolana-labs:masterfrom
Conversation
|
FYI looks like |
|
@jstarry Cool, I'll both set the stable version as the default toolchain and rip out update and replace with |
Codecov Report
@@ Coverage Diff @@
## master #9068 +/- ##
========================================
+ Coverage 80.4% 80.4% +<.1%
========================================
Files 268 268
Lines 58796 58796
========================================
+ Hits 47320 47326 +6
+ Misses 11476 11470 -6 |
|
Agreed, not going to set default toolchain |
| set -e | ||
| cargo install-update -i xargo | ||
| set -ex | ||
| cargo +"${rust_stable:-}" install xargo |
There was a problem hiding this comment.
@mvines know any cool bash tricks to improve this?
| set -e | ||
| cargo install-update -i xargo | ||
| set -ex | ||
| cargo +"${rust_stable:-}" install xargo |
There was a problem hiding this comment.
I'd just go with a simple approach:
| cargo +"${rust_stable:-}" install xargo | |
| if [[ -n $rust_stable ]]; then | |
| cargo +"$rust_stable" install xargo | |
| else | |
| cargo install xargo | |
| fi |
There was a problem hiding this comment.
shellcheck does not like this since it can't tell if rust_stable is defined (rust_stable should probably be in all caps) and would rather not have to clutter up with a spellcheck "allow" statement
(cherry picked from commit 30bed18)
Problem
The SDK install script attempts to install xargo which is required to build Rust BPF programs. The script uses whatever version of cargo is installed on the host machine to do so. in CI the version of cargo is always explicit and the machine's default toolchain is not updated, consequently the CI machines default version is very old. This old version does not support installing the latest version of xargo.
Summary of Changes
rust_stable.cargo installnow installs the latest version of a package so remove the use ofcargo install-updateFixes #