From 5330cc818855f90410205b631d424faf4117e2a2 Mon Sep 17 00:00:00 2001 From: CGodiksen <36046286+CGodiksen@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:09:39 +0200 Subject: [PATCH 1/5] Install protox --- Cargo.lock | 144 +++++++++++++++++++++++++++++- Cargo.toml | 1 + crates/modelardb_types/Cargo.toml | 3 +- 3 files changed, 145 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0e7ac36..6629fa36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -921,6 +921,12 @@ dependencies = [ "vsimd", ] +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + [[package]] name = "bigdecimal" version = "0.4.10" @@ -1250,7 +1256,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958c5d6ecf1f214b4c2bbbbf6ab9523a864bd136dcf71a7e8904799acfe1ad47" dependencies = [ "unicode-segmentation", - "unicode-width", + "unicode-width 0.2.2", ] [[package]] @@ -3343,6 +3349,72 @@ version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" +[[package]] +name = "logos" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff472f899b4ec2d99161c51f60ff7075eeb3097069a36050d8037a6325eb8154" +dependencies = [ + "logos-derive 0.15.1", +] + +[[package]] +name = "logos" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2c55a318a87600ea870ff8c2012148b44bf18b74fad48d0f835c38c7d07c5f" +dependencies = [ + "logos-derive 0.16.1", +] + +[[package]] +name = "logos-codegen" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "192a3a2b90b0c05b27a0b2c43eecdb7c415e29243acc3f89cc8247a5b693045c" +dependencies = [ + "beef", + "fnv", + "lazy_static", + "proc-macro2", + "quote", + "regex-syntax", + "rustc_version", + "syn", +] + +[[package]] +name = "logos-codegen" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b3ffaa284e1350d017a57d04ada118c4583cf260c8fb01e0fe28a2e9cf8970" +dependencies = [ + "fnv", + "proc-macro2", + "quote", + "regex-automata", + "regex-syntax", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "605d9697bcd5ef3a42d38efc51541aa3d6a4a25f7ab6d1ed0da5ac632a26b470" +dependencies = [ + "logos-codegen 0.15.1", +] + +[[package]] +name = "logos-derive" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d3a9855747c17eaf4383823f135220716ab49bea5fbea7dd42cc9a92f8aa31" +dependencies = [ + "logos-codegen 0.16.1", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -3380,6 +3452,28 @@ version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "unicode-width 0.1.14", +] + +[[package]] +name = "miette-derive" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "mime" version = "0.3.17" @@ -3553,6 +3647,7 @@ dependencies = [ "proptest", "prost", "prost-build", + "protox", ] [[package]] @@ -4032,6 +4127,18 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-reflect" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590aa145fee8f7a26b5a6055365e7c5e89a5c1caae9869de76ec0ee73181a2f9" +dependencies = [ + "logos 0.16.1", + "miette", + "prost", + "prost-types", +] + [[package]] name = "prost-types" version = "0.14.4" @@ -4041,6 +4148,33 @@ dependencies = [ "prost", ] +[[package]] +name = "protox" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f25a07a73c6717f0b9bbbd685918f5df9815f7efba450b83d9c9dea41f0e3a1" +dependencies = [ + "bytes", + "miette", + "prost", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", +] + +[[package]] +name = "protox-parse" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "072eee358134396a4643dff81cfff1c255c9fbd3fb296be14bdb6a26f9156366" +dependencies = [ + "logos 0.15.1", + "miette", + "prost-types", + "thiserror", +] + [[package]] name = "psm" version = "0.1.31" @@ -4526,7 +4660,7 @@ dependencies = [ "nix", "radix_trie", "unicode-segmentation", - "unicode-width", + "unicode-width 0.2.2", "utf8parse", "windows-sys 0.61.2", ] @@ -5355,6 +5489,12 @@ version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + [[package]] name = "unicode-width" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index 52b7e4e5..562f8232 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ futures = "0.3.32" log = "0.4.29" object_store = "0.13.2" proptest = "1.11.0" +protox = "0.9.1" prost = "0.14.3" prost-build = "0.14.3" rand = "0.10.1" diff --git a/crates/modelardb_types/Cargo.toml b/crates/modelardb_types/Cargo.toml index 824135e5..04bec60f 100644 --- a/crates/modelardb_types/Cargo.toml +++ b/crates/modelardb_types/Cargo.toml @@ -29,10 +29,11 @@ prost.workspace = true [build-dependencies] prost-build.workspace = true +protox.workspace = true [dev-dependencies] modelardb_test = { path = "../modelardb_test" } proptest.workspace = true [package.metadata.cargo-machete] -ignored = ["prost-build"] +ignored = ["prost-build", "protox"] From 65446cd67f76873279576ba97ad9dd3aac64b829 Mon Sep 17 00:00:00 2001 From: CGodiksen <36046286+CGodiksen@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:11:27 +0200 Subject: [PATCH 2/5] Use protox to compile .proto file instead of protoc compiler --- crates/modelardb_types/build.rs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/crates/modelardb_types/build.rs b/crates/modelardb_types/build.rs index 05bb5720..7bdbb252 100644 --- a/crates/modelardb_types/build.rs +++ b/crates/modelardb_types/build.rs @@ -1,9 +1,28 @@ -use std::io::Result as StdIoResult; +/* Copyright 2026 The ModelarDB Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -fn main() -> StdIoResult<()> { - // Tell Cargo to rerun the build script if the proto definition changes. +use std::error::Error; + +fn main() -> Result<(), Box> { + // Rerun the build script if the proto definition changes. println!("cargo::rerun-if-changed=src/flight/protocol.proto"); - prost_build::compile_protos(&["src/flight/protocol.proto"], &["src/"])?; + // Compile with the pure Rust protox compiler instead of protoc, then let prost-build generate + // Rust from the resulting FileDescriptorSet. + let file_descriptors = protox::compile(["src/flight/protocol.proto"], ["src/"])?; + prost_build::compile_fds(file_descriptors)?; + Ok(()) } From ad07431e5763fe5dbc19f3bd60e010ae6ee8eaec Mon Sep 17 00:00:00 2001 From: CGodiksen <36046286+CGodiksen@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:11:45 +0200 Subject: [PATCH 3/5] Remove protoc from setups --- .github/workflows/build-lint-test-and-upload.yml | 12 ------------ Dockerfile | 2 -- crates/modelardb_embedded/bindings/python/setup.py | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/build-lint-test-and-upload.yml b/.github/workflows/build-lint-test-and-upload.yml index cc2bb2ba..03f908e7 100644 --- a/.github/workflows/build-lint-test-and-upload.yml +++ b/.github/workflows/build-lint-test-and-upload.yml @@ -77,12 +77,6 @@ jobs: sleep 5 # Ensure azurite has fully finished creating the endpoint. az storage container create -n modelardb --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;' - # Setup Protobuf Compiler. - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - # Update Rust. - name: Rustup Update run: rustup update @@ -150,12 +144,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # Setup Protobuf Compiler. - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - # Update Rust. - name: Rustup Update run: rustup update diff --git a/Dockerfile b/Dockerfile index 2ff8b5d8..50bbf084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,6 @@ WORKDIR /usr/src/app COPY . . -RUN apt-get update && apt-get install -y protobuf-compiler - RUN cargo build --profile $BUILD_PROFILE CMD ["target/release/modelardbd", "edge", "data"] diff --git a/crates/modelardb_embedded/bindings/python/setup.py b/crates/modelardb_embedded/bindings/python/setup.py index d610c78c..2bf456e8 100644 --- a/crates/modelardb_embedded/bindings/python/setup.py +++ b/crates/modelardb_embedded/bindings/python/setup.py @@ -135,7 +135,7 @@ def build_extension(self, ext): :param ext: Information about the extension setuptools expects. """ - dependencies = ["cargo", "rustc", "protoc"] + dependencies = ["cargo", "rustc"] for dependency in dependencies: if not shutil.which(dependency): raise FileNotFoundError( From 7587b3ff87125caa5adad71b6ca08281fb0e7469 Mon Sep 17 00:00:00 2001 From: CGodiksen <36046286+CGodiksen@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:12:09 +0200 Subject: [PATCH 4/5] Remove step to install protoc from readme --- docs/user/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/user/README.md b/docs/user/README.md index 7cdbb635..ab7821ec 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -30,16 +30,15 @@ The following commands are for Ubuntu Server. However, equivalent commands shoul ### All 2. Install the latest stable [Rust Toolchain](https://rustup.rs/). -3. Install the [Protocol Buffer Compiler](https://protobuf.dev/installation/). -4. Clone the repository: `git clone https://github.com/ModelarData/ModelarDB-RS` -5. Build, test, and run the system using Cargo: +3. Clone the repository: `git clone https://github.com/ModelarData/ModelarDB-RS` +4. Build, test, and run the system using Cargo: - Debug Build: `cargo build` - Release Build: `cargo build --release` - Run Tests: `cargo test` - Run DBMS Server: `cargo run --bin modelardbd edge path_to_local_data_folder` - Run Client: `cargo run --bin modelardb [options] [query_file]` -6. Move `modelardbd`, `modelardb`, and `modelardbb` from the `target` directory to any directory. -7. Install and test the Python bindings for `modelardb_embedded` using Python: +5. Move `modelardbd`, `modelardb`, and `modelardbb` from the `target` directory to any directory. +6. Install and test the Python bindings for `modelardb_embedded` using Python: - Install: `python3 -m pip install .` - Run Tests: `python3 -m unittest` From 77ddfca6e144c69284a2a1fa5873ce18247756cc Mon Sep 17 00:00:00 2001 From: CGodiksen <36046286+CGodiksen@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:16:39 +0200 Subject: [PATCH 5/5] Fix order of dependencies --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 562f8232..52524dfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,9 +35,9 @@ futures = "0.3.32" log = "0.4.29" object_store = "0.13.2" proptest = "1.11.0" -protox = "0.9.1" prost = "0.14.3" prost-build = "0.14.3" +protox = "0.9.1" rand = "0.10.1" rustyline = "18.0.0" serde = { version = "1.0.228", features = ["derive"] }