Skip to content

Direct mode stats - #2860

Open
badumbatish wants to merge 9 commits into
mozilla:mainfrom
badumbatish:direct_mode_stats
Open

badumbatish wants to merge 9 commits into
mozilla:mainfrom
badumbatish:direct_mode_stats

Conversation

@badumbatish

Copy link
Copy Markdown
Contributor

No description provided.

@badumbatish badumbatish mentioned this pull request Sep 16, 2026
@codecov-commenter

codecov-commenter commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.14660% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.19%. Comparing base (d72ff0b) to head (713640e).

Files with missing lines Patch % Lines
src/compiler/compiler.rs 76.74% 10 Missing ⚠️
src/compiler/msvc.rs 93.44% 4 Missing ⚠️
src/server.rs 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2860      +/-   ##
==========================================
+ Coverage   78.13%   78.19%   +0.06%     
==========================================
  Files          74       74              
  Lines       43570    43727     +157     
==========================================
+ Hits        34043    34193     +150     
- Misses       9527     9534       +7     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread src/compiler/c.rs Outdated
Comment thread src/compiler/compiler.rs Outdated
Comment thread src/compiler/compiler.rs Outdated
Comment thread src/server.rs Outdated
Comment thread src/server.rs Outdated
Comment thread src/server.rs Outdated
Comment thread src/server.rs
@badumbatish
badumbatish requested a review from sylvestre October 12, 2026 17:27
@badumbatish

Copy link
Copy Markdown
Contributor Author

seems theres's some CI infrastructure error, can you help me restart them?

See the following:
```
sccache on  direct_mode_stats is 📦 v0.17.0 via 🦀 v1.97.1 via ❄️  impure (sccache-dev-env) took 2s
➜ ./target/debug/sccache --show-stats
[2026-09-10 15:58:34]
Compile requests                      3
Compile requests executed             0
Cache hits                            0
Direct cache hits                     0
Cache misses                          0
Direct cache hits                     0
Cache hits rate                       -
Direct cache hits rate                -
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Cache errors                          0
Compilations                          0
Compilation failures                  0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 3
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
Cache location                  Local disk: "/home/jjasmine/.cache/sccache"
Base directories                (none)
Use direct/preprocessor mode?   yes
Version (client)                0.17.0
Max cache size                       10 GiB
```
@badumbatish

Copy link
Copy Markdown
Contributor Author

is preprocessor mode always missing out on msvc? it seems that without the latest experiment patch to opt for -E instead of -EP on msvc when we're in preprocessor mode, the test will fail to record any direct cache hits:

