Important: Please read the Qt Code of Conduct -

qmake: What determines which shell is invoked?

  • We recently migrated our build server to a different machine (Windows 7 to Windows 7), and builds are now failing in steps added to QMAKE_POST_LINK which include calls to shell_path(). These post-build steps executed windeployqt and copied files over to a deploy directory from which an installer is later built. Specifically, all calls to shell_path() return paths in UNIX format, even though this is a Windows 7 machine. The prior machine returned Windows paths as expected. Example:

    path input to shell_path('C:/A/B')
    returns the following: /C/A/B
    instead of what was returned on our previous build server and a local windows box: C:\A\B

    The description of this function ( states:
    "Converts all directory separators within path to separators that are compatible with the shell that is used while building the project (that is, the shell that is invoked by the make tool). For example, slashes are converted to backslashes when the Windows shell is used."

    What environment variable or other setting determines what shell is invoked by qmake?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Anything that changed when you migrated ? e.g. Qt version ? Compiler used ? Build environment ?

  • No changes that I know of. QT version was the same (5.3) with the same compiler (minGW 4.8.2). I recreated that same setup on a local machine in a VM, where the behavior was as expected (generated Windows paths). I also did a complete re-install of QT on the server and the behavior didn't change.

    Hence, I thought I'd ask how QT determines what shell to invoke, as that seems to be the piece I don't yet understand.

  • Lifetime Qt Champion

    AFAIK, qmake works with the Windows command line. The fact that you're using MinGW doesn't influence in that respect. Do you have any special shell on your machine ?

Log in to reply