Skip to content

Comments

Account for clippy-driver having extra prefix rustc#2438

Merged
sylvestre merged 1 commit intomozilla:mainfrom
bobrik:ivan/clippy
Sep 22, 2025
Merged

Account for clippy-driver having extra prefix rustc#2438
sylvestre merged 1 commit intomozilla:mainfrom
bobrik:ivan/clippy

Conversation

@bobrik
Copy link
Contributor

@bobrik bobrik commented Sep 6, 2025

I noticed that we were not caching clippy calls:

parse_arguments: CannotCache(multiple input files): ["rustc", "--crate-name", "bots_utils", "--edition=2024", ...

Turns out rustc is interpreted as one of the source inputs, so the actual input trips sccache into thinking that there are multiple inputs, which is not supported, so the caching does not happen.

In a workspace with 161 members and 1761 total crates in the dependency graph we see the following results with sccache running hot (no misses):

  • Before:
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 24s
Compile requests                    1802
Compile requests executed           1182
Cache hits                          1177
Cache hits (C/C++)                   107
Cache hits (Rust)                   1070
Cache misses                           0
Cache hits rate                   100.00 %
Cache hits rate (C/C++)           100.00 %
Cache hits rate (Rust)            100.00 %
Cache timeouts                         0
Cache read errors                      0
Forced recaches                        0
Cache write errors                     0
Cache errors                           0
Compilations                           0
Compilation failures                   5
Non-cacheable compilations             0
Non-cacheable calls                  610
Non-compilation calls                 10
Unsupported compiler calls             0
Average cache write                0.000 s
Average compiler                   0.000 s
Average cache read hit             0.000 s
Failed distributed compilations        0

Non-cacheable reasons:
multiple input files                 339
crate-type                           222
unknown source language               23
-                                     12
missing input                          8
-o                                     3
missing output_dir                     3

Cache location                  Local disk: "/home/ivan/.cache/sccache"
Use direct/preprocessor mode?   yes
Version (client)                0.9.1
Cache size                           444 MiB
Max cache size                        10 GiB
  • After:
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 11s
Compile requests                    1799
Compile requests executed           1332
Cache hits                          1327
Cache hits (C/C++)                   107
Cache hits (Rust)                   1220
Cache misses                           0
Cache hits rate                   100.00 %
Cache hits rate (C/C++)           100.00 %
Cache hits rate (Rust)            100.00 %
Cache timeouts                         0
Cache read errors                      0
Forced recaches                        0
Cache write errors                     0
Cache errors                           0
Compilations                           0
Compilation failures                   5
Non-cacheable compilations             0
Non-cacheable calls                  457
Non-compilation calls                 10
Unsupported compiler calls             0
Average cache write                0.000 s
Average compiler                   0.000 s
Average cache read hit             0.000 s
Failed distributed compilations        0

Non-cacheable reasons:
crate-type                           407
unknown source language               23
-                                     11
missing input                          9
argument parse                         4
-o                                     3

Cache location                  Local disk: "/home/ivan/.cache/sccache"
Use direct/preprocessor mode?   yes
Version (client)                0.10.0
Cache size                           444 MiB
Max cache size                        10 GiB

@bobrik bobrik mentioned this pull request Sep 6, 2025
@sylvestre
Copy link
Collaborator

Could you please add a test to make sure we don't regress? thanks

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2025

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.50%. Comparing base (303120e) to head (d506186).

Files with missing lines Patch % Lines
src/compiler/rust.rs 97.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2438      +/-   ##
==========================================
+ Coverage   71.47%   71.50%   +0.03%     
==========================================
  Files          65       65              
  Lines       36265    36302      +37     
==========================================
+ Hits        25919    25959      +40     
+ Misses      10346    10343       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bobrik
Copy link
Contributor Author

bobrik commented Sep 6, 2025

I added a basic test for this.

I noticed that we were not caching clippy calls:

```
parse_arguments: CannotCache(multiple input files): ["rustc", "--crate-name", "bots_utils", "--edition=2024", ...
```

Turns out `rustc` is interpreted as one of the source inputs, so the actual
input trips sccache into thinking that there are multiple inputs, which is
not supported, so the caching does not happen.

In a workspace with 161 members and 1761 total crates in the dependency graph
we see the following results with sccache running hot (no misses):

* Before:

```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 24s
```

```
Compile requests                    1802
Compile requests executed           1182
Cache hits                          1177
Cache hits (C/C++)                   107
Cache hits (Rust)                   1070
Cache misses                           0
Cache hits rate                   100.00 %
Cache hits rate (C/C++)           100.00 %
Cache hits rate (Rust)            100.00 %
Cache timeouts                         0
Cache read errors                      0
Forced recaches                        0
Cache write errors                     0
Cache errors                           0
Compilations                           0
Compilation failures                   5
Non-cacheable compilations             0
Non-cacheable calls                  610
Non-compilation calls                 10
Unsupported compiler calls             0
Average cache write                0.000 s
Average compiler                   0.000 s
Average cache read hit             0.000 s
Failed distributed compilations        0

Non-cacheable reasons:
multiple input files                 339
crate-type                           222
unknown source language               23
-                                     12
missing input                          8
-o                                     3
missing output_dir                     3

Cache location                  Local disk: "/home/ivan/.cache/sccache"
Use direct/preprocessor mode?   yes
Version (client)                0.9.1
Cache size                           444 MiB
Max cache size                        10 GiB
```

* After:

```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 11s
```

```
Compile requests                    1799
Compile requests executed           1332
Cache hits                          1327
Cache hits (C/C++)                   107
Cache hits (Rust)                   1220
Cache misses                           0
Cache hits rate                   100.00 %
Cache hits rate (C/C++)           100.00 %
Cache hits rate (Rust)            100.00 %
Cache timeouts                         0
Cache read errors                      0
Forced recaches                        0
Cache write errors                     0
Cache errors                           0
Compilations                           0
Compilation failures                   5
Non-cacheable compilations             0
Non-cacheable calls                  457
Non-compilation calls                 10
Unsupported compiler calls             0
Average cache write                0.000 s
Average compiler                   0.000 s
Average cache read hit             0.000 s
Failed distributed compilations        0

Non-cacheable reasons:
crate-type                           407
unknown source language               23
-                                     11
missing input                          9
argument parse                         4
-o                                     3

Cache location                  Local disk: "/home/ivan/.cache/sccache"
Use direct/preprocessor mode?   yes
Version (client)                0.10.0
Cache size                           444 MiB
Max cache size                        10 GiB
```
@sylvestre sylvestre merged commit f29632c into mozilla:main Sep 22, 2025
55 checks passed
@sylvestre
Copy link
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants