-
Notifications
You must be signed in to change notification settings - Fork 18
chore: upgrade prost #51
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
Conversation
|
I can understand not wanting to break installs for existing users, but I'm a little uneasy about introducing a new supply chain risk by relying on a third party to re-upload protoc to crates.io. I wonder if we could avoid requiring protoc when installing this crate by storing the generated Rust structs in source control. In other projects we do this by overriding the let out_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/src");
unsafe { env::set_var("OUT_DIR", &out_dir) };That can be combined with an envvar check to only compile the protobuf if protoc is installed: if env::var("PROTOC").is_ok() {
prost_build::compile_protos(...)?;
} else {
println!("protoc not found, skipping protobuf generation");
} |
thanks for the review! I removed the dependency. I am not sure 100% if my solution is what you had in mind though since I simply added also added a custom env var check. |
|
Yeah, that's roughly what I was thinking. But it looks like CI needs fixing (unrelated to your change)
|
|
I'm not sure where the |
I think it's something they invented. this env var was never set for me. I replaced it with a |
|
Looks good! There's just one more failure because of the |
ahh missed that - fixed! 🙏🏼 |
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 for the contribution!
|
|
||
| prost_build::compile_protos(&[&out_protobuf_path.join(LIBRARY_NAME).with_extension("proto")], &[&out_protobuf_path])?; | ||
|
|
||
| std::fs::rename(src_dir.join("pg_query.rs"), src_dir.join("protobuf.rs"))?; |
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 seems like this line broke the docs.rs build https://docs.rs/crate/pg_query/6.1.0/builds/1945029
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.
Maybe we should detect the DOCS_RS envvar like polywrap/rust-wrap-client#245 does
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.
pr with the fix is up: #56
upgrade prost to latest to fix gnu builds. tested it locally via docker. I think the only relevant breaking change is that
protocneeds to be available in the path now. to not break anything for consumers of this library, I added theprotoc-bin-vendoredcrate.Breaking Changes from the Changelog
v13
TryFrom<i32>for enums tokio-rs/prost#1010)v12
None?
v11