Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxwidgets doesn't build on Mac OS 10.10 #16329

Closed
wxtrac opened this issue Jun 15, 2014 · 23 comments
Closed

wxwidgets doesn't build on Mac OS 10.10 #16329

wxtrac opened this issue Jun 15, 2014 · 23 comments

Comments

@wxtrac
Copy link
Collaborator

@wxtrac wxtrac commented Jun 15, 2014

Issue migrated from trac ticket # 16329

component: wxOSX | priority: normal | resolution: fixed

2014-06-15 19:53:07: opoku created the issue


Build error
./src/osx/webview_webkit.mm:936:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList '
WebBackForwardList
history = [m_webView backForwardList];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/osx/webview_webkit.mm:954:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList '
WebBackForwardList
history = [m_webView backForwardList];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [webviewdll_osx_webview_webkit.o] Error 1

Full build log found here

https://gist.github.com/anonymous/800433ba97165afbc255

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 17, 2014

2014-06-17 06:48:12: Dom_T4 commented


Same issue as above. Perhaps expected at this point in 10.10.

My final readout:

./src/osx/webview_webkit.mm:392:30: warning: incompatible pointer types sending
      'WebViewUIDelegate *' to parameter of type 'id<WKUIDelegate>'
      [-Wincompatible-pointer-types]
    [m_webView setUIDelegate:uiDelegate];
                             ^~~~~~~~~~
./src/osx/webview_webkit.mm:464:34: warning: 'WKPreferences' may not respond to
      'setUsesPageCache:'
        [[m_webView preferences] setUsesPageCache:NO];
         ~~~~~~~~~~~~~~~~~~~~~~~ ^
./src/osx/webview_webkit.mm:466:34: warning: 'WKPreferences' may not respond to
      'setUsesPageCache:'
        [[m_webView preferences] setUsesPageCache:YES];
         ~~~~~~~~~~~~~~~~~~~~~~~ ^
./src/osx/webview_webkit.mm:936:25: error: cannot initialize a variable of type
      'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/osx/webview_webkit.mm:954:25: error: cannot initialize a variable of type
      'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 2 errors generated.
make: *** [webviewdll_osx_webview_webkit.o] Error 1

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 17, 2014

2014-06-17 20:23:32: @vadz commented


This is strange, backForwardList is still documented as returning WebBackForwardList* in Apple documentation so I really don't know what's going on here. And WKBackForwardList can't even be found in the Apple docs at all (although it is in Webkit code).

Unfortunately I don't even have OS X 10.10 so I am not going to be able to do anything about this myself.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 08:50:17: opoku uploaded file wx_webview.patch (0.2 KiB)

Patch for broken build in wx web view

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 09:04:43: opoku commented


I figured out a fix. For 10.10, Apple migrated all the existing Webkit.h headers into a WebkitLegacy.h. Changing the header as shown below works fine but only for 10.10. However, it is obviously not a suitable patch to apply to the general code base because it doesn't target 10.10 specifically.

--- src/osx/webview_webkit.mm	
+++ ww_we.mm			
@@ -28,7 +28,7 @@
 #include "wx/hashmap.h"
 #include "wx/filesys.h"
 
-#include <WebKit/WebKit.h>
+#include <WebKit/WebKitLegacy.h>
 #include <WebKit/HIWebView.h>
 #include <WebKit/CarbonUtils.h>

Ideally, there is some 10.10 specific #define that can be used. An example is shown below. Unfortunately, I wasn't able to figure out an appropriate #define to use here. Maybe someone else can suggest something appropriate.

--- src/osx/webview_webkit.mm	
+++ ww_we.mm			
@@ -28,7 +28,7 @@
 #include "wx/hashmap.h"
 #include "wx/filesys.h"
 
-#include <WebKit/WebKit.h>
+#ifdef _FAKE_DEFINE_MAC_YOSEMITE_
+#include <WebKit/WebKitLegacy.h>
+#else
+#include <WebKit/WebKit.h>
+#endif
 #include <WebKit/HIWebView.h>
 #include <WebKit/CarbonUtils.h>
 

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 19:31:01: plorkyeran commented


