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

Make rustfmt optional #298

Closed
jyn514 opened this issue Mar 2, 2022 · 4 comments
Closed

Make rustfmt optional #298

jyn514 opened this issue Mar 2, 2022 · 4 comments

Comments

@jyn514
Copy link

jyn514 commented Mar 2, 2022

I got this error building console-api just now:

error: failed to run custom build command for `console-api v0.1.0`

Caused by:
  process didn't exit successfully: `/home/jnelson/work/redacted/target/debug/build/console-api-fe07466b9cc39039/build-script-build` (exit status: 1)
  --- stderr
  error: 'rustfmt' is not installed for the toolchain '1.58-x86_64-unknown-linux-gnu'
  To install, run `rustup component add rustfmt --toolchain 1.58-x86_64-unknown-linux-gnu`

Rustfmt shouldn't be strictly necessary for console to build - could you make the build script handle the error gracefully instead of raising a hard error?

@hawkw
Copy link
Member

hawkw commented Mar 3, 2022

I believe we can do this by disabling the rustfmt feature flag on the tonic-build dependency.

@hawkw
Copy link
Member

hawkw commented Mar 7, 2022

...huh, that's weird, it looks like the rustfmt feature is disabled, since we depend on tonic-build with default-features = false:

[build-dependencies]
tonic-build = { version = "0.6", default-features = false, features = [
"prost",
] }

@hawkw
Copy link
Member

hawkw commented Mar 7, 2022

FWIW, it looks like tonic-build will completely drop the runtime rustfmt dependency in the next release: hyperium/tonic#904

@jyn514
Copy link
Author

jyn514 commented Mar 7, 2022

Ah, this is my fault, sorry - I had another dependency that depended on tonic-build and didn't disable the default features. Cargo unified the feature between the other dependency and console.

@jyn514 jyn514 closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants