Skip to content

Commit

Permalink
add rust-toolchain.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
kmrmt committed Apr 24, 2024
1 parent 2f926f4 commit 7388804
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 55 deletions.
11 changes: 2 additions & 9 deletions Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,8 @@ go/example/deps:
## install Rust package dependencies
rust/deps: \
rust/install
if [ -x "$(CARGO_HOME)/bin/cargo" ]; then \
cd $(ROOTDIR)/rust \
&& $(CARGO_HOME)/bin/rustup default stable \
&& $(CARGO_HOME)/bin/cargo update \
&& cd -;\
else \
echo "Cargo not found. Please install Cargo or add it to your PATH."; \
exit 1; \
fi
sed -i "2s/channel = \"[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\"/channel = \"$(RUST_VERSION)\"/g" $(ROOTDIR)/rust/rust-toolchain.toml
cd $(ROOTDIR)/rust && $(CARGO_HOME)/bin/cargo update && cd -

.PHONY: update/chaos-mesh
## update chaos-mesh version
Expand Down
6 changes: 1 addition & 5 deletions Makefile.d/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,4 @@ rust/install: $(CARGO_HOME)/bin/cargo

$(CARGO_HOME)/bin/cargo:
curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} sh -s -- --default-toolchain $(RUST_VERSION) -y
source "${CARGO_HOME}/env" \
CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} ${CARGO_HOME}/bin/rustup install $(RUST_VERSION) \
CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} ${CARGO_HOME}/bin/rustup toolchain install $(RUST_VERSION) \
CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} ${CARGO_HOME}/bin/rustup default $(RUST_VERSION) \
CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} ${CARGO_HOME}/bin/rustup update
source "${CARGO_HOME}/env"
60 changes: 19 additions & 41 deletions rust/Cargo.lock

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

2 changes: 2 additions & 0 deletions rust/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.77.2"

0 comments on commit 7388804

Please sign in to comment.