Skip to content

Commit 057c4ae

Browse files
committed
Auto merge of rust-lang#13124 - xFrednet:00000-lintcheck-crates, r=Alexendoo
Lintcheck: Update crates and expand CI testset to 200 crates This PR adds a new `ci_crates.toml` to lintcheck for our CI. The 200 crates take about 14 minutes, which is slightly more than the 10 I aimed for but still reasonable. The testset is constructed from: * 5 crates that compile to binaries * 4 crates that have been mentioned in ICE issues * 1 crates "random" crates from `lintcheck_crates.toml` * 190 crates from the top 200 crates from crates.io During testing, I noticed a few panics in lintcheck. I've fixed them where possible, or at least improved the error message. The new test set generates 500+ MB of json lints, which are compressed to a ~24mb artifact. --- This PR also updates our `lintcheck_crates.toml`. I mainly updated the versions, removed some very outdated crates, and added some new ones. I targeted 25 crates as those are pretty fast to lint and a good precursor for our CI. --- Optional TODO: * It's likely that some crates are compiled several times. We could potentially safe some time, by using `--recursive` in our CI. This is something I want to investigate, but it shouldn't be a blocker for this PR. --- r? `@Alexendoo` changelog: none
2 parents ac2ba15 + 8940bc3 commit 057c4ae

File tree

6 files changed

+320
-48
lines changed

6 files changed

+320
-48
lines changed

.github/workflows/lintcheck.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ jobs:
5353
id: cache-json
5454
uses: actions/cache@v4
5555
with:
56-
path: lintcheck-logs/lintcheck_crates_logs.json
56+
path: lintcheck-logs/ci_crates_logs.json
5757
key: ${{ steps.key.outputs.key }}
5858

5959
- name: Run lintcheck
6060
if: steps.cache-json.outputs.cache-hit != 'true'
61-
run: ./target/debug/lintcheck --format json --warn-all
61+
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml
6262

6363
- name: Upload base JSON
6464
uses: actions/upload-artifact@v4
6565
with:
6666
name: base
67-
path: lintcheck-logs/lintcheck_crates_logs.json
67+
path: lintcheck-logs/ci_crates_logs.json
6868

6969
# Runs lintcheck on the PR and stores the results as an artifact
7070
head:
@@ -86,13 +86,13 @@ jobs:
8686
run: cargo build --manifest-path=lintcheck/Cargo.toml
8787

8888
- name: Run lintcheck
89-
run: ./target/debug/lintcheck --format json --warn-all
89+
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml
9090

9191
- name: Upload head JSON
9292
uses: actions/upload-artifact@v4
9393
with:
9494
name: head
95-
path: lintcheck-logs/lintcheck_crates_logs.json
95+
path: lintcheck-logs/ci_crates_logs.json
9696

9797
# Retrieves the head and base JSON results and prints the diff to the GH actions step summary
9898
diff:
@@ -115,4 +115,4 @@ jobs:
115115
uses: actions/download-artifact@v4
116116

117117
- name: Diff results
118-
run: ./target/debug/lintcheck diff {base,head}/lintcheck_crates_logs.json >> $GITHUB_STEP_SUMMARY
118+
run: ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> $GITHUB_STEP_SUMMARY

lintcheck/ci_crates.toml

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
[crates]
2+
# Binaries projects
3+
cargo = {name = "cargo", version = '0.64.0', online_link = 'https://docs.rs/cargo/{version}/src/{file}.html#{line}'}
4+
ripgrep = {name = "ripgrep", version = '14.1.0'}
5+
bat = {name = "bat", version = '0.24.0'}
6+
fend = {name = "fend", version = '1.5.0'}
7+
mdbook = {name = "mdbook", version = '0.4.40'}
8+
9+
# Bigger crates from ICE issues:
10+
wasmi = {name = "wasmi", version = '0.35.0'}
11+
wgpu = {name = "wgpu", version = '0.20.1'}
12+
bytes = {name = "bytes", version = '1.6.1'}
13+
skrifa = {name = "skrifa", version = '0.19.3'}
14+
15+
# Random crates which are part of the default test set
16+
puffin = {name = "puffin", version = '0.19.0'}
17+
18+
# Top ~200 crates from crates.io
19+
syn = { name = 'syn', version = '2.0.71' }
20+
bitflags = { name = 'bitflags', version = '2.6.0' }
21+
hashbrown = { name = 'hashbrown', version = '0.14.5' }
22+
base64 = { name = 'base64', version = '0.22.1' }
23+
regex-syntax = { name = 'regex-syntax', version = '0.8.4' }
24+
proc-macro2 = { name = 'proc-macro2', version = '1.0.86' }
25+
indexmap = { name = 'indexmap', version = '2.2.6' }
26+
quote = { name = 'quote', version = '1.0.36' }
27+
regex-automata = { name = 'regex-automata', version = '0.4.7' }
28+
libc = { name = 'libc', version = '0.2.155' }
29+
serde = { name = 'serde', version = '1.0.204' }
30+
itertools = { name = 'itertools', version = '0.13.0' }
31+
heck = { name = 'heck', version = '0.5.0' }
32+
memchr = { name = 'memchr', version = '2.7.4' }
33+
serde_derive = { name = 'serde_derive', version = '1.0.204' }
34+
unicode-ident = { name = 'unicode-ident', version = '1.0.12' }
35+
autocfg = { name = 'autocfg', version = '1.3.0' }
36+
cfg-if = { name = 'cfg-if', version = '1.0.0' }
37+
aho-corasick = { name = 'aho-corasick', version = '1.1.3' }
38+
getrandom = { name = 'getrandom', version = '0.2.15' }
39+
rand_core = { name = 'rand_core', version = '0.6.4' }
40+
serde_json = { name = 'serde_json', version = '1.0.120' }
41+
itoa = { name = 'itoa', version = '1.0.11' }
42+
rand = { name = 'rand', version = '0.8.5' }
43+
ryu = { name = 'ryu', version = '1.0.18' }
44+
once_cell = { name = 'once_cell', version = '1.19.0' }
45+
rustix = { name = 'rustix', version = '0.38.34' }
46+
regex = { name = 'regex', version = '1.10.5' }
47+
log = { name = 'log', version = '0.4.22' }
48+
parking_lot_core = { name = 'parking_lot_core', version = '0.9.10' }
49+
cc = { name = 'cc', version = '1.1.5' }
50+
strsim = { name = 'strsim', version = '0.11.1' }
51+
clap = { name = 'clap', version = '4.5.9' }
52+
parking_lot = { name = 'parking_lot', version = '0.12.3' }
53+
smallvec = { name = 'smallvec', version = '2.0.0-alpha.6' }
54+
thiserror-impl = { name = 'thiserror-impl', version = '1.0.63' }
55+
thiserror = { name = 'thiserror', version = '1.0.63' }
56+
linux-raw-sys = { name = 'linux-raw-sys', version = '0.6.4' }
57+
socket2 = { name = 'socket2', version = '0.5.7' }
58+
idna = { name = 'idna', version = '1.0.2' }
59+
fastrand = { name = 'fastrand', version = '2.1.0' }
60+
either = { name = 'either', version = '1.13.0' }
61+
num-traits = { name = 'num-traits', version = '0.2.19' }
62+
rand_chacha = { name = 'rand_chacha', version = '0.3.1' }
63+
lazy_static = { name = 'lazy_static', version = '1.5.0' }
64+
semver = { name = 'semver', version = '1.0.23' }
65+
lock_api = { name = 'lock_api', version = '0.4.12' }
66+
scopeguard = { name = 'scopeguard', version = '1.2.0' }
67+
ahash = { name = 'ahash', version = '0.8.11' }
68+
anyhow = { name = 'anyhow', version = '1.0.86' }
69+
rustls = { name = 'rustls', version = '0.23.11' }
70+
http = { name = 'http', version = '1.1.0' }
71+
toml_edit = { name = 'toml_edit', version = '0.22.16' }
72+
pin-project-lite = { name = 'pin-project-lite', version = '0.2.14' }
73+
spin = { name = 'spin', version = '0.9.8' }
74+
miniz_oxide = { name = 'miniz_oxide', version = '0.7.4' }
75+
memoffset = { name = 'memoffset', version = '0.9.1' }
76+
digest = { name = 'digest', version = '0.11.0-pre.8' }
77+
version_check = { name = 'version_check', version = '0.9.4' }
78+
clap_lex = { name = 'clap_lex', version = '0.7.1' }
79+
crossbeam-utils = { name = 'crossbeam-utils', version = '0.8.20' }
80+
toml = { name = 'toml', version = '0.8.15' }
81+
block-buffer = { name = 'block-buffer', version = '0.10.4' }
82+
time = { name = 'time', version = '0.3.36' }
83+
hyper = { name = 'hyper', version = '1.4.1' }
84+
url = { name = 'url', version = '2.5.2' }
85+
percent-encoding = { name = 'percent-encoding', version = '2.3.1' }
86+
tokio = { name = 'tokio', version = '1.38.1' }
87+
errno = { name = 'errno', version = '0.3.9' }
88+
uuid = { name = 'uuid', version = '1.10.0' }
89+
unicode-normalization = { name = 'unicode-normalization', version = '0.1.23' }
90+
ppv-lite86 = { name = 'ppv-lite86', version = '0.2.17' }
91+
futures-core = { name = 'futures-core', version = '0.3.30' }
92+
http-body = { name = 'http-body', version = '1.0.1' }
93+
tinyvec = { name = 'tinyvec', version = '1.8.0' }
94+
futures-util = { name = 'futures-util', version = '0.3.30' }
95+
futures-task = { name = 'futures-task', version = '0.3.30' }
96+
sha2 = { name = 'sha2', version = '0.11.0-pre.3' }
97+
ring = { name = 'ring', version = '0.17.8' }
98+
slab = { name = 'slab', version = '0.4.9' }
99+
chrono = { name = 'chrono', version = '0.4.38' }
100+
futures-sink = { name = 'futures-sink', version = '0.3.30' }
101+
futures-channel = { name = 'futures-channel', version = '0.3.30' }
102+
num_cpus = { name = 'num_cpus', version = '1.16.0' }
103+
untrusted = { name = 'untrusted', version = '0.9.0' }
104+
tinyvec_macros = { name = 'tinyvec_macros', version = '0.1.1' }
105+
mio = { name = 'mio', version = '1.0.0' }
106+
byteorder = { name = 'byteorder', version = '1.5.0' }
107+
form_urlencoded = { name = 'form_urlencoded', version = '1.2.1' }
108+
unicode-bidi = { name = 'unicode-bidi', version = '0.3.15' }
109+
futures-io = { name = 'futures-io', version = '0.3.30' }
110+
tokio-util = { name = 'tokio-util', version = '0.7.11' }
111+
rustls-pemfile = { name = 'rustls-pemfile', version = '2.1.2' }
112+
generic-array = { name = 'generic-array', version = '1.1.0' }
113+
tracing = { name = 'tracing', version = '0.1.40' }
114+
equivalent = { name = 'equivalent', version = '1.0.1' }
115+
tracing-core = { name = 'tracing-core', version = '0.1.32' }
116+
pin-utils = { name = 'pin-utils', version = '0.1.0' }
117+
tempfile = { name = 'tempfile', version = '3.10.1' }
118+
h2 = { name = 'h2', version = '0.4.5' }
119+
futures = { name = 'futures', version = '0.3.30' }
120+
typenum = { name = 'typenum', version = '1.17.0' }
121+
winnow = { name = 'winnow', version = '0.6.13' }
122+
cpufeatures = { name = 'cpufeatures', version = '0.2.12' }
123+
nix = { name = 'nix', version = '0.29.0' }
124+
fnv = { name = 'fnv', version = '1.0.7' }
125+
tokio-rustls = { name = 'tokio-rustls', version = '0.26.0' }
126+
iana-time-zone = { name = 'iana-time-zone', version = '0.1.60' }
127+
rustls-webpki = { name = 'rustls-webpki', version = '0.102.5' }
128+
crc32fast = { name = 'crc32fast', version = '1.4.2' }
129+
adler = { name = 'adler', version = '1.0.2' }
130+
pkg-config = { name = 'pkg-config', version = '0.3.30' }
131+
redox_syscall = { name = 'redox_syscall', version = '0.5.3' }
132+
nom = { name = 'nom', version = '8.0.0-alpha2' }
133+
rustc_version = { name = 'rustc_version', version = '0.4.0' }
134+
futures-macro = { name = 'futures-macro', version = '0.3.30' }
135+
clap_derive = { name = 'clap_derive', version = '4.5.8' }
136+
futures-executor = { name = 'futures-executor', version = '0.3.30' }
137+
event-listener = { name = 'event-listener', version = '5.3.1' }
138+
num-integer = { name = 'num-integer', version = '0.1.46' }
139+
time-macros = { name = 'time-macros', version = '0.2.18' }
140+
flate2 = { name = 'flate2', version = '1.0.30' }
141+
tokio-macros = { name = 'tokio-macros', version = '2.3.0' }
142+
strum_macros = { name = 'strum_macros', version = '0.26.4' }
143+
tracing-attributes = { name = 'tracing-attributes', version = '0.1.27' }
144+
async-trait = { name = 'async-trait', version = '0.1.81' }
145+
crypto-common = { name = 'crypto-common', version = '0.1.6' }
146+
unicode-width = { name = 'unicode-width', version = '0.1.13' }
147+
anstyle = { name = 'anstyle', version = '1.0.7' }
148+
object = { name = 'object', version = '0.36.1' }
149+
gimli = { name = 'gimli', version = '0.31.0' }
150+
crossbeam-epoch = { name = 'crossbeam-epoch', version = '0.9.18' }
151+
thread_local = { name = 'thread_local', version = '1.1.8' }
152+
strum = { name = 'strum', version = '0.26.3' }
153+
darling_core = { name = 'darling_core', version = '0.20.10' }
154+
darling_macro = { name = 'darling_macro', version = '0.20.10' }
155+
minimal-lexical = { name = 'minimal-lexical', version = '0.2.1' }
156+
clap_builder = { name = 'clap_builder', version = '4.5.9' }
157+
time-core = { name = 'time-core', version = '0.1.2' }
158+
httparse = { name = 'httparse', version = '1.9.4' }
159+
signal-hook-registry = { name = 'signal-hook-registry', version = '1.4.2' }
160+
hex = { name = 'hex', version = '0.4.3' }
161+
crossbeam-deque = { name = 'crossbeam-deque', version = '0.8.5' }
162+
zerocopy = { name = 'zerocopy', version = '0.7.35' }
163+
rustversion = { name = 'rustversion', version = '1.0.17' }
164+
env_logger = { name = 'env_logger', version = '0.11.3' }
165+
webpki-roots = { name = 'webpki-roots', version = '0.26.3' }
166+
rustc-demangle = { name = 'rustc-demangle', version = '0.1.24' }
167+
mime = { name = 'mime', version = '0.3.17' }
168+
termcolor = { name = 'termcolor', version = '1.4.1' }
169+
subtle = { name = 'subtle', version = '2.6.1' }
170+
walkdir = { name = 'walkdir', version = '2.5.0' }
171+
hermit-abi = { name = 'hermit-abi', version = '0.4.0' }
172+
pin-project = { name = 'pin-project', version = '1.1.5' }
173+
pin-project-internal = { name = 'pin-project-internal', version = '1.1.5' }
174+
try-lock = { name = 'try-lock', version = '0.2.5' }
175+
tracing-log = { name = 'tracing-log', version = '0.2.0' }
176+
httpdate = { name = 'httpdate', version = '1.0.3' }
177+
anstream = { name = 'anstream', version = '0.6.14' }
178+
crossbeam-channel = { name = 'crossbeam-channel', version = '0.5.13' }
179+
reqwest = { name = 'reqwest', version = '0.12.5' }
180+
want = { name = 'want', version = '0.3.1' }
181+
paste = { name = 'paste', version = '1.0.15' }
182+
anstyle-parse = { name = 'anstyle-parse', version = '0.2.4' }
183+
toml_datetime = { name = 'toml_datetime', version = '0.6.6' }
184+
anstyle-query = { name = 'anstyle-query', version = '1.1.0' }
185+
addr2line = { name = 'addr2line', version = '0.24.0' }
186+
glob = { name = 'glob', version = '0.3.1' }
187+
num-bigint = { name = 'num-bigint', version = '0.4.6' }
188+
backtrace = { name = 'backtrace', version = '0.3.73' }
189+
wasi = { name = 'wasi', version = '0.13.1+wasi-0.2.0' }
190+
tower-service = { name = 'tower-service', version = '0.3.2' }
191+
sync_wrapper = { name = 'sync_wrapper', version = '1.0.1' }
192+
libloading = { name = 'libloading', version = '0.8.4' }
193+
rayon = { name = 'rayon', version = '1.10.0' }
194+
colorchoice = { name = 'colorchoice', version = '1.0.1' }
195+
encoding_rs = { name = 'encoding_rs', version = '0.8.34' }
196+
deranged = { name = 'deranged', version = '0.3.11' }
197+
zeroize = { name = 'zeroize', version = '1.8.1' }
198+
utf8parse = { name = 'utf8parse', version = '0.2.2' }
199+
tracing-subscriber = { name = 'tracing-subscriber', version = '0.3.18' }
200+
hyper-rustls = { name = 'hyper-rustls', version = '0.27.2' }
201+
hmac = { name = 'hmac', version = '0.13.0-pre.3' }
202+
rayon-core = { name = 'rayon-core', version = '1.12.1' }
203+
same-file = { name = 'same-file', version = '1.0.6' }
204+
prost = { name = 'prost', version = '0.13.1' }
205+
sharded-slab = { name = 'sharded-slab', version = '0.1.7' }
206+
textwrap = { name = 'textwrap', version = '0.16.1' }
207+
bumpalo = {name = "bumpalo", version = '3.16.0'}
208+
arrayvec = { name = 'arrayvec', version = '0.7.4' }

