Permalink
Commits on Jan 16, 2018
  1. Made pylint happy

    frerich committed Jan 16, 2018
    Running pylint on storage.py complained
    
      R:140, 4: Either all return statements in a function should return an
                expression, or none of them should. (inconsistent-return-statements)
    
    ...and I tend to agree. So let's add an explicit 'return None'.
  2. Create CODE_OF_CONDUCT.md

    frerich committed Jan 16, 2018
Commits on Nov 7, 2017
  1. Adding 'monkey' script to patch distsutils if USE_CLCACHE is set (#287)

    xoviat authored and frerich committed Nov 7, 2017
    The .pth file is always loaded on python startup,
    but clcache_monkley.main only increases the startup
    time if USE_CLCACHE=1 is set as an environment variable.
Commits on Nov 6, 2017
  1. Merge pull request #298 from siu/removeSignalHandlers

    frerich committed Nov 6, 2017
    Remove signal handlers
Commits on Nov 1, 2017
  1. Find compiler: apply shutil.which to basenames (#304)

    xoviat authored and frerich committed Nov 1, 2017
    This handles the case where CLCACHE_CL is set to a basename rather than a full path. This is useful for setting cl to a different binary, like clang-cl.
  2. Enable static code analysis via mypy

    xoviat authored and frerich committed Nov 1, 2017
    This adds a few type annotations to the source code and
    enables running mypy as part of the CI build.
Commits on Oct 30, 2017
  1. Remove signal handlers

    siu committed Oct 16, 2017
    The signal handlers were introduced to avoid cache corruption when the
    clcache process is stopped in the middle of a write to the cache
    (statistics, manifests or objects). See #233. Even if SIGINT and SIGTERM
    were ignored the cache still had a chance to be corrupted in the event
    of a SIGTERM (which cannot be ignored).
    
    Since #233 the writing of files to the cache has been improved to
    replace the files atomically, reducing the risk of storing corrupted
    files in the cache. See pull requests #286, #292 and #296. Therefore
    ignoring these signals is not needed anymore.
Commits on Oct 29, 2017
  1. Merge pull request #301 from frerich/remove_redundant_assignment

    frerich committed Oct 29, 2017
    Removed redundant self-assignment
  2. Removed redundant self-assignment

    frerich committed Oct 29, 2017
  3. Drop support for Python 3.3

    frerich committed Oct 29, 2017
    There's a pending patch for clcache which improves behaviour when
    clcache is run concurrently; however, this currently often (!) breaks
    the CI tests with Python 3.3 due to a known bug in how the Python
    subprocess module handles reading stdout/stderr. The Python bug report
    
      https://bugs.python.org/issue19575
    
    has more on this topic. Alas, an inital workaround as posted on
    
      #294 (comment)
    
    didn't help.
    
    Since we already support Python 3.6 (i.e. we support the three most
    recent minor versions), let's just drop Python 3.3 support.
  4. Refactor into subpackage

    xoviat authored and frerich committed Oct 29, 2017
    * files are moved into a subpackage called 'clcache'
    * test files are changes to the test_* in the tests folder, which is pytest convention
    * appropriate installation requirements are added
    In addition, setuptools will automatically detect the Python files with find_packages, so py_modules is removed.
Commits on Oct 13, 2017
  1. Merge pull request #296 from siu/atomicCacheEntryWrites

    frerich committed Oct 13, 2017
    Replace whole cache entries atomically
Commits on Oct 12, 2017
  1. Split long lines

    siu committed Oct 12, 2017
  2. Write cache entry to a temporaryDir and replace

    siu committed Oct 12, 2017
    This guarantees that the whole cache entry is replaced atomically. This precents cache corruption when the clcache process is terminated in the middle of a write.
  3. Compute file path in-place in CompilerArtifactsSection.setEntry()

    siu committed Oct 12, 2017
    This will help refactoring to write first to a temporary folder and replace.
  4. Extract file names to constants

    siu committed Oct 12, 2017
  5. Fix source file duplication in command line

    xoviat authored and frerich committed Oct 12, 2017
    Previously, if the /Tp or /Tc option were passed, clcache would
    duplicate the source file in the command line, making MSVC
    think that it was compiling two separate files (/Tcexample.c 
    and example.c), when it was really compiling one.
    
    The problem with this was that MSVC only allows some
    options if it is compiling one file, which caused some
    invocations of clcache to fail.
  6. Revert reading manifests and statistics without acquiring the lock (#292

    siu authored and frerich committed Oct 12, 2017
    )
    
    Unfortunately windows does not allow to replace a file that is opened
    for reading by another process/thread. Reads and writes need to be
    serialized by using the locks.
    
    This reverts the locking of manifests and statistics to the state before
    pull request #286.
Commits on Oct 11, 2017
  1. Merge pull request #291 from frerich/ci_including_python36

    frerich committed Oct 11, 2017
    CI including python36
  2. Allow building clcachesrv with pyuv 1.4.0

    frerich committed Oct 11, 2017
    There's no binary build of pyuv 1.3.0 for Python 3.6 it seems, and pyuv
    1.4.0 is the recent release - so let's accept building with that and see
    how it goes.
  3. Print 'pip' version during CI builds

    frerich committed Oct 11, 2017
    Just for sanity when debugging CI failures.
  4. Perform continuous integration tests using Python 3.6, too

    frerich committed Oct 11, 2017
    Python 3.6 has been out for some time now, and AppVeyor build machines
    have it installed. So let's include it in our matrix to make sure that
    everything works with it, too.
  5. Merge pull request #286 from siu/master-safeRename

    frerich committed Oct 11, 2017
    Cache corruption protection: Atomic replacement of manifests, statistics and object files
Commits on Oct 10, 2017
Commits on Oct 3, 2017
  1. Move cache lock inside clearCache, cleanCache and printStatistics

    siu committed Sep 26, 2017
    Hide locking inside these functions to have more fine-grained control.
    Since writing to the statistics file is now atomic, locking is not
    needed.
  2. Re-add touchEntry

    siu committed Sep 26, 2017
    Since the manifest is not locked for reading before calling touchEntry it
    may have changed on disk. It is needed to lock, read the manifest, touch
    and write it atomically. touchEntry(...) also cannot rely on the index to
    be valid after read, so it was re-implemented to use the objectKey to find
    the correct entry.