Curl: command not found

jacob.beck's Avatar

jacob.beck

20 Mar, 2017 07:24 PM

Our build script includes a curl command. We're now getting this error on the line where we try to curl a file:

`'curl' is not recognized as an internal or external command, operable program or batch file.`

This wasn't the case as of this morning.

  1. Support Staff 1 Posted by Feodor Fitsner on 20 Mar, 2017 07:31 PM

    Feodor Fitsner's Avatar

    Will take a look. Thanks for reporting that.

  2. Support Staff 2 Posted by Feodor Fitsner on 20 Mar, 2017 07:49 PM

    Feodor Fitsner's Avatar

    OK, found the issue. We are rolling out an update to build worker images and there is latest Git 2.12.0 installed.

    Previous versions of Git had curl.exe in C:\Program Files\Git\usr\bin folder which is added in PATH on build workers. The main reason it was on PATH was ssh.exe utility Git (and Mercurial) required to fetch repo via SSH.

    Now, curl.exe has gone from C:\Program Files\Git\usr\bin and left in C:\Program Files\Git\mingw64\bin only. To fix the build add this to your appveyor.yml:

    install:
    - set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
    

    Alternatively, CURL can be installed via Chocolatey or used from other locations such as MinGW, Cygwin and MSYS: https://www.appveyor.com/docs/build-environment/#mingw-msys-cygwin

    I don't know whether we should explicitly add C:\Program Files\Git\mingw64\bin folder into PATH on build workers or not - there is always a risk of causing another conflict. Less stuff on PATH is better.

  3. 3 Posted by Tom on 20 Mar, 2017 08:33 PM

    Tom's Avatar

    Thanks Feodor, this fix worked for me:
    install:
    - set PATH=C:\Program Files\Git\mingw64\bin;%PATH%

  4. 4 Posted by jacob.beck on 20 Mar, 2017 08:33 PM

    jacob.beck's Avatar

    This worked, thank you!

  5. 5 Posted by Edward Z. Yang on 21 Mar, 2017 01:34 AM

    Edward Z. Yang's Avatar

    This fix didn't work for me; does anyone know what I am doing wrong? Here's a failing build log: https://ci.appveyor.com/project/23Skidoo/cabal/build/%233344%20(master)

  6. 6 Posted by Edward Z. Yang on 21 Mar, 2017 04:37 AM

    Edward Z. Yang's Avatar

    Answer: set PATH after refreshenv; otherwise it gets clobbered ;)

  7. 7 Posted by Blair Conrad on 21 Mar, 2017 07:51 PM

    Blair Conrad's Avatar

    Thanks for the speedy response, Feodor.
    I've an additional question, though: I see that the VS2017 environment doesn't have MinGW:
    https://www.appveyor.com/docs/build-environment/#mingw-msys-cygwin

    I'm not on that environment yet, but thinking about moving. Will MinGW appear, or should I look for an alternative to that curl?

  8. Support Staff 8 Posted by Feodor Fitsner on 21 Mar, 2017 09:51 PM

    Feodor Fitsner's Avatar

    We'll install curl on Visual Studio 2017 image too: https://github.com/appveyor/ci/issues/1431

    For now it can be easily installed with choco install curl during the build.

  9. 9 Posted by Blair Conrad on 22 Mar, 2017 10:11 AM

    Blair Conrad's Avatar

    Thanks, Feodor.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac