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

protobuf gen triggers less often #7565

Merged

Conversation

illicitonion
Copy link
Contributor

Currently it triggers every rust build, which slows things down a lot.

Instead, only trigger if generated code actually changes.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a 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.

Copy link
Member

@jsirois jsirois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}
// 1026
Copy link
Sponsor Member

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?

Copy link
Contributor Author

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.
Copy link
Contributor

@blorente blorente left a 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");
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@illicitonion illicitonion force-pushed the dwagnerhall/protogen/idempotent branch from c2a499e to a7c295e Compare April 16, 2019 10:10
@illicitonion illicitonion merged commit c77bb4c into pantsbuild:master Apr 16, 2019
@illicitonion illicitonion deleted the dwagnerhall/protogen/idempotent branch April 16, 2019 14:47
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

Successfully merging this pull request may close these issues.

None yet

5 participants