lintcheck/lintcheck_crates.toml

+40-34
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1+
# If you want to check a local project it's usually easier to use:
2+
# ```
3+
# cargo dev lint <path>
4+
# ```
5+
#
6+
# For testing you can also add sources to git and local repos like this:
7+
# ```
8+
# crate = {name = "crate", git_url = "https://github.com/name/repo.git", git_hash = "coo1cafe"}
9+
# crate = {name = "crate", path = "/path/to/project"}
10+
# ```
11+
112
[crates]
2-
# some of these are from cargotest
3-
cargo = {name = "cargo", version = '0.64.0', online_link = 'https://docs.rs/cargo/{version}/src/{file}.html#{line}'}
4-
iron = {name = "iron", version = '0.6.1'}
5-
ripgrep = {name = "ripgrep", version = '12.1.1'}
6-
xsv = {name = "xsv", version = '0.13.0'}
7-
# commented out because of 173K clippy::match_same_arms msgs in language_type.rs
8-
#tokei = { name = "tokei", version = '12.0.4'}
9-
rayon = {name = "rayon", version = '1.5.0'}
10-
serde = {name = "serde", version = '1.0.118'}
11-
# top 10 crates.io dls
12-
bitflags = {name = "bitflags", version = '1.2.1'}
13-
# crash = {name = "clippy_crash", path = "/tmp/clippy_crash"}
14-
libc = {name = "libc", version = '0.2.81'}
15-
log = {name = "log", version = '0.4.11'}
16-
proc-macro2 = {name = "proc-macro2", version = '1.0.24'}
17-
quote = {name = "quote", version = '1.0.7'}
18-
rand = {name = "rand", version = '0.7.3'}
19-
rand_core = {name = "rand_core", version = '0.6.0'}
20-
regex = {name = "regex", version = '1.3.2'}
21-
syn = {name = "syn", version = '1.0.54'}
22-
unicode-xid = {name = "unicode-xid", version = '0.2.1'}
23-
# some more of dtolnays crates
24-
anyhow = {name = "anyhow", version = '1.0.38'}
25-
async-trait = {name = "async-trait", version = '0.1.42'}
26-
cxx = {name = "cxx", version = '1.0.32'}
27-
ryu = {name = "ryu", version = '1.0.5'}
28-
serde_yaml = {name = "serde_yaml", version = '0.8.17'}
29-
thiserror = {name = "thiserror", version = '1.0.24'}
30-
# some embark crates, there are other interesting crates but
31-
# unfortunately adding them increases lintcheck runtime drastically
32-
cfg-expr = {name = "cfg-expr", version = '0.7.1'}
33-
puffin = {name = "puffin", git_url = "https://github.com/EmbarkStudios/puffin", git_hash = "02dd4a3"}
34-
rpmalloc = {name = "rpmalloc", version = '0.2.0'}
35-
tame-oidc = {name = "tame-oidc", version = '0.1.0'}
13+
14+
# Some binaries
15+
cargo = {name = "cargo", version = '0.80.0', online_link = 'https://docs.rs/cargo/{version}/src/{file}.html#{line}'}
16+
ripgrep = {name = "ripgrep", version = '14.1.0'}
17+
mdbook = {name = "mdbook", version = '0.4.40'}
18+
19+
# Common libraries
20+
rayon = {name = "rayon", version = '1.10.0'}
21+
serde = {name = "serde", version = '1.0.204'}
22+
bitflags = {name = "bitflags", version = '2.6.0'}
23+
log = {name = "log", version = '0.4.22'}
24+
quote = {name = "quote", version = '1.0.36'}
25+
proc-macro2 = {name = "proc-macro2", version = '1.0.86'}
26+
rand = {name = "rand", version = '0.8.5'}
27+
rand_core = {name = "rand_core", version = '0.6.4'}
28+
regex = {name = "regex", version = '1.10.5'}
29+
syn = {name = "syn", version = '2.0.71'}
30+
anyhow = {name = "anyhow", version = '1.0.86'}
31+
async-trait = { name = 'async-trait', version = '0.1.81' }
32+
cxx = {name = "cxx", version = '1.0.124'}
33+
ryu = {name = "ryu", version = '1.0.18'}
34+
thiserror = {name = "thiserror", version = '1.0.63'}
35+
serde_yaml = {name = "serde_yaml", version = '0.9.33'}
36+
puffin = {name = "puffin", version = '0.19.0'}
37+
bumpalo = {name = "bumpalo", version = '3.16.0'}
38+
wasmi = {name = "wasmi", version = '0.35.0'}
39+
base64 = { name = 'base64', version = '0.22.1' }
40+
once_cell = { name = 'once_cell', version = '1.19.0' }
41+
tokio = { name = 'tokio', version = '1.38.1' }
3642

