Skip to content

Commit

Permalink
Download flatc instead of building it from source (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Jun 15, 2024
1 parent 876f734 commit 68c77f1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ runs:
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
- name: Download flatc
shell: bash
run: |
curl -sL https://github.com/google/flatbuffers/releases/download/v24.3.25/Linux.flatc.binary.clang++-15.zip > ${{ runner.temp }}/flatc.zip
unzip ${{ runner.temp }}/flatc.zip -d ${{ runner.temp }}/flatc
echo "PATH=${{ runner.temp }}/flatc:$PATH" >> $GITHUB_ENV
- name: Export Path
shell: bash
run: echo "PATH=$PATH" >> $GITHUB_ENV
31 changes: 6 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ duckdb = { version = "0.10.1", features = ["bundled"] }
enum-iterator = "2.0.0"
enum_dispatch = "0.3.13"
fallible-iterator = "0.3.0"
flatbuffers = "23.5.26"
flatc = "0.2.2"
flatbuffers = "24.3.25"
flexbuffers = "2.0.0"
fs_extra = "1.3.0"
futures = { version = "0.3.30", default-features = false }
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ git submodule update --init --recursive
rye sync
```

You will also need to install flatbuffer compiler (flatc):

### Mac
```bash
brew install flatbuffers
```

## License

Licensed under the Apache License, Version 2.0 (the "License").
Expand Down
1 change: 0 additions & 1 deletion build-vortex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ rust-version.workspace = true

[dependencies]
cargo_metadata = { workspace = true }
flatc = { workspace = true }
prost-build = { workspace = true }
walkdir = { workspace = true }

Expand Down
3 changes: 1 addition & 2 deletions build-vortex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::path::{Path, PathBuf};
use std::process::Command;

use cargo_metadata::MetadataCommand;
use flatc::flatc;
use walkdir::WalkDir;

fn manifest_dir() -> PathBuf {
Expand Down Expand Up @@ -66,7 +65,7 @@ pub fn build_flatbuffers() {
let flatbuffers_dir = manifest_dir().join("flatbuffers");
let fbs_files = walk_files(&flatbuffers_dir, "fbs");
check_call(
Command::new(flatc())
Command::new("flatc")
.arg("--rust")
.arg("--filename-suffix")
.arg("")
Expand Down

0 comments on commit 68c77f1

Please sign in to comment.