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

feat(prost-build): emit rerun commands #1140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caspermeijn
Copy link
Collaborator

@caspermeijn caspermeijn commented Aug 30, 2024

Inform cargo about the files and env vars used by prost-build. Then cargo can better determine when to rebuild a project.

  • Emit rerun-if-changed for each proto file specified
  • Emit rerun-if-changed for each include directory specified
  • Emit rerun-if-changed if file_descriptor_set_path is set
  • Emit rerun-if-env-changed for PROTOC and PROTOC_INCLUDE

https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed

BREAKING CHANGE: Previously cargo assumed it had to rerun build.rs if any files in the project changed. prost-build will now emit rerun commands, which means only the explicitly marked files cause a rerun. If your build.rs is dependent on any other file paths than those given to prost-build, then your build.rs needs to emit rerun commands as well.

Inform `cargo` about the files and env vars used by `prost-build`. Then `cargo` can better determine when to rebuild a project.

- Emit `rerun-if-changed` for each proto file specified
- Emit `rerun-if-changed` for each include directory specified
- Emit `rerun-if-changed` if `file_descriptor_set_path` is set
- Emit `rerun-if-env-changed` for `PROTOC` and `PROTOC_INCLUDE`

https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed

BREAKING CHANGE: Previously `cargo` assumed it had to rerun `build.rs` if any files in the project changed. `prost-build` will now emit `rerun` commands, which means only the explicitly marked files cause a rerun. If your `build.rs` is dependent on any other file paths than those given to `prost-build`, then your `build.rs` needs to emit `rerun` commands as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant