Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Error while writting clcache stats.txt #339

Closed

Description

@9a4gl

Almost every time I do rebuild whole solution (building from visual studio), it fails and I output I see:

9>Traceback (most recent call last): 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main 9> "__main__", mod_spec) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code 9> exec(code, run_globals) 9> File "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe\__main__.py", line 9, in <module> 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1577, in main 9> return processCompileRequest(cache, compiler, sys.argv) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1604, in processCompileRequest 9> return scheduleJobs(cache, compiler, cmdLine, environment, sourceFiles, objectFiles) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1656, in scheduleJobs 9> exitCode, out, err, doCleanup = future.result() 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\concurrent\futures\_base.py", line 425, in result 9> return self.__get_result() 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\concurrent\futures\_base.py", line 384, in __get_result 9> raise self._exception 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\concurrent\futures\thread.py", line 57, in run 9> result = self.fn(*self.args, **self.kwargs) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1677, in processSingleSource 9> return processDirect(cache, objectFile, compiler, cmdLine, sourceFile) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1707, in processDirect 9> return processCacheHit(cache, objectFile, cachekey) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 1495, in processCacheHit 9> stats.registerCacheHit() 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 753, in __exit__ 9> self._stats.save() 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 663, in save 9> json.dump(self._dict, f, sort_keys=True, indent=4) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\contextlib.py", line 119, in __exit__ 9> next(self.gen) 9> File "c:\users\tihomir\appdata\local\programs\python\python37\lib\site-packages\clcache\__main__.py", line 124, in atomicWrite 9> os.replace(tempFileName, fileName) 9>PermissionError: [WinError 5] Access is denied: 'C:\\Users\\tihomir\\clcache\\stats.txt.new' -> 'C:\\Users\\tihomir\\clcache\\stats.txt'

then
9>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(423,5): error MSB6006: "CL.exe" exited with code 1.

and at the end:
9>Done building project "myproject.vcxproj" -- FAILED.

Is there a workaround for this ?

Using clcache 4.2.0 installed using pip

BR,
Tihomir

Activity

  1. izmmisha commented on Jan 7, 2019

    @izmmisha

    Try to move clcache dir out of user profile dir (C:\Users\tihomir\clcache -> C:\clcache for example). You can use CLCACHE_DIR environment variable.

  2. 9a4gl commented on Jan 7, 2019

    @9a4gl
    Author

    Hm, actually I have moved to D:\clcache and I haven't saw this problem anymore. Thanks

  3. apriori commented on May 8, 2019

    @apriori

    I still have this problem with clache being used by gitlab runners.
    Each runner has its own copy of a clcache dir, but the build process uses cmake with ninja in a multithreaded way.

    Traceback (most recent call last):
      File "clcache_main.py", line 2, in <module>
      File "clcache\__main__.py", line 1577, in main
      File "clcache\__main__.py", line 1604, in processCompileRequest
      File "clcache\__main__.py", line 1656, in scheduleJobs
      File "concurrent\futures\_base.py", line 398, in result
      File "concurrent\futures\_base.py", line 357, in __get_result
      File "concurrent\futures\thread.py", line 55, in run
      File "clcache\__main__.py", line 1677, in processSingleSource
      File "clcache\__main__.py", line 1707, in processDirect
      File "clcache\__main__.py", line 1495, in processCacheHit
      File "clcache\__main__.py", line 753, in __exit__
      File "clcache\__main__.py", line 663, in save
      File "contextlib.py", line 89, in __exit__
      File "clcache\__main__.py", line 124, in atomicWrite
    PermissionError: [WinError 5] Zugriff verweigert: 'C:/Gitlab-Runner/builds/44bc1753/0/smart_optics/Software_Development/someproject/cache\\stats.txt.new' -> 'C:/Gitlab-Runner/builds/44bc1753/0/smart_optics/Software_Development/someproject/cache\\stats.txt'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions