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

Use git submodules for Qt Base and Qt WebKit #13640

Merged
merged 16 commits into from
Nov 8, 2015

Conversation

vitallium
Copy link
Collaborator

Covers this pull request also: #12578
As discussed here: https://groups.google.com/forum/#!topic/phantomjs-dev/TVJDJ2K_5R8

Check list:

  • Windows
  • Linux
  • ALERT: we can't build PhantomJS on OS X in a simple way right now, because Apple removed OpenSSL headers in XCode 7.
    We have to figure out the way to build PhantomJS with OpenSSL installed via Brew.

You can see additional commits for Windows platform. They're necessary for successful build.

Fixes:
#12426

@milianw
Copy link
Contributor

milianw commented Oct 13, 2015

\o/

thanks for picking this up. it's a great step forwards, imo.

@vitallium
Copy link
Collaborator Author

Included fix for XCode 7

@vitallium
Copy link
Collaborator Author

Now it works on all platforms.

/cc @ariya

@jeantil
Copy link

jeantil commented Oct 19, 2015

Starting from a clone of master, I merged the pull request and tried it.
I am on OS X Yosemite 10.10.5 but with xcode 7 installed

 xcodebuild -version
Xcode 7.0.1
Build version 7A1001

Here are the results of my attempts, first on an already checked out phantomjs project, reset --hard on master.

build

  • The first run of build.sh failed
> ./build.sh --confirm
System architecture... (Darwin 14.5.0 x86_64)

./preconfig.sh: line 187: /Users/jean/dev/sdev/src/github/phantomjs/src/qt/qtbase/configure: No such file or directory
  • I noticed build.py and ran it, the first run of build.py also failed :
> python build.py
----------------------------------------
               WARNING
----------------------------------------

Building PhantomJS from source takes a very long time, anywhere from 30 minutes
to several hours (depending on the machine configuration). It is recommended to
use the premade binary packages on supported operating systems.

For details, please go the the web site: http://phantomjs.org/download.html.

