From 9eb1123c8629258777ae52731f416fa8370de5d6 Mon Sep 17 00:00:00 2001 From: Tadeu Manoel Date: Fri, 27 Jan 2017 14:25:58 -0200 Subject: [PATCH 1/2] Add creation of Chocolatey and .zip packages with PyInstaller-generated clcache.exe --- appveyor.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ clcache.nuspec | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 clcache.nuspec diff --git a/appveyor.yml b/appveyor.yml index 9947ff0a..87235779 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -85,3 +85,46 @@ test_script: & codecov --no-color -X gcov -F integrationtests -e PYTHON_INSTALL if ($testsExitCode -ne 0) {exit $testsExitCode} + +on_success: + # Creates executable with PyInstaller (perhaps could also be on a "before_deploy" or "after_test" section) + + - pip install pyinstaller + - pyinstaller clcache.py + - for /F %%i in ('python -c "import clcache; print(clcache.VERSION)"') do set CLCACHE_VERSION=%%i + - "echo Version: %CLCACHE_VERSION" + - move dist\clcache clcache-%CLCACHE_VERSION% + + # Build the Chocolatey package + - sed -i "s/{VERSION}/%CLCACHE_VERSION%/g" clcache.nuspec + - choco pack -v -d + + # Test the compiled extension + - cd clcache-%CLCACHE_VERSION% + - clcache.exe --help + - clcache.exe -s + - cd .. + + # Test the chocolatey package + - ps: ls clcache.${env:CLCACHE_VERSION}.nupkg + - choco install -v -d "clcache.%CLCACHE_VERSION%.nupkg" --version=%CLCACHE_VERSION% + - clcache --help + - clcache -s + - where clcache + + # Publish artifacts + - "echo Branch: %APPVEYOR_REPO_BRANCH%" + - "echo Pull Request: %APPVEYOR_PULL_REQUEST_NUMBER%" + - "echo Tag: %APPVEYOR_REPO_TAG_NAME%" + - cd clcache-%CLCACHE_VERSION% + - 7z a -y clcache-%CLCACHE_VERSION%.zip + - move clcache-%CLCACHE_VERSION%.zip .. + - cd .. + - set PUBLISH=1 + # Disable for Python 3.5, because of PyInstaller problems on older Windows + - if "%PYTHON_INSTALL%"=="C:\Python35" set PUBLISH= + - sha256sum clcache.%CLCACHE_VERSION%.nupkg clcache-%CLCACHE_VERSION%.zip + - sha256sum clcache.%CLCACHE_VERSION%.nupkg clcache-%CLCACHE_VERSION%.zip > SHA256SUM + - if "%PUBLISH%"=="1" appveyor PushArtifact clcache.%CLCACHE_VERSION%.nupkg + - if "%PUBLISH%"=="1" appveyor PushArtifact clcache-%CLCACHE_VERSION%.zip + - if "%PUBLISH%"=="1" appveyor PushArtifact SHA256SUM diff --git a/clcache.nuspec b/clcache.nuspec new file mode 100644 index 00000000..72c402a4 --- /dev/null +++ b/clcache.nuspec @@ -0,0 +1,32 @@ + + + + + clcache + clcache + {VERSION} + Frerich Raabe + frerich,tadeu + Compiler cache for Microsoft Visual Studio + +A little Python script which attempts to avoid unnecessary recompilation by reusing previously cached object files if possible. It is meant to be called instead of the original 'cl.exe' executable. The script analyses the command line to decide whether source code is to be compiled. If so, a cache will be queried for a previously stored object file. + +This package contains an executable generated by `pyinstaller`, and is meant to facilitate the usage of `clcache.py` in a portable way. It is specially useful when needing to use `clcache.py` in environments with Python 2, since newer versions of `clcache.py` supports only Python 3.3+. + + https://github.com/frerich/clcache + https://github.com/frerich/clcache + https://github.com/frerich/clcache + clcache clcache.py ccache compiler + +Copyright (c) + 2010, 2011, 2012, 2013, 2016 froglogic GmbH + 2016 Simon Warta (Kullo GmbH) + 2016 Tim Blechmann + + https://github.com/frerich/clcache/blob/master/LICENSE + false + + + + + \ No newline at end of file From b3ab6b455c58b68b930b1beb49ffd9e3a68f9da2 Mon Sep 17 00:00:00 2001 From: Tadeu Manoel Date: Fri, 27 Jan 2017 15:28:52 -0200 Subject: [PATCH 2/2] Remove some debugging code from appveyor.yml --- appveyor.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 87235779..2b292c06 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -87,8 +87,7 @@ test_script: if ($testsExitCode -ne 0) {exit $testsExitCode} on_success: - # Creates executable with PyInstaller (perhaps could also be on a "before_deploy" or "after_test" section) - + # Creates executable with PyInstaller - pip install pyinstaller - pyinstaller clcache.py - for /F %%i in ('python -c "import clcache; print(clcache.VERSION)"') do set CLCACHE_VERSION=%%i @@ -97,7 +96,7 @@ on_success: # Build the Chocolatey package - sed -i "s/{VERSION}/%CLCACHE_VERSION%/g" clcache.nuspec - - choco pack -v -d + - choco pack # Test the compiled extension - cd clcache-%CLCACHE_VERSION% @@ -107,22 +106,18 @@ on_success: # Test the chocolatey package - ps: ls clcache.${env:CLCACHE_VERSION}.nupkg - - choco install -v -d "clcache.%CLCACHE_VERSION%.nupkg" --version=%CLCACHE_VERSION% - - clcache --help - - clcache -s - - where clcache + - choco install "clcache.%CLCACHE_VERSION%.nupkg" --version=%CLCACHE_VERSION% + - C:\ProgramData\chocolatey\bin\clcache.exe --help + - C:\ProgramData\chocolatey\bin\clcache.exe -s # Publish artifacts - - "echo Branch: %APPVEYOR_REPO_BRANCH%" - - "echo Pull Request: %APPVEYOR_PULL_REQUEST_NUMBER%" - - "echo Tag: %APPVEYOR_REPO_TAG_NAME%" - cd clcache-%CLCACHE_VERSION% - 7z a -y clcache-%CLCACHE_VERSION%.zip - move clcache-%CLCACHE_VERSION%.zip .. - cd .. - - set PUBLISH=1 + - echo PYTHON_INSTALL=%PYTHON_INSTALL% # Disable for Python 3.5, because of PyInstaller problems on older Windows - - if "%PYTHON_INSTALL%"=="C:\Python35" set PUBLISH= + - if not [%PYTHON_INSTALL%]==["C:\Python35"] set PUBLISH=1 - sha256sum clcache.%CLCACHE_VERSION%.nupkg clcache-%CLCACHE_VERSION%.zip - sha256sum clcache.%CLCACHE_VERSION%.nupkg clcache-%CLCACHE_VERSION%.zip > SHA256SUM - if "%PUBLISH%"=="1" appveyor PushArtifact clcache.%CLCACHE_VERSION%.nupkg