Closed Bug 1730741 Opened 3 years ago Closed 3 years ago

Fix non-unified-build bustage in layout/base

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

(Formerly: bug 1652788, bug 1544897, bug 1541150, etc)

We now have this mozconfig option to disable unification:

ac_add_options --disable-unified-build

layout/base is currently exempt from respecting this build flag, via its moz.build REQUIRES_UNIFIED_BUILD = True declaration.

I'm filing this bug on removing that declaration and fixing the build bustage that results.

For reference, here are the actual build errors that I'm fixing here (from an enable-debug disable-optimize disable-unified-build mozconfig). I've edited the output for brevity (and combined it from several consecutive ./mach build runs).

In file included from $SRC/layout/base/StaticPresData.cpp:7:
In file included from $OBJ/dist/include/mozilla/StaticPresData.h:13:
In file included from $OBJ/dist/include/nsFont.h:12:
In file included from $OBJ/dist/include/gfxFontVariations.h:12:
$OBJ/dist/include/nsTArray.h:2400:34: error: arithmetic on a pointer to an incomplete type 'nsTArray_Impl<gfxFontFeature, nsTArrayInfallibleAllocator>::elem_type' (aka 'gfxFontFeature')
[...]
$OBJ/dist/include/mozilla/ServoStyleConstsForwards.h:51:8: note: forward declaration of 'gfxFontFeature'
 
$SRC/layout/base/MotionPathUtils.cpp:349:22: error: use of undeclared identifier 'nsLayoutUtils'
    nsRect boxRect = nsLayoutUtils::ComputeGeometryBox(
                     ^

In file included from $SRC/layout/base/nsFrameTraversal.cpp:7:
In file included from $SRC/layout/base/nsFrameTraversal.h:11:
$SRC/layout/base/nsIFrameTraversal.h:76:32: error: unknown type name 'nsPresContext'
                               nsPresContext* aPresContext, nsIFrame* aStart,
                               ^

$SRC/layout/base/nsFrameTraversal.cpp:166:19: error: out-of-line definition of 'NewFrameTraversal' does not match any declaration in 'nsFrameTraversal'
nsFrameTraversal::NewFrameTraversal(nsIFrameEnumerator** aEnumerator,
                  ^~~~~~~~~~~~~~~~~
NOTE: This is really about nsPresContext being undeclared, which messes up
the function declaration because one of its params has type nsPresContext*.)
 
$SRC/layout/base/nsCounterManager.cpp:30:15: error: member access into incomplete type 'nsIFrame'
 
$SRC/layout/base/nsQuoteList.cpp:32:15: error: member access into incomplete type 'nsIFrame'

$SRC/layout/base/nsGenConList.cpp:15:43: error: member access into incomplete type 'nsIFrame'

$SRC/layout/base/ZoomConstraintsClient.cpp:263:11: error: member access into incomplete type 'nsIScrollableFrame'

In file included from $SRC/layout/base/GeckoMVMContext.cpp:7:
In file included from $OBJ/dist/include/mozilla/DisplayPortUtils.h:11:
In file included from $SRC/layout/painting/nsDisplayList.h:47:
In file included from $SRC/layout/painting/nsCSSRenderingBorders.h:18:
In file included from $SRC/layout/generic/nsIFrame.h:71:
$SRC/layout/generic/nsQueryFrame.h:102:43: error: incomplete type 'nsIScrollableFrame' named in nested name specifier
                                 typename Dest::Has_NS_DECL_QUERYFRAME_TARGET>,
                                          ^~~~~~

In file included from $SRC/layout/base/DisplayPortUtils.cpp:7:
In file included from $SRC/layout/base/DisplayPortUtils.h:11:
In file included from $SRC/layout/painting/nsDisplayList.h:40:
In file included from $OBJ/dist/include/mozilla/dom/RemoteBrowser.h:10:
In file included from $OBJ/dist/include/mozilla/dom/ipc/IdType.h:10:
In file included from $OBJ/dist/include/ipc/IPCMessageUtils.h:15:
$SRC/ipc/chromium/src/chrome/common/ipc_message_utils.h:125:26: error: no member named 'Read' in 'IPC::ParamTraits<mozilla::layers::RepaintRequest>'
  return ParamTraits<P>::Read(m, iter, p);
         ~~~~~~~~~~~~~~~~^
$SRC/layout/base/DisplayPortUtils.cpp:1185:23: note: in instantiation of function template specialization 'IPC::ReadParam<mozilla::layers::RepaintRequest>' requested here
            if (!IPC::ReadParam(&aMsg, &iter, &request)) {
                      ^

One more build error that only shows up at link time (which I'll address in a dedicated "part 1" patch here):

ld.lld: error: undefined hidden symbol: sApzMvmLog
>>> referenced by PresShell.cpp:10992 ($SRC/layout/base/PresShell.cpp:10992)
>>>               $OBJ/toolkit/library/build/../../../layout/base/PresShell.o:(mozilla::PresShell::MaybeRecreateMobileViewportManager(bool))
>>> referenced by PresShell.cpp:10994 ($SRC/layout/base/PresShell.cpp:10994)
>>>               $OBJ/toolkit/library/build/../../../layout/base/PresShell.o:(mozilla::PresShell::MaybeRecreateMobileViewportManager(bool))
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

Before this patch, PresShell.cpp tries to reuse a LazyLogModule that's defined
in MobileViewportManager.cpp, which isn't actually declared in any header.

This patch promotes this LazyLogModule to be an actual static member-var on the
MobileViewportManager class, so that it can be exported and used externally in
a more structured way. This makes it consistent with the very-similar
"PresShell::gLog" member-variable.

At this point in the patch series, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, because this directory now builds successfully with
ac_add_options --disable-unified-build
in the mozconfig.

Depends on D125600

Blocks: 1730774
No longer blocks: 1730774
See Also: → 1730774

Try run including this bug's patches (which is green on the "hybrid" non-unified-build configuration):
https://treeherder.mozilla.org/jobs?repo=try&revision=b6e7aa4e84cebc23c0853d4ad41f13ec89c2d624

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9c9c031bf2d5
part 1: Export MobileViewportManager's LazyLogModule in a more structured way. r=botond
https://hg.mozilla.org/integration/autoland/rev/ea1a11e3f0bc
part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/base, and remove REQUIRES_UNIFIED_BUILD declaration. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: