Bug 79599 - webkit-gtk-1.7.90 fails to build testwebview for gtk2
Summary: webkit-gtk-1.7.90 fails to build testwebview for gtk2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 23:09 PST by Alexandre Rostovtsev
Modified: 2012-02-28 00:16 PST (History)
2 users (show)

See Also:


Attachments
complete build log (196.67 KB, application/x-bzip2)
2012-02-27 20:31 PST, Alexandre Rostovtsev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Rostovtsev 2012-02-25 23:09:48 PST
When configuring the webkit-gtk-1.7.90 tarball release --with-gtk=2.0, some tests fail to build because they use gtk3-only API:

Source/WebKit/gtk/tests/Programs_unittests_testwebview-testwebview.o: In function `test_webkit_web_view_does_not_steal_focus':
testwebview.c:(.text+0x4f): undefined reference to `gtk_box_new'
collect2: ld returned 1 exit status
Comment 1 Martin Robinson 2012-02-27 17:12:21 PST
This should be guarded by the GTK_API_VERSION2 define. This seems to be working properly for me. Can you build with "make V=1" and confirm that the macro is passed properly to the compiler?
Comment 2 Alexandre Rostovtsev 2012-02-27 20:31:43 PST
Created attachment 129178 [details]
complete build log

(In reply to comment #1)
> This should be guarded by the GTK_API_VERSION2 define. This seems to be working properly for me. Can you build with "make V=1" and confirm that the macro is passed properly to the compiler?

The test fails to find gtk_box_new even though -DGTK_API_VERSION_2=1 is passed to the compiler:

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.    -fno-strict-aliasing -I./Source/JavaScriptCore/ForwardingHeaders -I./Source/WebKit/gtk -I./DerivedSources -I./Source/WebKit/gtk -I./Source/WebCore/bindings -I./Source/WebCore/bindings/gobject -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -DENABLE_GLIB_SUPPORT=1 -DBUILDING_CAIRO__=1 -DBUILDING_GTK__=1 -DWTF_CHANGES -DXP_UNIX  -DWTF_USE_ICU_UNICODE=1   -DWTF_USE_GSTREAMER=1     -DGTK_API_VERSION_2=1 -DNDEBUG    -DENABLE_JIT=1 -I./Source -I./Source/JavaScriptCore -I./Source/JavaScriptCore/API -I./Source/JavaScriptCore/assembler -I./Source/JavaScriptCore/bytecode -I./Source/JavaScriptCore/bytecompiler -I./Source/JavaScriptCore/dfg -I./Source/JavaScriptCore/heap -I./Source/JavaScriptCore/debugger -I./Source/JavaScriptCore/ForwardingHeaders -I./Source/JavaScriptCore/interpreter -I./Source/JavaScriptCore/jit -I./Source/JavaScriptCore/jit -I./Source/JavaScriptCore/parser -I./Source/JavaScriptCore/profiler -I./Source/JavaScriptCore/runtime -I./Source/JavaScriptCore/tools -I./Source/JavaScriptCore/wtf -I./Source/JavaScriptCore/wtf -I./Source/JavaScriptCore/wtf/gobject -I./Source/JavaScriptCore/wtf/gtk -I./Source/JavaScriptCore/wtf/text -I./Source/JavaScriptCore/wtf/unicode -I./Source/JavaScriptCore/yarr -I./DerivedSources/JavaScriptCore -I./Source/WTF -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm   -pthread -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -lXrender -lX11   -lXt -lX11   -march=native -O2 -pipe  -MT Source/WebKit/gtk/tests/Programs_unittests_testwebview-testwebview.o -MD -MP -MF Source/WebKit/gtk/tests/.deps/Programs_unittests_testwebview-testwebview.Tpo -c -o Source/WebKit/gtk/tests/Programs_unittests_testwebview-testwebview.o `test -f 'Source/WebKit/gtk/tests/testwebview.c' || echo './'`Source/WebKit/gtk/tests/testwebview.c
[...]
Source/WebKit/gtk/tests/testwebview.c: In function ‘test_webkit_web_view_does_not_steal_focus’:
Source/WebKit/gtk/tests/testwebview.c:392:5: warning: implicit declaration of function ‘gtk_box_new’ [-Wimplicit-function-declaration]
Source/WebKit/gtk/tests/testwebview.c:392:22: warning: initialization makes pointer from integer without a cast [enabled by default]
[...]
Source/WebKit/gtk/tests/Programs_unittests_testwebview-testwebview.o: In function `test_webkit_web_view_does_not_steal_focus':
testwebview.c:(.text+0x4f): undefined reference to `gtk_box_new'
collect2: ld returned 1 exit status
make: *** [Programs/unittests/testwebview] Error 1

Complete build log with "make V=1 -j5" is attached.
Comment 3 Martin Robinson 2012-02-27 21:52:23 PST
(In reply to comment #2)
> Created an attachment (id=129178) [details]
> complete build log
> 
> (In reply to comment #1)
> > This should be guarded by the GTK_API_VERSION2 define. This seems to be working properly for me. Can you build with "make V=1" and confirm that the macro is passed properly to the compiler?
> 
> The test fails to find gtk_box_new even though -DGTK_API_VERSION_2=1 is passed to the compiler:

This is quite odd, because those lines of code are:

#ifdef GTK_API_VERSION_2
    GtkWidget *box = gtk_hbox_new(FALSE, 0);
#else
    GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
#endif

I also double-checked the GTK+ 2.x compilation locally. It seemed to be compiling fine.
Comment 4 Alexandre Rostovtsev 2012-02-27 22:18:03 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=129178) [details] [details]
> > complete build log
> > 
> > (In reply to comment #1)
> > > This should be guarded by the GTK_API_VERSION2 define. This seems to be working properly for me. Can you build with "make V=1" and confirm that the macro is passed properly to the compiler?
> > 
> > The test fails to find gtk_box_new even though -DGTK_API_VERSION_2=1 is passed to the compiler:
> 
> This is quite odd, because those lines of code are:
> 
> #ifdef GTK_API_VERSION_2
>     GtkWidget *box = gtk_hbox_new(FALSE, 0);
> #else
>     GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
> #endif
> 
> I also double-checked the GTK+ 2.x compilation locally. It seemed to be compiling fine.

That's because that #ifdef was added only a few hours ago in svn by kov@webkit.org, see http://trac.webkit.org/changeset/108996/trunk/Source/WebKit/gtk/tests/testwebview.c

"compiling fine from svn trunk" != "compiling fine from webkitgtk.org tarball" ;)
Comment 5 Martin Robinson 2012-02-28 00:16:00 PST
(In reply to comment #4)

> That's because that #ifdef was added only a few hours ago in svn by kov@webkit.org, see http://trac.webkit.org/changeset/108996/trunk/Source/WebKit/gtk/tests/testwebview.c
> 
> "compiling fine from svn trunk" != "compiling fine from webkitgtk.org tarball" ;)

WebKit is a big project with a lot of commits, so it's easy to miss fixes like that. I really appreciate you bringing this to my attention though. Rest assured this fix will be in 1.7.91.

https://trac.webkit.org/wiki/WebKitGTK/1.8.x