Do you want to continue (Y/n)? y
Executing in /Users/jean/dev/sdev/src/github/phantomjs: git submodule init
Submodule '3rdparty-win' (https://github.com/Vitallium/phantomjs-3rdparty-win.git) registered for path 'src/qt/3rdparty'
Submodule 'qtbase' (https://github.com/Vitallium/qtbase.git) registered for path 'src/qt/qtbase'
Submodule 'qtwebkit' (https://github.com/Vitallium/qtwebkit.git) registered for path 'src/qt/qtwebkit'
Executing in /Users/jean/dev/sdev/src/github/phantomjs: git submodule update --init
Cloning into 'src/qt/3rdparty'...
remote: Counting objects: 1226, done.
remote: Total 1226 (delta 0), reused 0 (delta 0), pack-reused 1226
Receiving objects: 100% (1226/1226), 95.71 MiB | 395.00 KiB/s, done.
Resolving deltas: 100% (529/529), done.
Checking connectivity... done.
Submodule path 'src/qt/3rdparty': checked out '60d059226c243f0d8576e22c3ea9f0de6672359d'
fatal: destination path 'src/qt/qtbase' already exists and is not an empty directory.
Clone of 'https://github.com/Vitallium/qtbase.git' into submodule path 'src/qt/qtbase' failed

ERROR: Failed to build PhantomJS! Initial update of git submodules failed.

After deleting the qtbase directory, I got it to build.

I also cloned the phantomjs repo anew and tried the same steps :
obviously build.sh still fails, build.py did work out of the box.

tests

In the "old" checkout, once build.py has succeeded. running

  • python test/run-tests.py yields
AssertionError: expected 7 to be 6

  :32 in showErrorEqual
    at global code (/Users/jean/dev/sdev/src/github/phantomjs/phantom-pr/test/standards/javascript/date.js:6:13)
The test standards/javascript/date.js FAILED

standards/javascript/function.js:
standards/console/console_log.js:
regression/issue12482.js:
/run-tests.js:
Started
.........................................................................F....................................................................................

WebPage object should not set invalid cookies
  Expected 'Invalid-Cookie-Name=Invalid-Cookie-Value' to be undefined.
  Expected 1 to be 0.

Finished in 5.185 seconds
158 specs, 2 failures

The test /run-tests.js FAILED
  • cd test;python run-tests.py yields
standards/javascript/date.js:
AssertionError: expected 7 to be 6

  :32 in showErrorEqual
    at global code (/Users/jean/dev/sdev/src/github/phantomjs/phantom-pr/test/standards/javascript/date.js:6:13)
The test standards/javascript/date.js FAILED

standards/javascript/function.js:
standards/console/console_log.js:
regression/issue12482.js:
/run-tests.js:
Started
.........................................................................F....................................................................................

WebPage object should not set invalid cookies
  Expected 'Invalid-Cookie-Name=Invalid-Cookie-Value' to be undefined.
  Expected 1 to be 0.

Finished in 5.185 seconds
158 specs, 2 failures

The test /run-tests.js FAILED

In the "new" checkout

  • python test/run-tests.py yields
AssertionError: expected 7 to be 6

  :32 in showErrorEqual
    at global code (/Users/jean/dev/sdev/src/github/phantomjs/test/standards/javascript/date.js:6:13)
The test standards/javascript/date.js FAILED

standards/javascript/function.js:
standards/console/console_log.js:
regression/issue12482.js:
/run-tests.js:
Started
.........................................................................F....................................................................................

WebPage object should not set invalid cookies
  Expected 'Invalid-Cookie-Name=Invalid-Cookie-Value' to be undefined.
  Expected 1 to be 0.

Finished in 5.273 seconds
158 specs, 2 failures
  • cd test;python run-tests.py yields
AssertionError: expected 7 to be 6

  :32 in showErrorEqual
    at global code (/Users/jean/dev/sdev/src/github/phantomjs/test/standards/javascript/date.js:6:13)
The test standards/javascript/date.js FAILED

standards/javascript/function.js:
standards/console/console_log.js:
regression/issue12482.js:
/run-tests.js:
Started
.........................................................................F....................................................................................

WebPage object should not set invalid cookies
  Expected 'Invalid-Cookie-Name=Invalid-Cookie-Value' to be undefined.
  Expected 1 to be 0.

Finished in 5.273 seconds
158 specs, 2 failures

Adding the bin directory of the corresponding checkout to the path results in the same failures in both cases.

After checking the travis-ci build @ https://travis-ci.org/ariya/phantomjs it looks like the correct way to run the tests is `test/run-tests.sh
boths run yielded

 test/run-tests.sh
Started
.........................................................................F....................................................................................

WebPage object should not set invalid cookies
  Expected 'Invalid-Cookie-Name=Invalid-Cookie-Value' to be undefined.
  Expected 1 to be 0.

Finished in 5.512 seconds
158 specs, 2 failures

Still from the travis-ci run it looks like there is another test suite to run ./test/run-tests-ghostdriver.sh
in both case, the test suite hangs after

SUCCESS for test shouldNotBeAbleToSwitchBackToInitialWindowUsingEmptyWindowNameParameter(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest

Full log

SUCCESS for test useDriverButDontQuit(ghostdriver.DriverBasicTest) in test class ghostdriver.DriverBasicTest
SUCCESS for test findElementViaXpathLocator(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
FAILURE for test gettingAllCookies(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test shouldThrowExceptionIfAddingCookieBeforeLoadingAnyUrl(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test failToFindNonExistentElement(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test deletingAllCookies(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test shouldUsePageTimeoutToWaitForPageLoadOnInput(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test findMultipleElements(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldNotHandleCasesWhenAsyncJavascriptInitiatesAPageLoadFarInTheFuture(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test shouldAllowToDeleteCookiesEvenIfNotSet(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test findNoChildElementsMeetingCriteria(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test deletingOneCookie(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test checkEnabledOnGoogleSearchBox(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test findChildElement(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldNotAllowToCreateCookieOnDifferentDomain(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test SubmittingFormShouldFireOnSubmitForThatForm(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test failFindElementsForInvalidXPathLocator(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldBeAbleToCreateCookieViaJavascriptOnGoogle(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test findNoElementsMeetingCriteria(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldRetainCookieInfo(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test checkClickOnINPUTSUBMITCausesPageLoad(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
FAILURE for test modifyingACookie(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test findElementWithImplicitWait(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test addingACookie(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
FAILURE for test shouldWaitForPossiblePageLoadOnlyWhenClickingOnSomeElement(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test failFindElementForInvalidXPathLocator(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldAllowToSetCookieThatIsAlreadyExpired(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
FAILURE for test findActiveElement(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test shouldWaitForOnClickCallbackToFinishBeforeContinuing(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test gettingAllCookiesOnANonCookieSettingPage(ghostdriver.CookieTest) in test class ghostdriver.CookieTest
SUCCESS for test findChildElements(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
SUCCESS for test checkDisplayedOnGoogleSearchBox(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 2.0.3](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 2.0.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test findElementsWithImplicitWait(ghostdriver.ElementFindingTest) in test class ghostdriver.ElementFindingTest
FAILURE for test checkClickOnAHREFCausesPageLoad(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 2.0.1](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldHandleCasesWhereJavascriptCodeInitiatesPageLoadsThatFail(ghostdriver.ElementMethodsTest) in test class ghostdriver.ElementMethodsTest
SUCCESS for test checkAttributesOnGoogleSearchBox(ghostdriver.ElementQueryingTest) in test class ghostdriver.ElementQueryingTest
SUCCESS for test throwExceptionWhenInteractingWithInvisibleElement(ghostdriver.ElementQueryingTest) in test class ghostdriver.ElementQueryingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 2.0.0](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test getTextFromDifferentLocationsOfDOMTree(ghostdriver.ElementQueryingTest) in test class ghostdriver.ElementQueryingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.10.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldSwitchToTheRightFrame(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test checkLocationAndSizeOfBingSearchBox(ghostdriver.ElementQueryingTest) in test class ghostdriver.ElementQueryingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.10.1](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test failToSwitchToFrameByName(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.10.0](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.9.1](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test pageSourceShouldReturnSourceOfFocusedFrame(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test scrollElementIntoView(ghostdriver.ElementQueryingTest) in test class ghostdriver.ElementQueryingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.9.0](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldSwitchBetweenNestedFramesPickedViaWebElement(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.8.3](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test searchForCheese(ghostdriver.GoogleSearchTest) in test class ghostdriver.GoogleSearchTest
SUCCESS for test switchToFrameByNumber(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.8.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
FAILURE for test doubleClick(ghostdriver.MouseCommandsTest) in test class ghostdriver.MouseCommandsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.8.1](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test handleClickWhenOnClickInlineCodeFails(ghostdriver.MouseCommandsTest) in test class ghostdriver.MouseCommandsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.8.0](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.7.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
FAILURE for test clickAndRightClick(ghostdriver.MouseCommandsTest) in test class ghostdriver.MouseCommandsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.6.4](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldTimeoutWhileChangingIframeSource(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
FAILURE for test clickAndHold(ghostdriver.MouseCommandsTest) in test class ghostdriver.MouseCommandsTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.5.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldSwitchBetweenNestedFrames(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.4.4](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
FAILURE for test move(ghostdriver.MouseCommandsTest) in test class ghostdriver.MouseCommandsTest
SKIPPED for test shouldBeAbleToExecuteMultipleAsyncScriptsSequentiallyWithNavigation(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.3.2](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test shouldBeAbleToClickInAFrameAfterRunningJavaScript(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToPassMultipleArgumentsToAsyncScripts(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SUCCESS for test shouldBeAbleToClickAndEventsBubbleUpUsingJquery[jQuery Version: 1.2.6](ghostdriver.ElementJQueryEventsTest) in test class ghostdriver.ElementJQueryEventsTest
SUCCESS for test findGoogleInputFieldInjectingJavascript(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SUCCESS for test switchToFrameByElement(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldBeAbleToSwitchToIFrameThatHasNoNameNorId(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test setTimeoutAsynchronously(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SUCCESS for test shouldBeAbleToExecuteMultipleAsyncScriptsSequentially(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SKIPPED for test executeAsyncScriptMultipleTimesWithoutCrashing(ghostdriver.ScriptExecutionTest) in test class ghostdriver.ScriptExecutionTest
SUCCESS for test titleShouldReturnWindowTitle(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test enumerateWindowHandle(ghostdriver.WindowHandlesTest) in test class ghostdriver.WindowHandlesTest
SUCCESS for test shouldBeAbleToClickInAFrame(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test shouldSwitchBackToMainFrameIfLinkInFrameCausesTopFrameReload(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test switchToFrameByName(ghostdriver.FrameSwitchingTest) in test class ghostdriver.FrameSwitchingTest
SUCCESS for test openPopupAndGetCurrentUrl(ghostdriver.WindowHandlesTest) in test class ghostdriver.WindowHandlesTest
SUCCESS for test shouldReturnLogTypeHar(ghostdriver.LogTest) in test class ghostdriver.LogTest
SUCCESS for test enumerateWindowHandles(ghostdriver.WindowHandlesTest) in test class ghostdriver.WindowHandlesTest
SUCCESS for test shouldReturnLogTypeBrowser(ghostdriver.LogTest) in test class ghostdriver.LogTest
SUCCESS for test shouldReturnListOfAvailableLogs(ghostdriver.LogTest) in test class ghostdriver.LogTest
SUCCESS for test executePhantomJS(ghostdriver.PhantomJSCommandTest) in test class ghostdriver.PhantomJSCommandTest
SUCCESS for test navigateAroundMDN(ghostdriver.TimeoutSettingTest) in test class ghostdriver.TimeoutSettingTest
SUCCESS for test switchBetween3WindowsThenDeleteSecondOne(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest
SUCCESS for test switchToSameWindowViaHandle(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest
SUCCESS for test shouldBeAbleToClickALinkThatClosesAWindow(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest
SUCCESS for test switchBetween3WindowsThenDeleteFirstOne(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest
SUCCESS for test shouldNotBeAbleToSwitchBackToInitialWindowUsingEmptyWindowNameParameter(ghostdriver.WindowSwitchingTest) in test class ghostdriver.WindowSwitchingTest

As a suggestion : a note in either README.ms or CONTRIBUTING.md on

  • how to build the repo (that I can contribute)
  • how to properly run the tests
    since digging in travis.yml is not obvious

Also travis.yml may need to be updated since it tries to build the project with build.sh and not build.py ...

@alduro
Copy link

alduro commented Oct 19, 2015

how should I install phantomjs now ? from source, which takes a lot of time ? from brew ? I'm stuck on this since 1 week now.

this is my brew config output:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 3c9da0212be124c6aa7d2e14ed1c13b14767f01e
Last commit: 6 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit haswell
OS X: 10.11-x86_64
Xcode: 7.1 => /Applications/Xcode-beta.app/Contents/Developer
CLT: 7.0.0.0.1.1441394355
Clang: 7.0 build 700
X11: 2.7.7 => /opt/X11
System Ruby: 2.0.0-p645
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/aldo/.rbenv/shims/ruby => /Users/aldo/.rbenv/versions/2.2.3/bin/ruby
Java: 1.8.0_25

@jeantil jeantil mentioned this pull request Oct 22, 2015
7 tasks
@jeantil
Copy link

jeantil commented Oct 22, 2015

@alduro for now you have to checkout the github repo, merge this pull request manually and build from source. in #212902, @vitallium says that he might provide nightly builds for each platforms.

@vitallium
Copy link
Collaborator Author

FYI: I'll merge it TODAY.

/cc @ariya @JamesMGreene @milianw @zackw

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

@vitallium Make sure to rebase first, commit 97d9ea2 is already in master.

I am doing some testing now.

@vitallium
Copy link
Collaborator Author

@zackw yeah, I'll rebase it first.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

Problem: after merging the branch, git submodule init for some reason only registers the 3rdparty and qtwebkit modules, not the qtbase module, which of course causes the build to fail. I am investigating.

$ git --version
git version 2.6.2

$ git status
On branch master
Your branch is ahead of 'origin/master' by 13 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

$ git clean -dxf

$ find src/qt 
src/qt
src/qt/preconfig.sh
src/qt/3rdparty
src/qt/preconfig.cmd
src/qt/qtwebkit

$ git submodule init
Submodule '3rdparty-win' (https://github.com/Vitallium/phantomjs-3rdparty-win.git)
    registered for path 'src/qt/3rdparty'
Submodule 'qtwebkit' (https://github.com/Vitallium/qtwebkit.git)
    registered for path 'src/qt/qtwebkit'

$ cat .gitmodules
[submodule "qtbase"]
    path = src/qt/qtbase
    url = https://github.com/Vitallium/qtbase.git
    branch = phantomjs
[submodule "qtwebkit"]
    path = src/qt/qtwebkit
    url = https://github.com/Vitallium/qtwebkit.git
    branch = phantomjs
[submodule "3rdparty-win"]
    path = src/qt/3rdparty
    url = https://github.com/Vitallium/phantomjs-3rdparty-win.git

Same behavior with git 2.1.4.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

It appears that the qtbase submodule directory was never committed, even though its configuration was committed. (Why it is possible to do this, I shall file in the infinite heap of baffling git design decisions.)

To fix, take a fresh clone of the branch, then run

$ git submodule add -b phantomjs --name qtbase -- \
     https://github.com/Vitallium/qtbase.git src/qt/qtbase

After this completes, git status should print

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   src/qt/qtbase

Commit that, push, take a second fresh clone, and make sure git submodule status prints three lines, not two.

@vitallium
Copy link
Collaborator Author

I could never get into git submodules. Shame on me...
But thanks! I'll fix that.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

Further notes:

  • Please add Source/ThirdParty/leveldb/release/ and Source/.pch/ to qtwebkit/.gitignore.

  • Build fails on OSX with Xcode 7.1 even if openssl is installed via port. This is probably because the Xcode compiler doesn't look in /opt/local by default. I don't mind if this is fixed later.

  • Build fails on Linux with gcc 5 (possibly only if GStreamer dev packages are installed) with

    platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
      In function ‘void webKitWebSrcSetProperty(GObject*,guint,const GValue*,GParamSpec*)’:
    platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:357:9:
      error: reference to ‘GMutexLocker’ is ambiguous
    In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:32:0,
                     from /usr/include/glib-2.0/glib.h:32,
                     from /usr/include/gstreamer-0.10/gst/gst.h:27,
                     from platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:24,
                     from platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:21:
    /usr/include/glib-2.0/glib/gthread.h:276:14:
      note: candidates are: typedef void GMutexLocker
    In file included from platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:43:0:
    ../WTF/wtf/gobject/GMutexLocker.h:32:7:
      note:                 class WebCore::GMutexLocker
    

    I do want this fixed before merging. Didn't we used to explicitly disable GStreamer support in preconfig.sh?

@vitallium
Copy link
Collaborator Author

  • Ok. Thanks.
  • I added a workaround (hack) to compile PhantomJS with XCode 7. But it's not presented in this PR yet.
  • Let's disable GStreamer completely.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

Test failures on Linux (with gcc-4.9 and no gstreamer):

ff..f.......................f............s................E...........s.F..f..
module/webpage/render: ERROR
XPASS: JPEG 
XPASS: JPEG (format option) 
XPASS: JPEG (quality option) 
XPASS: JPEG (format and quality options) 
ERROR: PhantomJS exited successfully when test failed

standards/javascript/date: FAIL
FAIL: new Date()
  assert_equals: expected 6 but got 7
  at /home/tbbscraperentry/phantomjs/test/standards/javascript/date.js:4:18

The Date failure appears actually to be a bug getting fixed: per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate , getDate() is 1-based (unlike getMonth), but the test case expects it to be 0-based. Should maybe patch that before landing.

The render failure, shrug, those tests need to have some capacity for fuzzy image matching before we can take them seriously. "ERROR: PhantomJS exited successfully when test failed" might be a bug in the testsuite, though. Regardless, can fix later.

@vitallium
Copy link
Collaborator Author

Update:

  • Committed QtBase.
  • Added a workaround for XCode 7. Could someone check it?

@vitallium
Copy link
Collaborator Author

@zackw I updated the build script. Could you please have a look? I'm not sure how we should handle flags from an environment variable.

@vitallium vitallium force-pushed the feature/submodules branch 2 times, most recently from caf2c39 to 048a018 Compare November 7, 2015 16:18
@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

@vitallium With your update, the build goes through on my Mac. And I think I've solved the GStreamer problem, patch shortly.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

... for values of "shortly" no sooner than "after I recompile the entire thing from scratch again :-("

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

CORRECTION: The problem with the standards/javascript/date test is not due to something that changed in this pull, it's a dependency on the time zone. I will do a separate pull request to address that, later.

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

This allows a successful build on Linux/gcc5 with the gstreamer libraries available. Should probably be put through its paces elsewhere.

diff --git a/build.py b/build.py
index 605ec90..e52dbdf 100755
--- a/build.py
+++ b/build.py
@@ -190,6 +190,8 @@ class PhantomJSBuilder(object):
                 "-no-mtdev",
                 "-no-libudev",
                 "-no-evdev",
+                "-no-pulseaudio",
+                "-no-alsa",
                 "-no-feature-PRINTPREVIEWWIDGET"
             ]

@@ -307,7 +309,12 @@ class PhantomJSBuilder(object):
         configureOptions = [
             # disable some webkit features we do not need
             "WEBKIT_CONFIG-=build_webkit2",
-            "WEBKIT_CONFIG-=netscape_plugin_api"
+            "WEBKIT_CONFIG-=netscape_plugin_api",
+            "WEBKIT_CONFIG-=use_gstreamer",
+            "WEBKIT_CONFIG-=use_gstreamer010",
+            "WEBKIT_CONFIG-=use_native_fullscreen_video",
+            "WEBKIT_CONFIG-=video",
+            "WEBKIT_CONFIG-=web_audio",
         ]
         if self.options.webkit_qmake_args:
             configureOptions.extend(self.options.webkit_qmake_args)

@zackw
Copy link
Contributor

zackw commented Nov 7, 2015

And one more addition to .gitignore: .qmake.stash in both qtbase and qtwebkit.

@alduro
Copy link

alduro commented Nov 8, 2015

@zackw steps to make it work on Mac ? Thanks.

@zackw
Copy link
Contributor

zackw commented Nov 8, 2015 via email

@vitallium
Copy link
Collaborator Author

Merging. I warned.

vitallium and others added 16 commits November 8, 2015 10:56
This script merges the functionality of all these files:

build.sh
src/qt/preconfig.sh
build.cmd
src/qt/preconfig.cmd

Note that some recent changes to the above files are not yet
included in this script. Due to that, these files are not yet removed.

If you fear this pulls in Python as another build dependency, then
fear not: Qt WebKit already requires Python internally. It also
includes Ruby and Perl btw, but I opted for Python.

Issue: ariya#12580
Removed deprecated options.
Added 3rd party libraries paths.
Third party libraries now have zlib library.
Zlib library is necessary for compression in PDF printing and WOFF files.
Ignore warning 4049 about importing locally defined symbols.
Apple stopped shipping OpenSSL with XCode7.
Let's use OpenSSL installed via Brew or MacPorts.
This allows a successful build on Linux/gcc5 with the gstreamer libraries
available.
@vitallium vitallium merged commit fce8475 into ariya:master Nov 8, 2015
@alduro
Copy link

alduro commented Nov 8, 2015

@zackw thanks. I will now try from master since this PR was merged.

@zackw
Copy link
Contributor

zackw commented Nov 8, 2015

@vitallium Is there any reason to keep build.sh and build.cmd around at this point?

@vitallium
Copy link
Collaborator Author

@zackw I keep them for compatibility. Will remove them in the near future.

@alduro
Copy link

alduro commented Nov 8, 2015

@zackw did work perfectly from master. Using Xcode 7.1 running build.py. Thanks.

@vitallium vitallium deleted the feature/submodules branch April 11, 2016 18:32
@kentr
Copy link

kentr commented Nov 30, 2016

The build is failing for me in Xcode 8, because the git submodule commands in build.py are setting qtbase HEAD to some unknown commit instead of to the branch phantomjs.

That's causing this error to appear. The commit checked out doesn't use xcodebuild as described in that answer, so qtbase/configure is failing with the Xcode not set up properly error.

Note, the phantomjs branch em does properly use xcodebuild.

I'm working around this by manually checking out the proper branches in the submodules and running python build.py --skip-git.

Ah, I noticed this was fixed in 936ba7a (#14082), but not in 2.1.1

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

Successfully merging this pull request may close these issues.

6 participants