get server stats: ServerInfo { stats: ServerStats { compile_requests: 2, requests_unsupported_compiler: 0, requests_not_compile: 0, requests_not_cacheable: 0, requests_executed: 2, cache_errors: PerLanguageCount { counts: {}, adv_counts: {} }, cache_hits: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, cache_misses: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_misses: PerLanguageCount { counts: {"C/C++": 2}, adv_counts: {"c [msvc]": 2} }, cache_timeouts: 0, cache_read_errors: 0, non_cacheable_compilations: 0, forced_recaches: 0, cache_write_errors: 0, cache_writes: 1, cache_write_duration: 1.6345ms, cache_read_hit_duration: 717.9µs, compilations: 1, compiler_write_duration: 44.1385ms, compile_fails: 0, not_cached: {}, dist_compiles: {}, dist_errors: 0, multi_level: None }, cache_location: "Local disk: \"C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\sccache_system_testwc6D6F\\\\client-cache\"", cache_size: Some(1543), max_cache_size: Some(10737418240), use_preprocessor_cache_mode: true, version: "0.18.0", basedirs: [] }
test_basic_compile_into_dev_null: cl.exe
get server stats: ServerInfo { stats: ServerStats { compile_requests: 1, requests_unsupported_compiler: 0, requests_not_compile: 0, requests_not_cacheable: 0, requests_executed: 1, cache_errors: PerLanguageCount { counts: {}, adv_counts: {} }, cache_hits: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, cache_misses: PerLanguageCount { counts: {}, adv_counts: {} }, direct_cache_misses: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, cache_timeouts: 0, cache_read_errors: 0, non_cacheable_compilations: 0, forced_recaches: 0, cache_write_errors: 0, cache_writes: 0, cache_write_duration: 0ns, cache_read_hit_duration: 522.7µs, compilations: 0, compiler_write_duration: 0ns, compile_fails: 0, not_cached: {}, dist_compiles: {}, dist_errors: 0, multi_level: None }, cache_location: "Local disk: \"C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\sccache_system_testwc6D6F\\\\client-cache\"", cache_size: Some(1543), max_cache_size: Some(10737418240), use_preprocessor_cache_mode: true, version: "0.18.0", basedirs: [] }
get server stats: ServerInfo { stats: ServerStats { compile_requests: 2, requests_unsupported_compiler: 0, requests_not_compile: 0, requests_not_cacheable: 0, requests_executed: 2, cache_errors: PerLanguageCount { counts: {}, adv_counts: {} }, cache_hits: PerLanguageCount { counts: {"C/C++": 2}, adv_counts: {"c [msvc]": 2} }, direct_cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, cache_misses: PerLanguageCount { counts: {}, adv_counts: {} }, direct_cache_misses: PerLanguageCount { counts: {"C/C++": 2}, adv_counts: {"c [msvc]": 2} }, cache_timeouts: 0, cache_read_errors: 0, non_cacheable_compilations: 0, forced_recaches: 0, cache_write_errors: 0, cache_writes: 0, cache_write_duration: 0ns, cache_read_hit_duration: 1.0635ms, compilations: 0, compiler_write_duration: 0ns, compile_fails: 0, not_cached: {}, dist_compiles: {}, dist_errors: 0, multi_level: None }, cache_location: "Local disk: \"C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\sccache_system_testwc6D6F\\\\client-cache\"", cache_size: Some(1543), max_cache_size: Some(10737418240), use_preprocessor_cache_mode: true, version: "0.18.0", basedirs: [] }
get server stats: ServerInfo { stats: ServerStats { compile_requests: 1, requests_unsupported_compiler: 0, requests_not_compile: 0, requests_not_cacheable: 0, requests_executed: 1, cache_errors: PerLanguageCount { counts: {}, adv_counts: {} }, cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, direct_cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, cache_misses: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_misses: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, cache_timeouts: 0, cache_read_errors: 0, non_cacheable_compilations: 0, forced_recaches: 0, cache_write_errors: 0, cache_writes: 1, cache_write_duration: 3.671ms, cache_read_hit_duration: 0ns, compilations: 1, compiler_write_duration: 44.844ms, compile_fails: 0, not_cached: {}, dist_compiles: {}, dist_errors: 0, multi_level: None }, cache_location: "Local disk: \"C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\sccache_system_testwc6D6F\\\\client-cache\"", cache_size: Some(3103), max_cache_size: Some(10737418240), use_preprocessor_cache_mode: true, version: "0.18.0", basedirs: [] }
get server stats: ServerInfo { stats: ServerStats { compile_requests: 2, requests_unsupported_compiler: 0, requests_not_compile: 0, requests_not_cacheable: 0, requests_executed: 2, cache_errors: PerLanguageCount { counts: {}, adv_counts: {} }, cache_hits: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_hits: PerLanguageCount { counts: {}, adv_counts: {} }, cache_misses: PerLanguageCount { counts: {"C/C++": 1}, adv_counts: {"c [msvc]": 1} }, direct_cache_misses: PerLanguageCount { counts: {"C/C++": 2}, adv_counts: {"c [msvc]": 2} }, cache_timeouts: 0, cache_read_errors: 0, non_cacheable_compilations: 0, forced_recaches: 0, cache_write_errors: 0, cache_writes: 1, cache_write_duration: 3.671ms, cache_read_hit_duration: 590.2µs, compilations: 1, compiler_write_duration: 44.844ms, compile_fails: 0, not_cached: {}, dist_compiles: {}, dist_errors: 0, multi_level: None }, cache_location: "Local disk: \"C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\sccache_system_testwc6D6F\\\\client-cache\"", cache_size: Some(3103), max_cache_size: Some(10737418240), use_preprocessor_cache_mode: true, version: "0.18.0", basedirs: [] }

thread 'test_sccache_command::with_preprocessor_cache' (6820) panicked at tests\system.rs:2482:66:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::panic_handler
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library\std\src\panicking.rs:698
   1: core::panicking::panic_fmt
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library\core\src\panicking.rs:75
   2: core::panicking::panic
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library\core\src\panicking.rs:145
   3: core::option::unwrap_failed
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library\core\src\option.rs:2169
   4: std::rt::lang_start::<()>
   5: std::rt::lang_start::<()>
   6: system::main
   7: std::rt::lang_start::<()>
   8: system::main
   9: <assert_cmd::assert::Assert>::stdout_impl
  10: __ImageBase
  11: __ImageBase
  12: std::rt::lang_start::<()>
  13: std::rt::lang_start::<()>
  14: std::rt::lang_start::<()>
  15: std::rt::lang_start::<()>
  16: std::rt::lang_start::<()>
  17: system::main
  18: serial_test::serial_code_lock::local_serial_core
  19: system::main
  20: std::rt::lang_start::<()>
  21: system::main
  22: core::ops::function::FnOnce::call_once
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    test_sccache_command::with_preprocessor_cache

https://github.com/mozilla/sccache/actions/runs/38300755537/job/114982834101

iiuc this originates from #208 and #893 but it seems to be inhibiting direct mode of msvc, at least on CI.

Do you prefer I come up with a different PR to enable the direct mode of msvc on CI?

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