-
Notifications
You must be signed in to change notification settings - Fork 88
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
chore: update CI toolchain and clean up code #244
Changes from all commits
9747bcf
01e0bd9
59064ba
03a8469
02ed068
9ec5a77
7ab1af2
3faee0e
557d086
f28f309
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Makefile | ||
|
||
## Additionaly arguments passed to cargo. | ||
EXTRA_CARGO_ARGS ?= | ||
## Whether to disable nightly-only feature. [true/false] | ||
WITH_STABLE_TOOLCHAIN ?= | ||
|
||
.PHONY: format clippy test | ||
|
||
all: format clippy test | ||
|
||
## Format code in-place using rustfmt. | ||
format: | ||
cargo fmt --all | ||
|
||
## Run clippy. | ||
ifeq ($(WITH_STABLE_TOOLCHAIN), true) | ||
clippy: | ||
cargo clippy --all --features all_stable --all-targets -- -D clippy::all | ||
else | ||
clippy: | ||
cargo clippy --all --all-features --all-targets -- -D clippy::all | ||
endif | ||
|
||
## Run tests. | ||
ifeq ($(WITH_STABLE_TOOLCHAIN), true) | ||
test: | ||
cargo test --all --features all_stable_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommend to add extra There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you encounter any problem using it? I think the default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually,it's work fine in my environment, also on MacOS. |
||
cargo test --test failpoints --features all_stable ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture | ||
else | ||
test: | ||
cargo test --all --features all_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto. |
||
cargo test --test failpoints --all-features ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, don't we need
+nightly
trait any more when${WITH_STABLE_TOOLCHAIN} == false
?I've tested the makefile on Centos:
Linux version 3.10.0-862.14.4.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Wed Sep 26 15:12:11 UTC 2018
And it returns the following failure:
And if I add the
+nightly
trait, bothmake test
andmake clippy
worked as expectation without errs, by setting${WITH_STABLE_TOOLCHAIN} == false
.Also, the feature specification on
all_except_failpoints
incargo.toml
shows that we need+nightly
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to assume user has set the correct default toolchain. But force setting sounds okay too, I'll add it later.