Menu

#253 ccache not working

1.0
open
nobody
2016-05-23
2016-03-15
hanzzz
No

After installing the package mingw-w64-i686-ccache from the shell opened via mingw32_shell.bat, I tried compiling something using cmake / ninja / gcc, which results in following command (output of ninja -v):
ccache C:\msys32\mingw32\bin\cc.exe ...
It compiled well and ccache created folders 0-f, tmp and the ccache.conf in its cache folder, but no cache files were created and the output of ccache -s shows no difference at all:

cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                           0.0 kB
max cache size                       5.0 GB

Is there anything else to do to get ccache working in this scenario?

Discussion

  • Mario Emmenlauer

    I see the same behavior. I've enabled the logs, and it seems the problem has to do with the path encodings, because ccache seems unable to work with its own cache directory. See this log excerpt:

    [.487046 6080 ] Working directory: C:/protobuf-3.0.0-beta-2
    [.487046 6080 ] Source file: C:/protobuf-3.0.0-beta-2/src/google/protobuf/compiler/cpp/cpp_file.cc
    [.487046 6080 ] Object file: CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/cpp_file.cc.obj
    [.487046 6080 ] Trying direct lookup
    [.487046 6080 ] Looking for object file hash in C:\cygwin64\home\emmenlau/.ccache/7/6/8f8861cb4b8736d75be365af3192b1-37372.manifest
    [.487046 6080 ] No such manifest file
    [.487046 6080 ] Did not find object file hash in manifest
    [.487046 6080 ] Running preprocessor
    [.863446 6080 ] Failed to stat C:\cygwin64\home\emmenlau/.ccache/tmp/cpp_file.stdout.FECHIN.6080.iG2Kb7: No such file or directory
    [.863446 6080 ] Failed; falling back to running the real compiler
    [.863446 6080 ] Executing C:\msys64\mingw64\bin\g++.exe -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_PTHREAD -DHAVE_ZLIB -DLIBPROTOC_EXPORTS -Dlibprotoc_EXPORTS -isystem C:/msys64/mingw64/include -IC:/protobuf-3.0.0-beta-2 -IC:/protobuf-3.0.0-beta-2/src -IC:/protobuf-3.0.0-beta-2/gmock -IC:/protobuf-3.0.0-beta-2/gmock/gtest -IC:/protobuf-3.0.0-beta-2/gmock/gtest/include -IC:/protobuf-3.0.0-beta-2/gmock/include -O3 -DNDEBUG -o CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/cpp_file.cc.obj -c C:/protobuf-3.0.0-beta-2/src/google/protobuf/compiler/cpp/cpp_file.cc
    [.863446 6080 ] Acquired lock C:\cygwin64\home\emmenlau/.ccache/d/stats.lock
    [.863446 6080 ] can't rename file C:\cygwin64\home\emmenlau/.ccache/d/stats.tmp.FECHIN.6080.FzP5tM to C:\cygwin64\home\emmenlau/.ccache/d/stats OS returned error: ../ccache-3.2.2/util.c failed with error 2: The system cannot find the file specified.
    [.863446 6080 ] Releasing lock C:\cygwin64\home\emmenlau/.ccache/d/stats.lock
    [.863446 6080 ] Unlink C:\cygwin64\home\emmenlau/.ccache/d/stats.lock
    [.863446 6080 ] Result: ccache internal error
    
     

    Last edit: Mario Emmenlauer 2016-04-01
  • Mario Emmenlauer

    Is this a ccache issue or an MSYS2 issue? Anyone wiling to comment?

     
MongoDB Logo MongoDB