Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-5135

[Rust] Generate flatbuffers code automatically

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rust
    • Labels:

      Description

      This depends on the following upstream flatbuffers issues:

      Once they are resolved We should generate flatbuffers code automatically,
      as suggested by Neville Dipale:

      // [arrow/rust/arrow/build.rs]
      
      use std::path::Path;
      use flatc_rust;
      
      fn main() {
          flatc_rust::run(flatc_rust::Args {
              lang: "rust",
              inputs: &[
                  Path::new("../../format/FIle.fbs"),
                  Path::new("../../format/Message.fbs"),
                  Path::new("../../format/Schema.fbs"),
                  Path::new("../../format/Tensor.fbs"),
                  Path::new("../../format/SparseTensor.fbs"),
              ],
              out_dir: Path::new("./src/ipc/gen/"),
              // doesn't seem to be honoured
              includes: &[Path::new("../../format/")],
              ..Default::default()
          }).expect("Unable to build flatbuffer files");
      }
      
      // [arrow/rust/arrow/Cargo.toml]
      [package]
      ...
      build = "build.rs"
      
      ...
      
      [build-dependencies]
      flatc-rust = "0.1"
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kszucs Krisztian Szucs
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: