Skip to content

Commit 47fe362

Browse files
committed
ensure rust env works for different configurations
Signed-off-by: Huamin Chen <hchen@redhat.com>
1 parent a837ba3 commit 47fe362

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
@@ -15,9 +15,16 @@ rust:
1515
@bash -c 'if ! command -v rustc >/dev/null 2>&1; then \
1616
echo "rustc not found, installing..."; \
1717
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
18+
echo "Loading Rust environment..." && \
19+
. $$HOME/.cargo/env; \
20+
fi && \
21+
if [ -f "$$HOME/.cargo/env" ]; then \
22+
echo "Loading Rust environment from $$HOME/.cargo/env..." && \
23+
. $$HOME/.cargo/env; \
24+
fi && \
25+
if ! command -v cargo >/dev/null 2>&1; then \
26+
echo "Error: cargo not found in PATH" && exit 1; \
1827
fi && \
19-
echo "Loading Rust environment..." && \
20-
. $$HOME/.cargo/env && \
2128
echo "Building Rust library..." && \
2229
cd candle-binding && cargo build --release'
2330

0 commit comments

Comments
 (0)