-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run clippy for wasm, with own clippy.toml config file (#1628)
* Run clippy for wasm, with own clippy.toml config file * Use --profile default in order to install clippy * Detect errors in ci_docker/publish.sh * Make sure clippy is installed on CI * install clippy in a nicer way * Name the CI step better * Fix clippy warnings * Fix clippy warning that for some reason only happens on wasm!??!?! * Figure ouit what cargo version is being run * Update rust to 1.67.1 Small change with how the lint `clippy::uninlined_format_args` acts * Forbid clippy::uninlined_format_args * Use exactly 1.67.1 everywhere, since it matters for clippy * Forbid threads on wasm * Document clippy.toml a bit better * Cleanup * Use CLIPPY_CONF_DIR
- Loading branch information
Showing
16 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,15 @@ This is a guide to how to build Rerun. | |
* Install the Rust toolchain: <https://rustup.rs/> | ||
* `git clone [email protected]:rerun-io/rerun.git && cd rerun` | ||
* Run `./scripts/setup_dev.sh`. | ||
* Make sure `cargo --version` prints `1.67.0` once you are done | ||
* Make sure `cargo --version` prints `1.67.1` once you are done | ||
|
||
|
||
### Apple-silicon Macs | ||
|
||
If you are using an Apple-silicon Mac (M1, M2), make sure `rustc -vV` outputs `host: aarch64-apple-darwin`. If not, this should fix it: | ||
|
||
```sh | ||
rustup set default-host aarch64-apple-darwin && rustup install 1.67 | ||
rustup set default-host aarch64-apple-darwin && rustup install 1.67.1 | ||
``` | ||
|
||
## Building the docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This is used by `scripts/clippy_wasm.sh` so we can forbid some methods that are not available in wasm. | ||
# | ||
# We cannot forbid all these methods in the main `clippy.toml` because of | ||
# https://github.com/rust-lang/rust-clippy/issues/10406 | ||
|
||
msrv = "1.67" | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods | ||
disallowed-methods = [ | ||
"std::time::Instant::now", # use `instant` crate instead for wasm/web compatibility | ||
"std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatibility | ||
"std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatibility | ||
|
||
# Cannot spawn threads on wasm: | ||
"std::thread::spawn", | ||
] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types | ||
disallowed-types = [ | ||
# Cannot spawn threads on wasm: | ||
"std::thread::Builder", | ||
] | ||
|
||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown | ||
doc-valid-idents = [ | ||
# You must also update the same list in the root `clippy.toml`! | ||
"GitHub", | ||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"PyPI", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
"WebSockets", | ||
"..", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ Setup: | |
* Install the Rust toolchain: <https://rustup.rs/> | ||
* `git clone [email protected]:rerun-io/rerun.git && cd rerun` | ||
* Run `./scripts/setup_dev.sh`. | ||
* Make sure `cargo --version` prints `1.67.0` once you are done | ||
* Make sure `cargo --version` prints `1.67.1` once you are done | ||
|
||
## Building | ||
To build from source and install Rerun into your *current* Python environment run: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# This scripts run clippy on the wasm32-unknown-unknown target, | ||
# using a special clippy.toml config file which forbids a few more things. | ||
|
||
set -eu | ||
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$script_path/.." | ||
set -x | ||
|
||
# Use clippy_wasm/clippy.toml | ||
export CLIPPY_CONF_DIR="clippy_wasm" | ||
|
||
cargo cranky --all-features --target wasm32-unknown-unknown --target-dir target_wasm -p re_viewer -- --deny warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21e1a8a
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.
Rust Benchmark
datastore/insert/batch/rects/insert
562191
ns/iter (± 5921
)552400
ns/iter (± 1947
)1.02
datastore/latest_at/batch/rects/query
1847
ns/iter (± 11
)1874
ns/iter (± 6
)0.99
datastore/latest_at/missing_components/primary
286
ns/iter (± 2
)286
ns/iter (± 0
)1
datastore/latest_at/missing_components/secondaries
429
ns/iter (± 6
)437
ns/iter (± 1
)0.98
datastore/range/batch/rects/query
149548
ns/iter (± 1792
)150300
ns/iter (± 1008
)0.99
mono_points_arrow/generate_message_bundles
45990407
ns/iter (± 1489722
)46732018
ns/iter (± 880640
)0.98
mono_points_arrow/generate_messages
137495539
ns/iter (± 1563706
)127244143
ns/iter (± 1198914
)1.08
mono_points_arrow/encode_log_msg
164653203
ns/iter (± 1327437
)157276826
ns/iter (± 1213622
)1.05
mono_points_arrow/encode_total
353452942
ns/iter (± 2671652
)334440333
ns/iter (± 2582457
)1.06
mono_points_arrow/decode_log_msg
183691894
ns/iter (± 2402906
)180601091
ns/iter (± 884084
)1.02
mono_points_arrow/decode_message_bundles
72330282
ns/iter (± 1488929
)65806249
ns/iter (± 918492
)1.10
mono_points_arrow/decode_total
251881583
ns/iter (± 2667690
)242750667
ns/iter (± 1488225
)1.04
batch_points_arrow/generate_message_bundles
323779
ns/iter (± 4054
)329979
ns/iter (± 842
)0.98
batch_points_arrow/generate_messages
6298
ns/iter (± 77
)6625
ns/iter (± 18
)0.95
batch_points_arrow/encode_log_msg
356368
ns/iter (± 2883
)360175
ns/iter (± 1599
)0.99
batch_points_arrow/encode_total
699632
ns/iter (± 10860
)713009
ns/iter (± 5189
)0.98
batch_points_arrow/decode_log_msg
348230
ns/iter (± 2636
)349611
ns/iter (± 1545
)1.00
batch_points_arrow/decode_message_bundles
1996
ns/iter (± 29
)2125
ns/iter (± 12
)0.94
batch_points_arrow/decode_total
354068
ns/iter (± 2608
)355540
ns/iter (± 1291
)1.00
arrow_mono_points/insert
7027822425
ns/iter (± 16502592
)6104864157
ns/iter (± 13769441
)1.15
arrow_mono_points/query
1739671
ns/iter (± 14143
)1822825
ns/iter (± 28013
)0.95
arrow_batch_points/insert
2667029
ns/iter (± 9265
)2633287
ns/iter (± 52044
)1.01
arrow_batch_points/query
16187
ns/iter (± 65
)16200
ns/iter (± 78
)1.00
arrow_batch_vecs/insert
42456
ns/iter (± 100
)42329
ns/iter (± 109
)1.00
arrow_batch_vecs/query
389272
ns/iter (± 1095
)389601
ns/iter (± 620
)1.00
tuid/Tuid::random
34
ns/iter (± 0
)34
ns/iter (± 0
)1
This comment was automatically generated by workflow using github-action-benchmark.