You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By using tonic_build with the default settings, we inadvertently added a build-time dependency on rustfmt, which was later noticed by a downstream packager, who requested we remove the dependency to avoid extra build-time dependencies.
Proposal
I would suggest that there be three options regarding formatting of generated code:
Don't format generated code
Always format generated code
Only format generated code if rustfmt is available. (I.e. silently continue if launching rustfmt returns a not found error.)
And that 3 should be the default, since formatted code is nice and low-cost if rustfmt is available, but otherwise not important enough to fail a build.
Alternatives
We could do this ourselves in the build script, i.e. check at build-time for rustfmt and pass true or false to the format method of the builder accordingly. However, it seems like this would be a good default that other users of the crate would benefit from.
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
Motivation
By using
tonic_build
with the default settings, we inadvertently added a build-time dependency onrustfmt
, which was later noticed by a downstream packager, who requested we remove the dependency to avoid extra build-time dependencies.Proposal
I would suggest that there be three options regarding formatting of generated code:
And that 3 should be the default, since formatted code is nice and low-cost if rustfmt is available, but otherwise not important enough to fail a build.
Alternatives
We could do this ourselves in the build script, i.e. check at build-time for rustfmt and pass
true
orfalse
to theformat
method of the builder accordingly. However, it seems like this would be a good default that other users of the crate would benefit from.The text was updated successfully, but these errors were encountered: