Closed Bug 1730774 Opened 5 years ago Closed 5 years ago

Fix non-unified-build bustage in layout/generic

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox93 --- wontfix
firefox94 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file, 3 external files)

(This is the same as Bug 1730741, but for layout/generic.)

We now have this mozconfig option to disable unification:

ac_add_options --disable-unified-build

layout/generic 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 from that.

The first build error that I'm fixing here is a bunch of variants of this which are fixed by a one-line change:

In file included from $SRC/layout/generic/ReflowOutput.cpp:9:
In file included from $OBJ/dist/include/mozilla/ReflowOutput.h:12:
$OBJ/dist/include/mozilla/EnumeratedRange.h:194:3: error: use of undeclared identifier 'MOZ_ASSERT'
  MOZ_ASSERT(end != std::numeric_limits<EnumUnderlyingType>::max(),
  ^
$OBJ/dist/include/mozilla/gfx/Types.h:860:19: note: in instantiation of
function template specialization 'mozilla::MakeInclusiveEnumeratedRange<mozilla::Side>' requested here
  return mozilla::MakeInclusiveEnumeratedRange(eSideTop, eSideLeft);
                  ^

(There are many more copies of this build error for other files/usages.)

This is just an indication that mfbt/EnumeratedRange.h needs to include Assertions.h, so that it's not imposing that non-obvious requirement on all of the files that use it.

Attachment #9241233 - Attachment description: build errors being fixed here → build errors being fixed in part 2 here

Without this patch, these MOZ_ASSERT statements cause build errors, if I build
the layout/generic directory in non-unified mode.

(Instead of this patch, we could also hypothetically sprinkle individual
#includes for Assertions.h around to all the downstream files; but it's simpler
and more direct to just put it here in the file that contains the MOZ_ASSERT
statements in question. Note that many other MFBT headers also have includes
for Assertions.h, so it seems reasonable to include it here as well.)

After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here. This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Depends on D125610

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/23bc48417fa1 part 1: Give EnumeratedRange.h an include for Assertions.h, since it includes MOZ_ASSERT statements. r=TYLin
No longer depends on: 1730741
See Also: → 1730741
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/007ff7f371c9 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic, and remove REQUIRES_UNIFIED_BUILD declaration. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

Looks like there are some linking errors in the non-unified configuration, which I didn't run into locally, for some reason.

I'll take a look later on today.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

The linking errors are:

 ld.lld: error: undefined hidden symbol: mozilla::dom::Document::GetBodyElement()
 >>> referenced by nsIFrame.cpp:630 (/builds/worker/checkouts/gecko/layout/generic/nsIFrame.cpp:630)
 >>>               /builds/worker/workspace/obj-build/toolkit/library/gtest/../../../layout/generic/nsIFrame.o:(nsIFrame::IsPrimaryFrameOfRootOrBodyElement() const)


 ld.lld: error: undefined hidden symbol: nsIFrame::IsFlexItem() const
 >>> referenced by nsImageFrame.cpp:244 (/builds/worker/checkouts/gecko/layout/generic/nsImageFrame.cpp:244)
 >>>               /builds/worker/workspace/obj-build/toolkit/library/gtest/../../../layout/generic/nsImageFrame.o:(nsImageFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&))
Attachment #9241235 - Attachment description: Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic, and remove REQUIRES_UNIFIED_BUILD declaration. r?#layout-reviewers → Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic. r?TYLin

I'm relanding part 2 without the moz.build tweak right now, and I'll bundle that tweak into the fix for the linker issue, in a later patch here.

Flags: needinfo?(dholbert)
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09e8594d0601 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic. r=TYLin

(I suspect those linker issues are indications that we need to include DocumentInlines.h and nsIFrameInlines.h, respectively. That's where the inline functions in question are defined.)

Try with hopefully-complete 'part 3' (which I'll submit to phabricator if it passes): https://treeherder.mozilla.org/jobs?repo=try&revision=b6e7aa4e84cebc23c0853d4ad41f13ec89c2d624

After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here. This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/543941d75bf9 part 3: Add includes for Inlines headers, to fix non-unified-build linking issues in layout/generic (and remove REQUIRES_UNIFIED_BUILD decl). r=TYLin
See Also: → 1731371
Status: REOPENED → RESOLVED
Closed: 5 years ago → 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: