-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
introduce cargo-nightly #29319
introduce cargo-nightly #29319
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||
#!/usr/bin/env bash | ||||||
|
||||||
# shellcheck source=ci/rust-version.sh | ||||||
here=$(dirname "$0") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a well known(?) pattern used for this: here=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) From here: https://stackoverflow.com/a/246128/1989046 I can see that in other scripts the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be a good idea to make a separate PR for this: I saw more than one way of doing this in the scripts (ci, scripts folders) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
source "${here}"/ci/rust-version.sh nightly | ||||||
set -x | ||||||
exec cargo "+${rust_nightly}" "${@}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
here="$(dirname "$0")" | ||
cargo="$(readlink -f "${here}/../cargo")" | ||
cargoNightly="$(readlink -f "${here}/../cargo")" | ||
|
||
if [[ -z $cargo ]]; then | ||
>&2 echo "Failed to find cargo. Mac readlink doesn't support -f. Consider switching | ||
if [[ -z $cargoNightly ]]; then | ||
>&2 echo "Failed to find cargo-nightly. Mac readlink doesn't support -f. Consider switching | ||
to gnu readlink with 'brew install coreutils' and then symlink greadlink as | ||
/usr/local/bin/readlink." | ||
exit 1 | ||
fi | ||
|
||
set -ex | ||
|
||
"$cargo" nightly fmt --all | ||
(cd programs/sbf && "$cargo" nightly fmt --all) | ||
(cd sdk/cargo-build-sbf/tests/crates/fail && "$cargo" nightly fmt --all) | ||
(cd sdk/cargo-build-sbf/tests/crates/noop && "$cargo" nightly fmt --all) | ||
(cd storage-bigtable/build-proto && "$cargo" nightly fmt --all) | ||
(cd web3.js/test/fixtures/noop-program && "$cargo" nightly fmt --all) | ||
"$cargoNightly" fmt --all | ||
(cd programs/sbf && "$cargoNightly" fmt --all) | ||
(cd sdk/cargo-build-sbf/tests/crates/fail && "$cargoNightly" fmt --all) | ||
(cd sdk/cargo-build-sbf/tests/crates/noop && "$cargoNightly" fmt --all) | ||
(cd storage-bigtable/build-proto && "$cargoNightly" fmt --all) | ||
(cd web3.js/test/fixtures/noop-program && "$cargoNightly" fmt --all) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this shellcheck directive directly above
source "${here}"/ci/rust-version.sh nightly