#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 should be the correct check.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 20:13:07: @csomor changed status from new to accepted

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 20:40:05: @csomor commented


strange, are you sure you are building against the correct and current 10.10 SDK of an XCode distribution ? My Webkit/Webkit.h does include all WK headers and a WebKitLegacy.h at the end ?

so use --with-macosx-sdk and direct to the SDK in the XCode6 Beta

you shouldn't use folders of the system itself, always use the SDK

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 20:46:06: @csomor commented


btw: if you build by a script use things like

xcrun --sdk macosx --show-sdk-path to retrieve the correct path for --with-macosx-sdk

and sudo xcode-select -s PATH_TO_XCODE_DEVELOPER_FOLDER to set the correct xcode version

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 18, 2014

2014-06-18 20:51:33: @csomor changed status from accepted to infoneeded

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 20, 2014

2014-06-20 07:59:08: opoku changed status from infoneeded to accepted

2014-06-20 07:59:08: opoku commented

You are correct. The Webkit.h header also includes WebkitLegacy.h. This is the case both in the system framework header and the header in the SDK.

However, the m_webView object is defined as id in the source and, while I'm not completely sure exactly what the compiler does with this type information, it seems to use the first matching method of any object based on the order of occurrence in the header.

This first matching method just so happens to return a WKBackForwardList instead of the WebBackForwardList object that would actually be returned at runtime since the m_webView is in fact a WebView and not a WKWebView.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 20, 2014

2014-06-20 10:14:48: @csomor commented


In 76743:
using proper types for webkit variants, see #16329

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 20, 2014

2014-06-20 10:15:33: @csomor commented


In 76744:
fixes 64 bit to 32 warnings, see #16329

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 20, 2014

2014-06-20 10:25:41: @csomor commented


although in my Xcode builds I only got warnings but no errors, I'�ve changed the types to proper cocoa instance ptrs, so things should not create warnings anymore. Could you please retest? Thanks

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Sep 15, 2014

2014-09-15 01:08:13: @vadz commented


In 77698:
fixes 64 bit to 32 warnings, see #16329

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jan 18, 2015

2015-01-18 23:32:24: historic_bruno (Ben Brian) commented


I've tested a patch based on 76743 applied to wxWidgets 3.0.2 and was able to build on both Yosemite and Lion with no errors.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jan 23, 2015

2015-01-23 12:36:22: frederic_wang commented


FWIW, I just tested on Yosemite ; the stable release has the build error but not the development version. So I guess this bug can be closed.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 12, 2015

2015-03-12 15:24:03: @vadz uploaded file 0001-using-proper-types-for-webkit-variants-see-16329.patch (5.7 KiB)

Patch for 3.0 branch

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 12, 2015

2015-03-12 15:26:54: @vadz commented


Could someone please test attachment:0001-using-proper-types-for-webkit-variants-see-16329.patch under 10.10 and check if it works? I'd like to fix this in 3.0.3.

TIA!

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 12, 2015

2015-03-12 15:44:04: frederic_wang commented


I can try, but I'm a bit confused as I thought this was fixed on trunk. Which version of wxwidgets do you want me to apply the patch?

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 12, 2015

2015-03-12 16:29:17: @vadz commented


3.0.2 (where it still doesn't work). Thanks!

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 12, 2015

2015-03-12 17:01:33: frederic_wang commented


OK, the patch seems to work for me.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 20, 2015

2015-03-20 17:44:28: @lanurmi commented


I also confirm that the patch fixes compilation on 10.10 when applied to 3.0.2.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 22, 2015

2015-03-22 01:02:43: @vadz changed status from accepted to closed

2015-03-22 01:02:43: @vadz changed resolution from ** to fixed

2015-03-22 01:02:43: @vadz commented

In 2a13ad6:
Fix wxOSX build under 10.10.

Use proper types for webkit variants.

Closes #16329.

@wxtrac wxtrac closed this Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant