Skip to content

Commit 06cc4cf

Browse files
authored
Merge pull request #175 from scylladb/dk/add-update-rust-tooling-to-makefile
makefile: add step to update rust binaries
2 parents caf12d9 + 2be7d11 commit 06cc4cf

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

Makefile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ INTEGRATION_TEST_BIN := ${BUILD_DIR}/cassandra-integration-tests
6767
clean:
6868
rm -rf "${BUILD_DIR}"
6969

70-
update-repo-cache-if-needed:
70+
update-apt-cache-if-needed:
7171
@{\
7272
@sudo find /var/cache/apt -type f -mtime -1 2>/dev/null | grep -c "" 2>/dev/null | grep 0 >/dev/null 2>&1 || (\
7373
echo "Apt cache is outdated, update it.";\
7474
sudo apt-get update || true;\
7575
)\
7676
}
7777

78-
install-cargo-if-missing: update-repo-cache-if-needed
78+
install-cargo-if-missing: update-apt-cache-if-needed
7979
@cargo --version >/dev/null 2>&1 || (\
8080
echo "Cargo not found in the system, install it.";\
8181
sudo apt-get install -y cargo;\
8282
)
8383

84-
install-valgrind-if-missing: update-repo-cache-if-needed
84+
install-valgrind-if-missing: update-apt-cache-if-needed
8585
@valgrind --version >/dev/null 2>&1 || (\
8686
echo "Valgrind not found in the system, install it.";\
8787
sudo snap install valgrind --classic;\
@@ -103,10 +103,10 @@ install-java8-if-missing:
103103
sudo apt install -y openjdk-8-jre;\
104104
}
105105

106-
install-build-dependencies: update-repo-cache-if-needed
106+
install-build-dependencies: update-apt-cache-if-needed
107107
@sudo apt-get install -y libssl1.1 libuv1-dev libkrb5-dev libc6-dbg
108108

109-
install-bin-dependencies: update-repo-cache-if-needed
109+
install-bin-dependencies: update-apt-cache-if-needed
110110
@sudo apt-get install -y libssl1.1 libuv1-dev libkrb5-dev libc6-dbg
111111

112112
build-integration-test-bin:
@@ -126,29 +126,39 @@ build-integration-test-bin-if-missing:
126126
cmake -DCASS_BUILD_INTEGRATION_TESTS=ON .. && (make -j 4 || make);\
127127
}
128128

129-
check-cargo: install-cargo-if-missing
129+
_update-rust-tooling:
130+
@echo "Run rustup update"
131+
@rustup update
132+
133+
check-cargo: install-cargo-if-missing _update-rust-tooling
134+
@echo "Running \"cargo check\" in ./scylla-rust-wrapper"
130135
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo check
131136

132137
fix-cargo:
138+
@echo "Running \"cargo fix --verbose --all\" in ./scylla-rust-wrapper"
133139
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fix --verbose --all
134140

135-
check-cargo-clippy: install-cargo-if-missing
141+
check-cargo-clippy: install-cargo-if-missing _update-rust-tooling
142+
@echo "Running \"cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args\" in ./scylla-rust-wrapper"
136143
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args
137144

138-
fix-cargo-clippy: install-cargo-if-missing
145+
fix-cargo-clippy: install-cargo-if-missing _update-rust-tooling
146+
@echo "Running \"cargo clippy --verbose --all-targets --fix -- -D warnings -Aclippy::uninlined_format_args\" in ./scylla-rust-wrapper"
139147
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo clippy --verbose --all-targets --fix -- -D warnings -Aclippy::uninlined_format_args
140148

141-
check-cargo-fmt: install-cargo-if-missing
149+
check-cargo-fmt: install-cargo-if-missing _update-rust-tooling
150+
@echo "Running \"cargo fmt --verbose --all -- --check\" in ./scylla-rust-wrapper"
142151
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fmt --verbose --all -- --check
143152

144-
fix-cargo-fmt: install-cargo-if-missing
153+
fix-cargo-fmt: install-cargo-if-missing _update-rust-tooling
154+
@echo "Running \"cargo fmt --verbose --all\" in ./scylla-rust-wrapper"
145155
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fmt --verbose --all
146156

147157
check: check-cargo check-cargo-clippy check-cargo-fmt
148158

149159
fix: fix-cargo fix-cargo-clippy fix-cargo-fmt
150160

151-
prepare-integration-test: update-repo-cache-if-needed install-valgrind-if-missing
161+
prepare-integration-test: update-apt-cache-if-needed install-valgrind-if-missing install-cargo-if-missing _update-rust-tooling
152162
@sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
153163
@dpkg -l libc6-dbg >/dev/null 2>&1 || sudo apt-get install -y libc6-dbg
154164

@@ -184,5 +194,5 @@ endif
184194
@echo "Running integration tests on cassandra ${CASSANDRA_VERSION}"
185195
valgrind --error-exitcode=123 --leak-check=full --errors-for-leak-kinds=definite build/cassandra-integration-tests --version=${CASSANDRA_VERSION} --category=CASSANDRA --verbose=ccm --gtest_filter="${CASSANDRA_TEST_FILTER}"
186196

187-
run-test-unit: install-cargo-if-missing
197+
run-test-unit: install-cargo-if-missing _update-rust-tooling
188198
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo test

0 commit comments

Comments
 (0)