@@ -19,38 +19,38 @@ use std::path::Path;
1919
2020fn main ( ) -> Result < ( ) , String > {
2121 use std:: io:: Write ;
22-
23- let out = std:: path:: PathBuf :: from ( std:: env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
24-
25- // for use in docker build where file changes can be wonky
26- println ! ( "cargo:rerun-if-env-changed=FORCE_REBUILD" ) ;
27-
28- let version = rustc_version:: version ( ) . unwrap ( ) ;
29- println ! ( "cargo:rustc-env=RUSTC_VERSION={version}" ) ;
30-
31- let path = "src/proto/generated/protobuf.rs" ;
32-
33- // We don't include the proto files in releases so that downstreams
34- // do not need to have PROTOC included
35- if Path :: new ( "src/proto/datafusion_ray.proto" ) . exists ( ) {
36- println ! ( "cargo:rerun-if-changed=src/proto/datafusion_common.proto" ) ;
37- println ! ( "cargo:rerun-if-changed=src/proto/datafusion.proto" ) ;
38- println ! ( "cargo:rerun-if-changed=src/proto/datafusion_ray.proto" ) ;
39- tonic_build:: configure ( )
40- . extern_path ( ".datafusion" , "::datafusion_proto::protobuf" )
41- . extern_path ( ".datafusion_common" , "::datafusion_proto::protobuf" )
42- . compile ( & [ "src/proto/datafusion_ray.proto" ] , & [ "src/proto" ] )
43- . map_err ( |e| format ! ( "protobuf compilation failed: {e}" ) ) ?;
44- let generated_source_path = out. join ( "datafusion_ray.protobuf.rs" ) ;
45- let code = std:: fs:: read_to_string ( generated_source_path) . unwrap ( ) ;
46- let mut file = std:: fs:: OpenOptions :: new ( )
47- . write ( true )
48- . truncate ( true )
49- . create ( true )
50- . open ( path)
51- . unwrap ( ) ;
52- file. write_all ( code. as_str ( ) . as_ref ( ) ) . unwrap ( ) ;
53- }
54-
22+ /*
23+ let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
24+
25+ // for use in docker build where file changes can be wonky
26+ println!("cargo:rerun-if-env-changed=FORCE_REBUILD");
27+
28+ let version = rustc_version::version().unwrap();
29+ println!("cargo:rustc-env=RUSTC_VERSION={version}");
30+
31+ let path = "src/proto/generated/protobuf.rs";
32+
33+ // We don't include the proto files in releases so that downstreams
34+ // do not need to have PROTOC included
35+ if Path::new("src/proto/datafusion_ray.proto").exists() {
36+ println!("cargo:rerun-if-changed=src/proto/datafusion_common.proto");
37+ println!("cargo:rerun-if-changed=src/proto/datafusion.proto");
38+ println!("cargo:rerun-if-changed=src/proto/datafusion_ray.proto");
39+ tonic_build::configure()
40+ .extern_path(".datafusion", "::datafusion_proto::protobuf")
41+ .extern_path(".datafusion_common", "::datafusion_proto::protobuf")
42+ .compile(&["src/proto/datafusion_ray.proto"], &["src/proto"])
43+ .map_err(|e| format!("protobuf compilation failed: {e}"))?;
44+ let generated_source_path = out.join("datafusion_ray.protobuf.rs");
45+ let code = std::fs::read_to_string(generated_source_path).unwrap();
46+ let mut file = std::fs::OpenOptions::new()
47+ .write(true)
48+ .truncate(true)
49+ .create(true)
50+ .open(path)
51+ .unwrap();
52+ file.write_all(code.as_str().as_ref()).unwrap();
53+ }
54+ */
5555 Ok ( ( ) )
5656}
0 commit comments