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

Install xargo using CI dictated cargo version if available #9068

Merged
merged 12 commits into from Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/rust-version.sh
Expand Up @@ -38,6 +38,7 @@ export rust_nightly_docker_image=solanalabs/rust-nightly:"$nightly_version"
declare toolchain=$1
if ! cargo +"$toolchain" -V; then
rustup install "$toolchain"
rustup default "$toolchain"
jackcmay marked this conversation as resolved.
Show resolved Hide resolved
cargo +"$toolchain" -V
fi
}
Expand Down
8 changes: 3 additions & 5 deletions sdk/bpf/scripts/install.sh
Expand Up @@ -22,12 +22,10 @@ download() {
wget "${args[@]}"
}

# Install or upgrade xargo
# Install xargo
(
cargo install cargo-update
cargo install-update-config --version =0.3.19 xargo
set -e
cargo install-update -i xargo
set -ex
cargo +"${rust_stable:-}" install xargo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mvines know any cool bash tricks to improve this?

Copy link
Member

@mvines mvines Mar 26, 2020

Choose a reason for hiding this comment

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

I'd just go with a simple approach:

Suggested change
cargo +"${rust_stable:-}" install xargo
if [[ -n $rust_stable ]]; then
cargo +"$rust_stable" install xargo
else
cargo install xargo
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

xargo --version > xargo.md 2>&1
)
# shellcheck disable=SC2181
Expand Down