cloudwego / volo

Rust RPC framework with high-performance and strong-extensibility for building micro-services.
https://crates.io/crates/volo
Apache License 2.0
2.21k stars 181 forks source link

chore(ci): add rustfmt for cli test #448

Closed yukiiiteru closed 3 months ago

yukiiiteru commented 3 months ago

Motivation

Fix such problem in GitHub CI:

error: failed to run custom build command for `volo-gen v0.1.0 (/tmp/volo-cli-test/thrift/volo-gen)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/tmp/volo-cli-test/thrift/target/debug/build/volo-gen-a891b5fb690df431/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=volo.yml
  cargo:rerun-if-changed=/tmp/volo-cli-test/thrift/idl/echo.thrift

  --- stderr
  error: 'rustfmt' is not installed for the toolchain 'stable-x86_64-unknown-linux-gnu'.
  To install, run `rustup component add rustfmt`

  Stack backtrace:
     0: anyhow::kind::Adhoc::new
     1: anyhow::__private::format_err.1271
     2: rustup::config::Cfg::create_command_for_toolchain_
     3: rustup::cli::proxy_mode::main
     4: rustup_init::main
     5: std::sys_common::backtrace::__rust_begin_short_backtrace
     6: main
     7: __libc_start_main
     8: <unknown>
Error: Process completed with exit code 101.

Solution