wackywendell opened a new pull request, #14048:
URL: https://github.com/apache/datafusion/pull/14048

   ## Which issue does this PR close?
   
   Closes #13853.
   
   ## Rationale for this change
   
   This uses the same basic solution as in `substrait-rs`:
   
   
https://github.com/substrait-io/substrait-rs/blob/bbcc9f6d0b084a13706f39a43bbba9d37bf2a959/Cargo.toml#L62-L63
   
   - `substrait-rs` has an optional `protoc` 
[feature](https://github.com/substrait-io/substrait-rs/blob/d0945cd0123e2cb39667e196b410a610242bcd54/Cargo.toml#L31)
   0 The `protoc` feature [adds a 
dependency](https://github.com/substrait-io/substrait-rs/blob/d0945cd0123e2cb39667e196b410a610242bcd54/Cargo.toml#L54)
 on [`protobuf-src`](
   https://docs.rs/protobuf-src/2.1.0/protobuf_src/), which ensures a fixed 
version of the protobuf compiler by compiling/vendoring it
   - In the `build.rs` file, the [vendored 
protoc](https://github.com/substrait-io/substrait-rs/blob/d0945cd0123e2cb39667e196b410a610242bcd54/build.rs#L284-L285)
 is used when the `protoc` feature is enabled
   - The feature is [enabled for 
`docs.rs`](https://github.com/substrait-io/substrait-rs/blob/d0945cd0123e2cb39667e196b410a610242bcd54/Cargo.toml#L62C1-L63)
   
   
   ## What changes are included in this PR?
   
   Given that `datafusion-substrait` only uses the `protoc` compiler with the 
`substrait-rs` crate and already has a `protoc` feature, we should be able to 
solve this problem by enabling the `protoc` feature for `docs.rs`, as done here.
   
   ## Are these changes tested?
   
   This is difficult to test, as it depends on the `docs.rs` environment, which 
is hard to replicate.
   
   I have verified locally that adding the same version of `protoc` to my path 
as in `docs.rs` leads to the problem, and is solved with enabling all features:
   
   ```sh
   datafusion/datafusion/substrait ❯ PATH="$HOME/protobuf/bin:$PATH" cargo doc
   …
   Error: Custom { kind: Other, error: "protoc failed: substrait/algebra.proto: 
This file contains proto3 optional fields, but 
--experimental_allow_proto3_optional was not set.\n" }
   datafusion/datafusion/substrait ❯ PATH="$HOME/protobuf/bin:$PATH" cargo doc 
--all-features
   …
   Documenting datafusion-substrait v44.0.0
       Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 14s
      Generated 
/Users/wendell.smith/go/src/github.com/DataDog/datafusion/target/doc/datafusion_substrait/index.html
   ```
   
   ## Are there any user-facing changes?
   
   No, other than that `docs.rs` should work again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to