Open Bug 1740035 Opened 3 years ago Updated 3 years ago

Various bustages in UnifiedBindings when adjusting the value of files_per_unified_file

Categories

(Core :: DOM: Bindings (WebIDL), defect)

defect

Tracking

()

People

(Reporter: RyanVM, Unassigned)

References

Details

As was recently seen in bug 1739677 and bug 1700463 before that, UnifiedBindings and UnifiedProtocols are prone to random bustage due to changes which affect which source files are included in each Unified CPP file.

I ran some Try pushes with different values set in https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/frontend/data.py#325 to find more lurking issues:

files_per_unified_file=1
https://treeherder.mozilla.org/logviewer?job_id=357233095&repo=try&lineNumber=35700

 INFO -  In file included from UnifiedBindings150.cpp:2:
 INFO -  In file included from /builds/worker/workspace/obj-build/dom/bindings/DocumentTimelineBinding.cpp:4:
 INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/dom/AnimationTimelineBinding.h:6:
 INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/js/CallAndConstruct.h:15:
 INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/js/RootingAPI.h:13:
 INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/LinkedList.h:73:
ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:50:38: error: member access into incomplete type 'mozilla::dom::Animation'
 INFO -    static void Release(U* aPtr) { aPtr->Release(); }
 INFO -                                       ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:381:62: note: in instantiation of member function 'mozilla::RefPtrTraits<mozilla::dom::Animation>::Release' requested here
 INFO -      static void Release(U* aPtr) { mozilla::RefPtrTraits<U>::Release(aPtr); }
 INFO -                                                               ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:81:37: note: in instantiation of member function 'RefPtr<mozilla::dom::Animation>::ConstRemovingRefPtrTraits<mozilla::dom::Animation>::Release' requested here
 INFO -        ConstRemovingRefPtrTraits<T>::Release(mRawPtr);
 INFO -                                      ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsHashKeys.h:354:3: note: in instantiation of member function 'RefPtr<mozilla::dom::Animation>::~RefPtr' requested here
 INFO -    ~nsRefPtrHashKey() = default;
 INFO -    ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsTHashtable.h:679:13: note: in instantiation of member function 'nsTHashtable<nsRefPtrHashKey<mozilla::dom::Animation>>::s_CopyEntry' requested here
 INFO -            : s_CopyEntry,
 INFO -              ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsTHashtable.h:239:16: note: in instantiation of member function 'nsTHashtable<nsRefPtrHashKey<mozilla::dom::Animation>>::Ops' requested here
 INFO -        : mTable(Ops(), sizeof(EntryType), PLDHashTable::kDefaultInitialLength) {}
 INFO -                 ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsHashtablesFwd.h:88:7: note: in instantiation of member function 'nsTHashtable<nsRefPtrHashKey<mozilla::dom::Animation>>::nsTHashtable' requested here
 INFO -  class nsTBaseHashSet;
 INFO -        ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/DocumentOrShadowRoot.h:34:7: note: forward declaration of 'mozilla::dom::Animation'
 INFO -  class Animation;
 INFO -        ^
 INFO -  1 error generated.
ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:662: UnifiedBindings150.o] Error 1

