Skip to content

Commit 6c24d48

Browse files
kpcyrdjsha
authored andcommitted
Add --locked in CI and Makefile
1 parent 4e9e189 commit 6c24d48

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.github/workflows/test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
uses: dtolnay/rust-toolchain@nightly
153153

154154
- name: cargo test (debug; all features; -Z minimal-versions)
155-
run: cargo -Z minimal-versions test --all-features
155+
run: cargo -Z minimal-versions test --all-features --locked
156156

157157
format:
158158
name: Format
@@ -190,7 +190,7 @@ jobs:
190190
# (below) will have a new lint that we want to suppress.
191191
# If we suppress (e.g. #![allow(clippy::arc_with_non_send_sync)]),
192192
# we would get an unknown-lint error from older clippy versions.
193-
run: cargo clippy --workspace -- -D warnings -A unknown-lints
193+
run: cargo clippy --locked --workspace -- -D warnings -A unknown-lints
194194

195195
clippy-nightly-optional:
196196
name: Clippy nightly (optional)
@@ -205,7 +205,7 @@ jobs:
205205
with:
206206
components: clippy
207207
- name: Check clippy
208-
run: cargo clippy --workspace -- -D warnings
208+
run: cargo clippy --locked --workspace -- -D warnings
209209

210210
clang-tidy:
211211
name: Clang Tidy

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ExternalProject_Add(
1111
DOWNLOAD_COMMAND ""
1212
CONFIGURE_COMMAND ""
1313
BUILD_COMMAND cbindgen --lang C --output "${CMAKE_SOURCE_DIR}/src/rustls.h" "${CMAKE_SOURCE_DIR}"
14-
COMMAND cargo build "$<IF:$<CONFIG:Release>,--release,-->"
14+
COMMAND cargo build --locked "$<IF:$<CONFIG:Release>,--release,-->"
1515
# Rely on cargo checking timestamps, rather than tell CMake where every
1616
# output is.
1717
BUILD_ALWAYS true
@@ -20,5 +20,5 @@ ExternalProject_Add(
2020
# of "error" in stdout as an error, and we have some test functions that
2121
# end in "_error". Quiet mode suppresses test names, so this is a
2222
# sufficient workaround.
23-
TEST_COMMAND cargo test "$<IF:$<CONFIG:Release>,--release,-->" --quiet
23+
TEST_COMMAND cargo test --locked "$<IF:$<CONFIG:Release>,--release,-->" --quiet
2424
)

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ else
55
endif
66

77
CARGO ?= cargo
8+
CARGOFLAGS += --locked
89

910
CFLAGS := -Werror -Wall -Wextra -Wpedantic -g -I src/
1011
PROFILE := release
@@ -32,7 +33,7 @@ test: all test-rust
3233
./tests/client-server.py ./target/client ./target/server
3334

3435
test-rust:
35-
${CARGO} test
36+
${CARGO} test --locked
3637

3738
target:
3839
mkdir -p $@

Makefile.Windows

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ test: all
3838
$(call green_msg, getting 'https://httpbin.org/headers' ...)
3939
target/client.exe httpbin.org 443 /headers
4040
$(call green_msg, Running 'cargo test')
41-
cargo test
41+
cargo test --locked
4242

4343
$(RUSTLS_LIB): src/lib.rs Cargo.toml
4444
$(call green_msg, Building '$@')
45-
RUSTFLAGS="--print native-static-libs" cargo build --release
45+
RUSTFLAGS="--print native-static-libs" cargo build --release --locked
4646
@echo
4747

4848
%.obj: tests/%.c

0 commit comments

Comments
 (0)