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
protobuf gen triggers less often #7565
protobuf gen triggers less often #7565
Conversation
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.
I can’t comment to the actual code, but yay! Thanks.
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.
Yay!
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.
Thanks!
} | ||
// 1026 |
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.
Is this trailing comment necessary?
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.
Oops, leftover from when I was testing when things trigger :)
Currently it triggers every rust build, which slows things down a lot. Instead, only trigger if generated code actually changes.
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.
I have learnt many things on this PR, looks good thanks!
let mut rustfmt_config = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
rustfmt_config.pop(); // bazel_protos | ||
rustfmt_config.pop(); // process_execution | ||
rustfmt_config.push("rustfmt.toml"); |
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.
It's unfortunate that we don't have a good way of not depending on this dir structure, something like CARGO_WORKSPACE_DIR
. However, would it make sense for this to fail with a nice error here? Something like panic!("I assumed that rustfmt.toml was two levels up from {}, but the directory structure seems to have changed", env!("CARGO_MANIFEST_DIR"))
.
Maybe not worth the effort since it will error anyway, I just don't like having to figure out the implicit dependency when it changes.
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.
Done
On travis, it may be across devices
c2a499e
to
a7c295e
Compare
Currently it triggers every rust build, which slows things down a lot.
Instead, only trigger if generated code actually changes.