Skip to content

Commit a837ba3

Browse files
committed
chore: install rust if not present
Signed-off-by: Huamin Chen <hchen@redhat.com>
1 parent 35c8ec8 commit a837ba3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ build: rust build-router
1111

1212
# Build the Rust library
1313
rust:
14-
@echo "Building Rust library..."
15-
cd candle-binding && cargo build --release
14+
@echo "Ensuring rust is installed..."
15+
@bash -c 'if ! command -v rustc >/dev/null 2>&1; then \
16+
echo "rustc not found, installing..."; \
17+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
18+
fi && \
19+
echo "Loading Rust environment..." && \
20+
. $$HOME/.cargo/env && \
21+
echo "Building Rust library..." && \
22+
cd candle-binding && cargo build --release'
1623

1724
# Build router
1825
build-router: rust

0 commit comments

Comments
 (0)