Skip to content

Commit 2e950b5

Browse files
authored
chore: Remove dependency on protoc, use the protox crate instead (#1034)
1 parent 2497086 commit 2e950b5

File tree

17 files changed

+144
-94
lines changed

17 files changed

+144
-94
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ jobs:
4949
steps:
5050
- name: Checkout
5151
uses: actions/checkout@v4
52-
- name: Install Protoc
53-
uses: arduino/setup-protoc@v3
54-
with:
55-
repo-token: ${{ secrets.GITHUB_TOKEN }}
5652
# - name: Setup Node
5753
# uses: actions/setup-node@v3
5854
# with:

.github/workflows/docs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ jobs:
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@v4
44-
- name: Install Protoc
45-
uses: arduino/setup-protoc@v3
46-
with:
47-
repo-token: ${{ secrets.GITHUB_TOKEN }}
4844
- name: Setup Rust toolchain
4945
uses: actions-rust-lang/setup-rust-toolchain@v1
5046
with:

.github/workflows/mbt.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ jobs:
4040
steps:
4141
- name: Checkout
4242
uses: actions/checkout@v4
43-
- name: Install Protoc
44-
uses: arduino/setup-protoc@v3
45-
with:
46-
repo-token: ${{ secrets.GITHUB_TOKEN }}
4743
- name: Setup Node
4844
uses: actions/setup-node@v3
4945
with:

.github/workflows/publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16-
- name: Install Protoc
17-
uses: arduino/setup-protoc@v3
18-
with:
19-
repo-token: ${{ secrets.GITHUB_TOKEN }}
2016
- name: Install Rust toolchain
2117
uses: actions-rust-lang/setup-rust-toolchain@v1
2218
with:

.github/workflows/rust.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ jobs:
4343
steps:
4444
- name: Checkout
4545
uses: actions/checkout@v4
46-
- name: Install Protoc
47-
uses: arduino/setup-protoc@v3
48-
with:
49-
repo-token: ${{ secrets.GITHUB_TOKEN }}
5046
- name: Setup Node
5147
uses: actions/setup-node@v3
5248
with:
@@ -82,10 +78,6 @@ jobs:
8278
steps:
8379
- name: Checkout
8480
uses: actions/checkout@v4
85-
- name: Install Protoc
86-
uses: arduino/setup-protoc@v3
87-
with:
88-
repo-token: ${{ secrets.GITHUB_TOKEN }}
8981
- name: Setup Node
9082
uses: actions/setup-node@v3
9183
with:
@@ -131,10 +123,6 @@ jobs:
131123
steps:
132124
- name: Checkout
133125
uses: actions/checkout@v4
134-
- name: Install Protoc
135-
uses: arduino/setup-protoc@v3
136-
with:
137-
repo-token: ${{ secrets.GITHUB_TOKEN }}
138126
- name: Setup Rust toolchain
139127
uses: actions-rust-lang/setup-rust-toolchain@v1
140128
with:
@@ -151,10 +139,6 @@ jobs:
151139
steps:
152140
- name: Checkout
153141
uses: actions/checkout@v4
154-
- name: Install Protoc
155-
uses: arduino/setup-protoc@v3
156-
with:
157-
repo-token: ${{ secrets.GITHUB_TOKEN }}
158142
- name: Setup Rust toolchain
159143
uses: actions-rust-lang/setup-rust-toolchain@v1
160144
with:
@@ -198,10 +182,6 @@ jobs:
198182
with:
199183
toolchain: stable
200184
cache-workspaces: "code"
201-
- name: Install Protoc
202-
uses: arduino/setup-protoc@v3
203-
with:
204-
repo-token: ${{ secrets.GITHUB_TOKEN }}
205185
- name: Install cargo-msrv
206186
uses: taiki-e/install-action@v2
207187
with:
@@ -223,10 +203,6 @@ jobs:
223203
with:
224204
toolchain: stable
225205
cache-workspaces: "code"
226-
- name: Install Protoc
227-
uses: arduino/setup-protoc@v3
228-
with:
229-
repo-token: ${{ secrets.GITHUB_TOKEN }}
230206
- name: Install cargo-hack
231207
uses: taiki-e/install-action@v2
232208
with:

.github/workflows/semver.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ jobs:
4141
steps:
4242
- name: Checkout
4343
uses: actions/checkout@v4
44-
- name: Install Protoc
45-
uses: arduino/setup-protoc@v3
46-
with:
47-
repo-token: ${{ secrets.GITHUB_TOKEN }}
4844
- uses: actions-rust-lang/setup-rust-toolchain@v1
4945
with:
5046
toolchain: stable

CONTRIBUTING_CODE.md

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ This document provides guidelines and instructions to help you set up your devel
2525
To build and test Malachite, you need the following tools:
2626

2727
- **Rust**: Install the latest stable Rust toolchain using [rustup](https://rustup.rs/)
28-
- **Protocol Buffers Compiler (protoc)**: Required for Protobuf message serialization
2928
- **Node.js**: Required for running [Quint](https://quint-lang.org)
3029
- **Quint**: A formal specification language used for our model-based tests
3130
- **cargo-nextest**: An improved test runner for Rust
@@ -40,25 +39,7 @@ To build and test Malachite, you need the following tools:
4039
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
4140
```
4241

43-
2. **Install the Protocol Buffers Compiler**:
44-
45-
`protoc` is needed for compiling Protobuf definitions used in the test applications to Rust code.
46-
47-
For Ubuntu/Debian:
48-
49-
```bash
50-
sudo apt-get install protobuf-compiler
51-
```
52-
53-
For macOS:
54-
55-
```bash
56-
brew install protobuf
57-
```
58-
59-
Please ensure that the version of `protoc` is at least v29.0.
60-
61-
3. **Install Node.js**: (only required for running model-based tests)
42+
2. **Install Node.js**: (only required for running model-based tests)
6243

6344
Follow the instructions at [nodejs.org](https://nodejs.org/) or use a version manager:
6445

@@ -69,19 +50,19 @@ To build and test Malachite, you need the following tools:
6950
nvm use 21
7051
```
7152

72-
4. **Install Quint**: (only required for running model-based tests)
53+
3. **Install Quint**: (only required for running model-based tests)
7354

7455
```bash
7556
npm install -g @informalsystems/quint
7657
```
7758

78-
5. **Install cargo-nextest**:
59+
4. **Install cargo-nextest**:
7960

8061
```bash
8162
cargo install cargo-nextest
8263
```
8364

84-
6. **Fork and clone the repository**:
65+
5. **Fork and clone the repository**:
8566

8667
```bash
8768
git clone https://github.com/USERNAME/malachite.git

code/Cargo.lock

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ prometheus-client = "0.22"
147147
prost = "0.13"
148148
prost-build = "0.13"
149149
prost-types = "0.13"
150+
protox = "0.8.0"
150151
ractor = { version = "0.14.6", default-features = false, features = ["async-trait", "tokio_runtime"] }
151152
rand = { version = "0.8.5", features = ["std_rng", "small_rng"] }
152153
rand_chacha = "0.3.1"

code/crates/starknet/p2p-proto/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ prost.workspace = true
1212

1313
[build-dependencies]
1414
prost-build.workspace = true
15+
protox.workspace = true
1516

1617
[lints]
1718
workspace = true

code/crates/starknet/p2p-proto/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1111
println!("cargo:rerun-if-changed={proto}");
1212
}
1313

14+
let fds = protox::compile(protos, ["./proto"])?;
15+
1416
let mut config = prost_build::Config::new();
1517
config.bytes(["."]);
1618
config.enable_type_names();
1719
config.default_package_filename("p2p");
18-
config.compile_protos(protos, &["./proto"])?;
20+
config.compile_fds(fds)?;
1921

2022
Ok(())
2123
}

code/crates/test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ tracing.workspace = true
4949

5050
[build-dependencies]
5151
prost-build = { workspace = true }
52+
protox = { workspace = true }
5253

5354
[lints]
5455
workspace = true

0 commit comments

Comments
 (0)