frerich / clcache

A compiler cache for MSVC, much like ccache for gcc
Other
325 stars 83 forks source link

Fix upgrading pip/setuptools/wheel during AppVeyor CI builds #321

Closed frerich closed 6 years ago

frerich commented 6 years ago

The CI builds started failing a while ago, printing:

pip install -U pip setuptools wheel ERROR: To modify pip, please run the following command: c:\python34\python.exe -m pip install -U pip setuptools wheel

I.e. it sounds as if one should not invoke 'pip' directly for some reason but rather load it as a Python module. Looking at the YAML file, it seems we already did that -- right after the problematic 'pip install -U' call! So let's drop the direct 'pip' call in favor of the existing 'python -m pip ...' call to fix this.

formiaczek commented 6 years ago

ouh, I didn't check other PRs.. and tried to address the same issue :) I think the complaint was about the pip installing on top of itself.. and in 2cc04bb I thought that this pip install was not really needed after all, invoking it through the module will update pip itself without complaints :) I'll drop this commit / rebase once you've merged your fix :)

formiaczek commented 6 years ago

thanks for fixing this :+1:

frerich commented 6 years ago

Alas, I don't understand why the coverage program can be executed as a plain shell command in the .yml file, but not in a PowerScript script. :-(

izmmisha commented 6 years ago

Ok, one more problems I discovered:

Codecov v2.0.15
==> Detecting CI provider
    AppVeyor Detected
    Fixing merge commit SHA
==> Preparing upload
    Error running `cd 'C:\projects\clcache' && git ls-files`: None
XX> Skip processing gcov
==> Collecting reports
XX> Searching for reports disabled
Error: No coverage report found

codecov can't find coverage report if coverage.xml is already exists, so need to remove coverage xml call, codecov will call it.

codecov.exe : The filename, directory name, or volume label syntax is incorrect. this exception probably can be avoided if redirect codecov stderr output to null (2> $null), but not sure if this helps. this not helps...

izmmisha commented 6 years ago

Well, maybe better would to move from codecov-python to codecov-exe, I'm tried it - results at https://ci.appveyor.com/project/izmmisha/clcache/build/1.0.3/job/qahj29815ccvi2jc

diff --git a/appveyor.yml b/appveyor.yml
index fef38c1..ceea7be 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -56,7 +56,7 @@ install:
   - pip install .

   # Install tool for uploading coverage data to codecov.io
-  - pip install codecov
+  - choco install codecov
   - where coverage
   - coverage --version

@@ -97,7 +97,7 @@ test_script:
       $wc = New-Object 'System.Net.WebClient'
       $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\unittests.xml))

-      & ${env:PYTHON_INSTALL}\Scripts\codecov.exe --no-color -X gcov -F unittests -e PYTHON_INSTALL
+      & codecov -f coverage.xml

       if ($testsExitCode -ne 0) {exit $testsExitCode}

@@ -114,7 +114,7 @@ test_script:
       $wc = New-Object 'System.Net.WebClient'
       $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\integrationtests.xml))

-      & ${env:PYTHON_INSTALL}\Scripts\codecov.exe --no-color -X gcov -F integrationtests_memcached -e PYTHON_INSTALL
+      & codecov -f coverage.xml

       if ($testsExitCode -ne 0) {exit $testsExitCode}
izmmisha commented 6 years ago

@frerich the problem with

 codecov.exe : The filename, directory name, or volume label syntax is incorrect.
    At line:9 char:1
    + & codecov --no-color -X gcov -F unittests -e PYTHON_INSTALL
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (The filename, d...x is incorrect.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

is related to codecov itself, here is my comment and issue https://github.com/codecov/codecov-python/issues/156

invocation of codecov is correct.

izmmisha commented 6 years ago

Coverage report still not uploading via codecov: Error: No coverage report found. according to the code

            if os.path.exists(opj(os.getcwd(), '.coverage')) and not os.path.exists(opj(os.getcwd(), 'coverage.xml')):
                write('    Generating coverage xml reports for Python')
                # using `-i` to ignore "No source for code" error
                try_to_run('coverage xml -i')
                reports.append(read(opj(os.getcwd(), 'coverage.xml')))

coverage.xml will be append to reports if coverage.xml not exists and codecov will generate it by coverage xml -i

codecov-io commented 6 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@7a3e62a). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #321   +/-   ##
=========================================
  Coverage          ?   88.23%           
=========================================
  Files             ?        4           
  Lines             ?     1275           
  Branches          ?      190           
=========================================
  Hits              ?     1125           
  Misses            ?      111           
  Partials          ?       39
Flag Coverage Δ
#integrationtests_memcached 66.85% <21.05%> (?)
#unittests 85.25% <100%> (?)
Impacted Files Coverage Δ
clcache/storage.py 87.14% <100%> (ø)
clcache/__main__.py 90.11% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7a3e62a...493350b. Read the comment docs.