3743
[recursive]
3844
ignore = [

lintcheck/src/input.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,25 @@ pub fn read_crates(toml_path: &Path) -> (Vec<CrateWithSource>, RecursiveOptions)
159159
}
160160

161161
impl CrateWithSource {
162+
pub fn download_and_prepare(&self) -> Crate {
163+
let krate = self.download_and_extract();
164+
165+
// Downloaded crates might contain a `rust-toolchain` file. This file
166+
// seems to be accessed when `build.rs` files are present. This access
167+
// results in build errors since lintcheck and clippy will most certainly
168+
// use a different toolchain.
169+
// Lintcheck simply removes these files and assumes that our toolchain
170+
// is more up to date.
171+
let _ = fs::remove_file(krate.path.join("rust-toolchain"));
172+
let _ = fs::remove_file(krate.path.join("rust-toolchain.toml"));
173+
174+
krate
175+
}
162176
/// Makes the sources available on the disk for clippy to check.
163177
/// Clones a git repo and checks out the specified commit or downloads a crate from crates.io or
164178
/// copies a local folder
165179
#[expect(clippy::too_many_lines)]
166-
pub fn download_and_extract(&self) -> Crate {
180+
fn download_and_extract(&self) -> Crate {
167181
#[allow(clippy::result_large_err)]
168182
fn get(path: &str) -> Result<ureq::Response, ureq::Error> {
169183
const MAX_RETRIES: u8 = 4;

0 commit comments

Comments
 (0)