Search code examples
qtwebkitphantomjsqtwebkitqwebkit

Building PhantomJS 2.0 on Windows results in a strange error


I am trying to build PhantomJS 2.0 on Windows from the c:\fastio\phantomjs\phantomjs directory. For some reason, the build process fails after a while, with 2 errors (see error message below):

1) It tries to access "C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe". Obviously, the backslash characters between directory names are somehow getting stripped away deep in the build process - possibly a mismatch between Windows-style "\" and Linux-style "/" (but this is only a guess).

2) There's another error, "Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in".

If I remove sh.exe from the PATH, the build still gets to this point, and only error #2 appears, leading me to think that error #2 is the real problem here.

Here is the full error message (as far as I can tell this is happening while building WebKit):

sh: C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe: command not found
Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in at C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/dom/make_names.pl line 315.
NMAKE : fatal error U1077: 'C:\Users\Eugene\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\perl.EXE' : return code '0x7f'
Stop.

(By the way, I saw this question but I'm already past the issues described there, my error is happening later in the build process.)

How can I make this work?

Full logs below:

Console output: http://pastebin.com/btMeNPz4

QT build log file build_qt_4-285-20-0859.log: http://pastebin.com/LUEJz7E0

WebKit build log file build_webkit_4-285-20_0859.log: http://pastebin.com/494TivXF

PhantomJS build log file build_phantomjs_4-285-20_0859.log: Empty


Solution

  • Looks like I found the solution myself, here were my steps:

    1. Remove as much as possible from the PATH leaving only the entries critical to the build process
    2. Most importantly, remove all GitHub's git directories from the PATH
    3. Install GIT separately (not from GitHub but from git-scm.com), add its cmd directory only (not its bin directory) to the PATH
    4. Install ActivePerl separately, add it to the PATH

    It's moving past the error I asked about with the steps above (still not sure if it will finish the build successfully, it's taking a while).