Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this work with CMake & MSVC, without Ninja? #957

Open
Zephilinox opened this issue Feb 14, 2021 · 5 comments
Open

How does this work with CMake & MSVC, without Ninja? #957

Zephilinox opened this issue Feb 14, 2021 · 5 comments

Comments

@Zephilinox
Copy link

Zephilinox commented Feb 14, 2021

I ran the following command in powershell

cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ..

it finds MSVC

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The CXX compiler identification is MSVC 19.27.29112.0
-- The C compiler identification is MSVC 19.27.29112.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe -- works

after running cmake --build . --config Release (once or more) the number of cache hits/misses is unchanged (from previous attempts at this)

p:\some_proj\build>sccache --show-stats
Compile requests                   1177
Compile requests executed           966
Cache hits                           19
Cache hits (C/C++)                   19
Cache misses                        887
Cache misses (C/C++)                887
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                 58
Cache errors                          2
Cache errors (C/C++)                  2
Non-cacheable compilations          874
Non-cacheable calls                 211
Non-compilation calls                 0
Unsupported compiler calls            0
Average cache write               0.010 s
Average cache read miss           0.006 s
Average cache read hit            0.001 s
Failed distributed compilations       0

Non-cacheable reasons:
Can't handle UnknownFlag arguments with -Xclang     211

Cache location                  Local disk: "C:\\Users\\Zeph\\AppData\\Local\\Mozilla\\sccache\\cache"
Cache size                            3 MiB
Max cache size                       10 GiB

with Ninja, it looks like sccache is being used (but still doesn't work correctly, see other issues I've opened)

@ranjithp04
Copy link

ranjithp04 commented Jan 18, 2022

@Zephilinox am facing this same problem. Did you found a solution for this ?

@bmyates
Copy link

bmyates commented Jan 20, 2022

I'm currently also having this issue. Any advice would be great.

@Zephilinox
Copy link
Author

Zephilinox commented Jan 20, 2022

sorry, I never found a solution. sccache was always flaky, even when I did end up using Ninja as described here #956 with /Z7

@congzhangzh
Copy link

congzhangzh commented Mar 10, 2024

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

No branches or pull requests

4 participants