Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo: enable ‘-D warnings’ by default #6254

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- label: "cargo test integration-tests*"
command: |
source ~/.cargo/env && set -eux
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --locked -p 'integration-tests'
RUST_BACKTRACE=1 cargo test --locked -p 'integration-tests'

timeout: 60
agents:
Expand All @@ -12,7 +12,7 @@ steps:
- label: "cargo test not integration-tests*"
command: |
source ~/.cargo/env && set -eux
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --locked --workspace -p '*' --exclude 'integration-tests*'
RUST_BACKTRACE=1 cargo test --locked --workspace -p '*' --exclude 'integration-tests*'

timeout: 60
agents:
Expand All @@ -22,7 +22,7 @@ steps:
- label: "cargo test nightly integration-tests*"
command: |
source ~/.cargo/env && set -eux
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --features nightly_protocol,nightly_protocol_features,test_features -p 'integration-tests'
RUST_BACKTRACE=1 cargo test --features nightly_protocol,nightly_protocol_features,test_features -p 'integration-tests'

timeout: 60
agents:
Expand All @@ -32,7 +32,7 @@ steps:
- label: "cargo test nightly not integration-tests*"
command: |
source ~/.cargo/env && set -eux
RUST_BACKTRACE=1 RUSTFLAGS='-D warnings' cargo test --workspace --features nightly_protocol,nightly_protocol_features,test_features,rosetta_rpc -p '*' --exclude 'integration-tests*'
RUST_BACKTRACE=1 cargo test --workspace --features nightly_protocol,nightly_protocol_features,test_features,rosetta_rpc -p '*' --exclude 'integration-tests*'

timeout: 60
agents:
Expand All @@ -43,15 +43,15 @@ steps:
command: |
source ~/.cargo/env && set -eux
rustc --version && cargo --version
RUSTFLAGS='-D warnings' cargo run -p themis --release
cargo run -p themis --release
if [ -e deny.toml ]; then
cargo-deny --all-features check bans
fi
RUSTFLAGS='-D warnings' cargo check --workspace --all-targets --all-features
RUSTFLAGS='-D warnings' cargo check -p neard --features test_features
RUSTFLAGS='-D warnings' cargo check -p neard --features sandbox
cargo check --workspace --all-targets --all-features
cargo check -p neard --features test_features
cargo check -p neard --features sandbox

RUSTFLAGS='-D warnings' cargo build -p neard --bin neard --features nightly_protocol,nightly_protocol_features
cargo build -p neard --bin neard --features nightly_protocol,nightly_protocol_features
cd pytest
python3 -m pip install --user -r requirements.txt
python3 tests/sanity/spin_up_cluster.py
Expand All @@ -60,7 +60,7 @@ steps:
# because spinning up non-nightly clusters is already covered
# by other steps in the CI, e.g. upgradable.

RUSTFLAGS='-D warnings' cargo build -p neard --bin neard
cargo build -p neard --bin neard
python3 scripts/state/update_res.py check

python3 scripts/check_nightly.py
Expand All @@ -70,7 +70,7 @@ steps:
./scripts/formatting --check

rm target/rpc_errors_schema.json
RUSTFLAGS='-D warnings' cargo check -p near-jsonrpc --features dump_errors_schema
cargo check -p near-jsonrpc --features dump_errors_schema
if ! git --no-pager diff --no-index chain/jsonrpc/res/rpc_errors_schema.json target/rpc_errors_schema.json; then
set +x
echo 'The RPC errors schema reflects outdated typing structure; please run'
Expand Down Expand Up @@ -134,7 +134,7 @@ steps:
cd runtime/runtime-params-estimator/test-contract
./build.sh
cd ..
RUSTFLAGS='-D warnings' cargo run --release --package runtime-params-estimator --bin runtime-params-estimator -- --accounts-num 20000 --additional-accounts-num 200000 --iters 1 --warmup-iters 1 --metric time
cargo run --release --package runtime-params-estimator --bin runtime-params-estimator -- --accounts-num 20000 --additional-accounts-num 200000 --iters 1 --warmup-iters 1 --metric time

branches: "!master !beta !stable"
timeout: 60
Expand Down
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ['-D', 'warnings']
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1
export CARGO_PROFILE_RELEASE_LTO = fat
export DOCKER_BUILDKIT = 1
export RUSTFLAGS = -D warnings
export NEAR_RELEASE_BUILD = no
export CARGO_TARGET_DIR = target

Expand Down