alamb commented on code in PR #3333:
URL: https://github.com/apache/arrow-datafusion/pull/3333#discussion_r962293468
##########
datafusion/proto/build.rs:
##########
@@ -47,12 +49,24 @@ fn build() -> Result<(), String> {
.build(&[".datafusion"])
.map_err(|e| format!("pbjson compilation failed: {}", e))?;
+ // .serde.rs is not a valid package name, so append to datafusion.rs so we
can treat it normally
+ let proto = std::fs::read_to_string(out.join("datafusion.rs")).unwrap();
+ let json =
std::fs::read_to_string(out.join("datafusion.serde.rs")).unwrap();
+ let mut file = std::fs::OpenOptions::new()
+ .write(true)
+ .create(true)
+ .open("src/generated/datafusion.rs")
+ .unwrap();
+ file.write(proto.as_str().as_ref()).unwrap();
+ file.write(json.as_str().as_ref()).unwrap();
+
Ok(())
}
#[cfg(not(feature = "json"))]
fn build() -> Result<(), String> {
prost_build::Config::new()
+ .out_dir("src/generated")
Review Comment:
```suggestion
// Generate code in `src` directory so it is recognized more easily
by IDEs
.out_dir("src/generated")
```
##########
.github/workflows/rust.yml:
##########
@@ -277,7 +277,9 @@ jobs:
rustup default stable
rustup component add rustfmt
- name: Run
- run: ci/scripts/rust_fmt.sh
+ run: |
+ echo '' > datafusion/proto/src/generated/datafusion.rs
Review Comment:
This is needed so it works on a clean checkout, right?
--
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]