files_per_unified_file=2
https://treeherder.mozilla.org/logviewer?job_id=357233123&repo=try&lineNumber=34131

 INFO -  In file included from UnifiedBindings114.cpp:2:
 INFO -  In file included from /builds/worker/workspace/obj-build/dom/bindings/GleanPingsBinding.cpp:18:
ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:1536:28: error: no matching function for call to 'ToSupports'
 INFO -      xpcObjectHelper helper(ToSupports(p), cache);
 INFO -                             ^~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:1586:11: note: in instantiation of function template specialization 'mozilla::dom::WrapNativeISupports<mozilla::dom::Element>' requested here
 INFO -      obj = WrapNativeISupports(cx, parent, cache);
 INFO -            ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:1602:40: note: in instantiation of member function 'mozilla::dom::WrapNativeHelper<mozilla::dom::Element, false>::Wrap' requested here
 INFO -    JSObject* obj = WrapNativeHelper<T>::Wrap(cx, p, cache);
 INFO -                                         ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:1643:10: note: in instantiation of function template specialization 'mozilla::dom::FindAssociatedGlobal<mozilla::dom::Element>' requested here
 INFO -    return FindAssociatedGlobal(cx, GetParentPointer(p), GetWrapperCache(p),
 INFO -           ^
 INFO -  /builds/worker/workspace/obj-build/dom/bindings/GridBinding.cpp:469:37: note: in instantiation of function template specialization 'mozilla::dom::FindAssociatedGlobal<mozilla::dom::Element *>' requested here
 INFO -    JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
 INFO -                                      ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsISupportsImpl.h:38:21: note: candidate function not viable: cannot convert argument of incomplete type 'mozilla::dom::Element *' to 'decltype(nullptr)' (aka 'nullptr_t') for 1st argument
 INFO -  inline nsISupports* ToSupports(decltype(nullptr)) { return nullptr; }
 INFO -                      ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsISupportsImpl.h:40:21: note: candidate function not viable: cannot convert argument of incomplete type 'mozilla::dom::Element *' to 'nsISupports *' for 1st argument
 INFO -  inline nsISupports* ToSupports(nsISupports* aSupports) { return aSupports; }
 INFO -                      ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsCycleCollectionNoteChild.h:43:14: note: candidate template ignored: substitution failure [with T = mozilla::dom::Element]: incomplete type 'mozilla::dom::Element' named in nested name specifier
 INFO -  nsISupports* ToSupports(
 INFO -               ^
 INFO -  1 error generated.
ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:662: UnifiedBindings114.o] Error 1

files_per_unified_file=4
https://treeherder.mozilla.org/logviewer?job_id=357233149&repo=try&lineNumber=10501

 INFO -  In file included from UnifiedBindings109.cpp:2:
ERROR -  /builds/worker/workspace/obj-build/dom/bindings/NodeListBinding.cpp:53:15: error: no matching function for call to 'StrongOrRawPtr'
 INFO -    auto result(StrongOrRawPtr<nsINode>(MOZ_KnownLive(self)->Item(arg0)));
 INFO -                ^~~~~~~~~~~~~~~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:3056:19: note: candidate function template not viable: cannot convert argument of incomplete type 'nsIContent *' to 'nsINode *' for 1st argument
 INFO -  inline ReturnType StrongOrRawPtr(T* aPtr) {
 INFO -                    ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:3045:18: note: candidate template ignored: could not match 'already_AddRefed<type-parameter-0-1>' against 'nsIContent *'
 INFO -  inline RefPtr<T> StrongOrRawPtr(already_AddRefed<S>&& aPtr) {
 INFO -                   ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:3050:18: note: candidate template ignored: could not match 'RefPtr<type-parameter-0-1>' against 'nsIContent *'
 INFO -  inline RefPtr<T> StrongOrRawPtr(RefPtr<S>&& aPtr) {
 INFO -                   ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BindingUtils.h:3061:13: note: candidate template ignored: could not match '<type-parameter-0-2>' against 'nsIContent *'
 INFO -  inline void StrongOrRawPtr(SmartPtr<S>&& aPtr) = delete;
 INFO -              ^
 INFO -  /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SafeRefPtr.h:425:18: note: candidate template ignored: could not match 'SafeRefPtr<type-parameter-0-1>' against 'nsIContent *'
 INFO -  inline RefPtr<T> StrongOrRawPtr(SafeRefPtr<S>&& aPtr) {

files_per_unified_file=8
https://treeherder.mozilla.org/logviewer?job_id=357233405&repo=try&lineNumber=11032

 INFO -  In file included from UnifiedBindings21.cpp:15:
 INFO -  In file included from /builds/worker/workspace/obj-build/dom/bindings/ExtensionMockAPIBinding.cpp:22:
 INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/extensions/ExtensionMockAPI.h:19:
ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/extensions/ExtensionBrowser.h:48:31: error: use of undeclared identifier 'WeakPtr'
 INFO -    nsTHashMap<nsStringHashKey, WeakPtr<ExtensionPort>> mPortsLookup;
 INFO -                                ^
ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/extensions/ExtensionBrowser.h:92:3: error: static_cast from 'mozilla::extensions::ExtensionBrowser *' to 'nsISupports *', which are not related by inheritance, is not allowed
 INFO -    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionBrowser)
 INFO -    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsCycleCollectionParticipant.h:805:3: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS'
 INFO -    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _class)
 INFO -    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsCycleCollectionParticipant.h:747:5: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS'
 INFO -      NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                        \
 INFO -      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsCycleCollectionParticipant.h:668:12: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_CLASS_BODY'
 INFO -      return NS_ISUPPORTS_CAST(_base*, p);                                       \
 INFO -             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 INFO -  /builds/worker/workspace/obj-build/dist/include/nsISupportsUtils.h:115:3: note: expanded from macro 'NS_ISUPPORTS_CAST'
 INFO -    static_cast<nsISupports*>(static_cast<__unambiguousBase>(__expr))
 INFO -    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 INFO -  In file included from UnifiedBindings21.cpp:15:
 INFO -  In file included from /builds/worker/workspace/obj-build/dom/bindings/ExtensionMockAPIBinding.cpp:23:
ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/extensions/ExtensionPort.h:32:36: error: expected class name
 INFO -                              public SupportsWeakPtr,
 INFO -                                     ^
 INFO -  3 errors generated.
ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:661: UnifiedBindings21.o] Error 1

There may be others lurking behind those once fixed as well, but those are all which turned up in the first go-around.

Hi Edgar, can you assess and suggest the severity? Thanks.

Flags: needinfo?(echen)
Severity: -- → S3
Flags: needinfo?(echen)
You need to log in before you can comment on or make changes to this bug.