chore(build): unify rustflags for all targets#6113
Conversation
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Codecov Report
@@ Coverage Diff @@
## main #6113 +/- ##
==========================================
+ Coverage 74.70% 74.82% +0.11%
==========================================
Files 933 931 -2
Lines 149025 148964 -61
==========================================
+ Hits 111330 111458 +128
+ Misses 37695 37506 -189
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ci/scripts/pre-unit-test.sh
Outdated
| source ci/scripts/common.env.sh | ||
|
|
||
| echo "--- Run clippy check" | ||
| cargo clippy --locked -- -D warnings |
There was a problem hiding this comment.
Also add it to risedev? Otherwise it might be confusing if risedev c passed but ci failed
There was a problem hiding this comment.
Could I ask what is the purpose of adding this? Is it to test without sync_point? Or make the check run faster?
There was a problem hiding this comment.
Also add it to risedev?
This will make the checking slower and I'm not sure whether it is worth it. 🥵
Could I ask what is the purpose of adding this?
For example, there're two unused imports in hummock/mod.rs shown as warnings when we build with risedev d, but cannot be checked with --all-targets --all-features.
There was a problem hiding this comment.
This will make the checking slower and I'm not sure whether it is worth it. 🥵
Then I prefer not include it even in CI. Just manually fix it from time to time, or simply don't fix it 🥵
| [profile.release] | ||
| debug = true | ||
| rustflags = ["-Ctarget-cpu=native"] #5367 | ||
|
|
There was a problem hiding this comment.
So, according to the priority list in the PR description, am I right to say that this is considered build.rustflags and hence has lower priority than target.rustflags?
There was a problem hiding this comment.
This is a new feature named "profile rustflags" which is not mentioned in the doc. It's joined with 3).
Running `rustc --crate-name regex_syntax --edition=2018 /home/bugenzhao/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.27/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -Ctarget-cpu=native -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="unicode"' --cfg 'feature="unicode-age"' --cfg 'feature="unicode-bool"' --cfg 'feature="unicode-case"' --cfg 'feature="unicode-gencat"' --cfg 'feature="unicode-perl"' --cfg 'feature="unicode-script"' --cfg 'feature="unicode-segment"' -C metadata=9940732c2dd3c8e5 -C extra-filename=-9940732c2dd3c8e5 --out-dir /home/bugenzhao/work/risingwave/target/release/deps -L dependency=/home/bugenzhao/work/risingwave/target/release/deps --cap-lints allow -Ctarget-feature=+avx2 --cfg tokio_unstable -Funused_must_use '-Wclippy::dbg_macro' '-Wclippy::disallowed_methods' '-Wclippy::disallowed_types' '-Wclippy::doc_markdown' '-Wclippy::explicit_into_iter_loop' '-Wclippy::explicit_iter_loop' '-Wclippy::inconsistent_struct_constructor' '-Wclippy::unused_async' '-Wclippy::map_flatten' '-Wclippy::no_effect_underscore_binding' '-Wclippy::await_holding_lock' '-Wrustdoc::broken_intra_doc_links' -Wfuture_incompatible -Wnonstandard_style -Wrust_2018_idioms -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--no-rosegment`
There was a problem hiding this comment.
Oh I see. In this case target-cpu native may not be desirable. As it would mean we may not have cross-target compatible binary, which we would want in a release binary.
We probably only want this flag if the target does not correspond to aarch or x86. We may want to ignore these corner cases (powerpc??).
So maybe we do not need this flag... although I'm not sure if target triple target.x86_64-unknown-linux-gnu also includes x86 on mac and windows?
There was a problem hiding this comment.
Okay. Let's remove this flag. I believe we only care about the performance under Linux with x86-64 and aarch64 for now. Let's tweak it in the future, if necessary.
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
After rust-lang/cargo#11114, we're able to unify rustflags for all targets.
This PR also adds the step of
clippycheck without test targets in CI.Checklist
./risedev check(or alias,./risedev c)Refer to a related PR or issue link (optional)