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

README for prost_reflect_build::Builder is incorrect with recent changes, as either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set #132

Open
jbott opened this issue Nov 7, 2024 · 0 comments

Comments

@jbott
Copy link

jbott commented Nov 7, 2024

As of 0.11, there is a requirement that either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set, but the readme example does not show that.

The current code snippet is:

prost_reflect_build::Builder::new()
    .compile_protos(&["src/package.proto"], &["src"])
    .unwrap();

Since the prost-reflect-tests crate contains a fully functional example – it might make sense to point people to that in the readme
build.rs:

prost_reflect_build::Builder::new()
.file_descriptor_set_bytes("crate::DESCRIPTOR_POOL_BYTES")
.compile_protos_with_config(
config,
&[
"src/test.proto",
"src/test2.proto",
"src/desc.proto",
"src/desc2.proto",
"src/desc_no_package.proto",
"src/imports.proto",
"src/ext.proto",
"src/options.proto",
],
&["src/"],
)?;

crate lib.rs:
const DESCRIPTOR_POOL_BYTES: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/file_descriptor_set.bin"));

@jbott jbott changed the title README for prost-build-example is incorrect with recent changes not state that either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set README for prost-build-example is incorrect with recent changes, as either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set Nov 7, 2024
@jbott jbott changed the title README for prost-build-example is incorrect with recent changes, as either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set README for prost_reflect_build::Builder is incorrect with recent changes, as either 'descriptor_pool' or 'file_descriptor_set_bytes' must be set Nov 7, 2024
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

No branches or pull requests

1 participant