diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -164,16 +164,10 @@ sudo apt-get -t buster-backports install shellcheck ``` -If you are modifying Rust files, you will need to install a stable rust version, -plus a nightly toolchain called "abc-nightly" for formatting: +If you are modifying Rust files, you will need [rustup](https://rustup.rs), which will download the toolchain used by the project the next time `arc lint` works on modified .rs files (will take some time - once - as it downloads). ```bash -# Install latest stable Rust version -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -source ~/.cargo/env -rustup install nightly-2022-06-29 -rustup component add rustfmt --toolchain nightly-2022-06-29 -# Name the nightly toolchain "abc-nightly" -rustup toolchain link abc-nightly "$(rustc +nightly-2022-06-29 --print sysroot)" +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +source "$HOME/.cargo/env" ``` Contributing to the web projects diff --git a/arcanist/linter/RustfmtLinter.php b/arcanist/linter/RustfmtLinter.php --- a/arcanist/linter/RustfmtLinter.php +++ b/arcanist/linter/RustfmtLinter.php @@ -18,11 +18,7 @@ } public function getInstallInstructions() { - return pht('You have to install a nightly Rust toolchain for this ' . - 'linter, and name it "abc-nightly". You can do so via ' . - '`rustup install nightly-2022-06-29` and then ' . - '`ABC_NIGHTLY="$(rustc +nightly-2022-06-29 --print sysroot)"` ' . - 'and then `rustup toolchain link abc-nightly "${ABC_NIGHTLY}"`'); + return pht('You have to install rustup (https://rustup.rs).'); } public function getLinterName() { @@ -39,7 +35,6 @@ protected function getMandatoryFlags() { return array( - '+abc-nightly', '--emit', 'stdout', '--unstable-features', '--skip-children', @@ -48,7 +43,7 @@ } public function getVersion() { - list($err, $stdout, $stderr) = exec_manual('%C +abc-nightly --version', + list($err, $stdout, $stderr) = exec_manual('%C --version', $this->getExecutableCommand()); if ($err) { diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2022-06-29"