-
Notifications
You must be signed in to change notification settings - Fork 533
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
prost-build triggers rebuild on arbitrary file change #139
Comments
Hmm. That workaround doesn't seem to help :-(, must be something else. |
It's most likely related to this, yes. I tried to look through the |
I don't see what the problem indicated in the todo is. Shouldn't replacing the crate root be the goal here, because otherwise we'd still always rebuild? Also note that if other build scripts emit their own paths, prost currently doesn't rebuild if the .proto changes, which seems undesirable |
It seems like it's worth documenting this at the very least. AFAICT setting it has caused no problems for me (it's not like cargo no longer detects changes in Not sure what you mean by it changes the crate root though. |
I was referring to the link to the todo comment above. I have used this feature manually in my program and have seen no problems with it, still definitely in favor of implementing this. |
This means things like cargo-watch work better. Fixes tokio-rs#139.
Sorry got my bug numbers wrong - it actually fixes #231 - not sure if it fixes this. |
Shouldn't this solve the issue? println!("cargo:rerun-if-changed=proto/schema.proto");
prost_build::compile_protos(&["proto/schema.proto"], &["proto/"]).unwrap(); |
I think it should. I'd support adding an option to |
Hello
Let's say I have some rust project and have done
cargo build
. Now I touch an arbitrary file around there, egtouch x
. If I runcargo build
now, it is very fast and mostly figures out it doesn't need to do anything.However, this changes if I introduce
prost-build
into the project. Now thecargo build
will rebuild the whole crate (and all the tests and other things if it is notcargo build
but eg.cargo test --all
).My guess is, this has something to do with the fact that the file change provokes
build.rs
to be re-run. That one, in turn, overwrites thers
files generated from protobufs, which triggers the rebuild (even though the produced files are the same).If my guess is correct, would it make sense to generate them to some temporary file first (eg.
generated_file.rs.tmp
), compare with the previous version (if present) and then move it into place only if it differs?The text was updated successfully, but these errors were encountered: