Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

[AppVeyor] The filename, directory name, or volume label syntax is incorrect. #156

Closed
svenevs opened this issue Aug 14, 2018 · 1 comment

Comments

@svenevs
Copy link

svenevs commented Aug 14, 2018

Related: #129 and #139

As mentioned, the CI builds for this repo fail on this same error. Ignoring the issuing of posix find (disabled by -X gcov), noting that I do not actually know where this error comes from, here is the symptom of whatever it is that is broken in this tool for windows:

codecov.exe : The filename, directory name, or volume label syntax is incorrect.
At line:1 char:1
+ & codecov -X gcov -f .\coverage.xml --name win64_cxx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (The filename, d...x is incorrect.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I have rigorously tested a variety of ways to call the command, and they all result in the same The filename, directory name, or volume label syntax is incorrect. message. This is problematic, because almost every way that you can run codecov will successfully upload the results but give a non-zero exit code, which reports back as a failed CI build.

Failing Ways to Call Codecov

Brackets [-X gcov [-f filename [--name my_name]]] indicate that all permutations (with / without -X gcov and --name my_name and -f filename) have been tested (because I'm obsessive, and was kind of drunk).

  • codecov [-X gcov [-f filename [--name my_name]]]
  • python -m codecov [-X gcov [-f filename [--name my_name]]]

Basically, how you are supposed to run codecov depending on what you've done with $PATH etc.

Super Hacky Workaround

So I'm a powershell novice, but there is this thing called Invoke-Expression that lets you call a command. Conveniently (really only for this use case actually), Invoke-Expression will give an exit code of 0 even if the thing that was invoked gives a non-zero exit code.

@johlju i don't really know if this enables an alternative solution for you since i'm not capturing the "result" here, but in my appveyor.yml i just cheated and did this:

# relevant for below
environment:
  matrix:
    - PYTHON:    "C:\\Python27"
      TEST_NAME: "win32_py27"
    - PYTHON:    "C:\\Python27-x64"
      TEST_NAME: "win64_py27"
    - PYTHON:    "C:\\Python36-x64"
      TEST_NAME: "win64_py36"

# ... your install / test_script etc

# Why use Invoke-Expression like this?  Because I keep getting
#
#   codecov : The filename, directory name, or volume label syntax is incorrect.
#
# Which reports the build as failed, but Invoke-Expression always succeeds xD
after_test:
  - ps: |
      $codecov_cmd = '& codecov -X gcov --name ' + $env:TEST_NAME
      Invoke-Expression $codecov_cmd

I will successfully receive updated code coverage reports to codecov.io, regardless of the fact that the expression fails.

Anyway, I tried to give as much detail as possible to hopefully help somebody narrow down what is actually going on. It seems that if you want to fix windows support for this (epic and amazing) tool, you need to target whatever is triggering this The filename, directory name, or volume label syntax is incorrect, which I think comes from that root = quote(root) business (maybe don't do that unconditionally, but instead do it if platform.system() != "Windows"?

Hope this is helpful. It's a quasi-duplicate, and I've finally found a workaround, so feel free to close it if you like. I just wanted to elaborate on the precise problem, since I care very deeply about this tool and codecov.io ❤️

@Flamefire
Copy link

The filename, directory name, or volume label syntax is incorrect.

Would be fixed by #169

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants