Closed Bug 1721707 Opened 3 years ago Closed 3 years ago

compile error in current nightly with error: invalid use of incomplete type 'class DataOffer'

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 92
x86_64
All
defect

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox90 --- unaffected
firefox91 --- unaffected
firefox92 --- fixed

People

(Reporter: herrtimson, Assigned: petr.sumbera)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

Attached file build.log.gz (deleted) —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

I downloaded the latest source code from nighlty branch and compiled it, on linux-amd64.

Actual results:

I got this error:

24:59.75 In file included from /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/nsISupportsUtils.h:17,
24:59.75 from /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/nsISupports.h:82,
24:59.75 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/CompositorWidget.h:8,
24:59.75 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.h:14,
24:59.76 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:8:
24:59.76 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h: In instantiation of 'static void mozilla::RefPtrTraits<U>::AddRef(U*) [with U = DataOffer]':
24:59.76 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:380:67: required from 'static void RefPtr<T>::ConstRemovingRefPtrTraits<U>::AddRef(U*) [with U = DataOffer; T = DataOffer]'
24:59.77 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:97:43: required from 'RefPtr<T>::RefPtr(const RefPtr<T>&) [with T = DataOffer]'
24:59.77 /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:7916:67: required from here
24:59.77 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:49:39: error: invalid use of incomplete type 'class DataOffer'
24:59.77 49 | static void AddRef(U* aPtr) { aPtr->AddRef(); }
24:59.77 | ^
24:59.77 In file included from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:66:
24:59.77 /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsDragService.h:17:7: note: forward declaration of 'class DataOffer'
24:59.77 17 | class DataOffer;
24:59.78 | ^~~~~~~~~
24:59.78 In file included from /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/nsISupportsUtils.h:17,
24:59.78 from /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/nsISupports.h:82,
24:59.78 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/CompositorWidget.h:8,
24:59.78 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.h:14,
24:59.78 from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:8:
24:59.79 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h: In instantiation of 'static void mozilla::RefPtrTraits<U>::Release(U*) [with U = DataOffer]':
24:59.79 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:381:69: required from 'static void RefPtr<T>::ConstRemovingRefPtrTraits<U>::Release(U*) [with U = DataOffer; T = DataOffer]'
24:59.79 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:81:44: required from 'RefPtr<T>::RefPtr() [with T = DataOffer]'
24:59.79 /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:7916:67: required from here
24:59.80 /var/tmp/portage/www-client/firefox-92.0/work/firefox_build/dist/include/mozilla/RefPtr.h:50:40: error: invalid use of incomplete type 'class DataOffer'
24:59.80 50 | static void Release(U* aPtr) { aPtr->Release(); }
24:59.80 | ^
24:59.80 In file included from /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsWindow.cpp:66:
24:59.80 /var/tmp/portage/www-client/firefox-92.0/work/firefox-92.0/widget/gtk/nsDragService.h:17:7: note: forward declaration of 'class DataOffer'
24:59.80 17 | class DataOffer;
24:59.80 | ^

Expected results:

I expect the compile to succed. The compressed build log is attached.

I'm uncertain where this may have been introduced, but widgets/gtk/ is activly developed at the moment! :)

Attached file clang-12-build.log.gz (deleted) —

tried again with clang-12.0.1, same error I believe. But maybe it has better error message?

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: wayland
Keywords: regression
OS: Unspecified → Linux
Regressed by: 1717476
Hardware: Unspecified → x86_64
OS: Linux → All

I suppose these are X11 only builds (no Wayland)?

that is true for me at least, I'm using --enable-default-toolkit=cairo-gtk3

There is more X11-only bustage:

In file included from Unified_cpp_widget_gtk0.cpp:83:
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:234:16: error: use of undeclared identifier 'WL_OUTPUT_MODE_CURRENT'
  if ((flags & WL_OUTPUT_MODE_CURRENT) == 0) return;
               ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:240:40: error: variable has incomplete type 'const struct wl_output_listener'
static const struct wl_output_listener output_listener = {
                                       ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:240:21: note: forward declaration of 'mozilla::widget::wl_output_listener'
static const struct wl_output_listener output_listener = {
                    ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:247:49: error: unknown type name 'wl_registry'
static void screen_registry_handler(void* data, wl_registry* registry,
                                                ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:253:55: error: use of undeclared identifier 'wl_output_interface'
        WaylandRegistryBind<wl_output>(registry, id, &wl_output_interface, 2);
                                                      ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:268:42: error: variable has incomplete type 'const struct wl_registry_listener'
static const struct wl_registry_listener screen_registry_listener = {
                                         ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:268:21: note: forward declaration of 'mozilla::widget::wl_registry_listener'
static const struct wl_registry_listener screen_registry_listener = {
                    ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:273:3: error: unknown type name 'wl_display'
  wl_display* display = WaylandDisplayGetWLDisplay();
  ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:273:25: error: use of undeclared identifier 'WaylandDisplayGetWLDisplay'
  wl_display* display = WaylandDisplayGetWLDisplay();
                        ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:299:31: error: unknown type name 'wl_registry_destroy'; did you mean 'wl_registry_listener'?
  g_clear_pointer(&mRegistry, wl_registry_destroy);
                              ^~~~~~~~~~~~~~~~~~~
                              wl_registry_listener
/home/glandium/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/glib-2.0/glib/gmem.h:118:49: note: expanded from macro 'g_clear_pointer'
    GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \
                                                ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:268:21: note: 'wl_registry_listener' declared here
static const struct wl_registry_listener screen_registry_listener = {
                    ^
/tmp/central/widget/gtk/ScreenHelperGTK.cpp:299:3: error: expected expression
  g_clear_pointer(&mRegistry, wl_registry_destroy);
  ^
/home/glandium/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/glib-2.0/glib/gmem.h:118:57: note: expanded from macro 'g_clear_pointer'
    GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \
                                                        ^
9 errors generated.
Regressed by: 1718507
Has Regression Range: --- → yes

If you want to fool around with a X11-only gtk build on try, use the following patch:
https://hg.mozilla.org/try/rev/35650b3991fc07561946bfd6a79dac8f86c0597d

so does that mean --enable-default-toolkit=cairo-gtk3 is outlawed now?

(In reply to tt_1 from comment #8)

so does that mean --enable-default-toolkit=cairo-gtk3 is outlawed now?

dont think so, it's just that mozilla automation doesnt test anymore X11-only builds, and those failures are prone to reappear here and there during wayland work.

Guys, do you mind to attach a patch for it?
Thanks.

Priority: -- → P3

ScreenHelperGTK.cpp is trivially fixable, the DataOffer part not so much...

(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)

Guys, do you mind to attach a patch for it?
Thanks.

what happened to 'you break it, you fix it' ? :D unless wayland-enabled builds are mandatory now ofc ...

(In reply to Landry Breuil (:gaston) from comment #12)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)

Guys, do you mind to attach a patch for it?
Thanks.

what happened to 'you break it, you fix it' ? :D unless wayland-enabled builds are mandatory now ofc ...

Sure, it's on my queue.

Attached file Bug 1721707 - allow X11 build again (obsolete) (deleted) —

This is probably just temporary fix to allow X11 build again. Instead of
ifdeds some better abstraction might be needed. Hope that Martin can
find better way.

Assignee: nobody → petr.sumbera

Thanks for the patch Petr, I tried a different approach.

Comment on attachment 9234120 [details]
Bug 1721707 [Wayland] Build fix for X11 only environment r?PetrSumbera

m-c built fine for me with this patch on OpenBSD, thanks !

Attachment #9234120 - Flags: feedback+
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/fa29a9038d42 [Wayland] Build fix for X11 only environment r=emilio

Should we finally add a X11-only CI build? :) (and in the future a Wayland-only one, too?)

Attachment #9233980 - Attachment is obsolete: true
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch

(In reply to Robert Mader [:rmader] from comment #20)

Should we finally add a X11-only CI build? :) (and in the future a Wayland-only one, too?)

if its possible and helps not to run into this kind of problem again, yes absolutly please.

(In reply to Robert Mader [:rmader] from comment #20)

Should we finally add a X11-only CI build? :) (and in the future a Wayland-only one, too?)

Filed bug 1723869.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: