Closed Bug 1757347 Opened 4 years ago Closed 4 years ago

Build failure due to namespace confusion in FOGIPC.cpp

Categories

(Core :: Audio/Video: GMP, defect, P1)

defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: bryce, Assigned: bryce)

References

Details

Attachments

(1 file)

Not 100% sure why I'm running into this now. I've done builds since bug 1745511 landed, so I think this may be a unified build issue triggered by some WIP I have.

I get the following build failure with my current patches when building on Windows 10:

 0:09.88     Blocking waiting for file lock on package cache
 0:11.73 In file included from Unified_cpp_components_glean1.cpp:47:
 0:11.73 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(225,17): error: no member named 'GeckoMediaPluginServiceParent' in namespace 'mozilla::glean::gmp'
 0:11.73     RefPtr<gmp::GeckoMediaPluginServiceParent> gmps(
 0:11.73            ~~~~~^
 0:11.73 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(226,14): error: no member named 'GeckoMediaPluginServiceParent' in namespace 'mozilla::glean::gmp'
 0:11.73         gmp::GeckoMediaPluginServiceParent::GetSingleton());
 0:11.73         ~~~~~^
 0:11.73 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(225,52): error: parentheses were disambiguated as a function declaration [-Werror,-Wvexing-parse]
 0:11.73     RefPtr<gmp::GeckoMediaPluginServiceParent> gmps(
 0:11.73                                                    ^
 0:11.74 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(226,9): note: add a pair of parentheses to declare a variable
 0:11.74         gmp::GeckoMediaPluginServiceParent::GetSingleton());
 0:11.74         ^
 0:11.74         (
 0:11.81 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(289,7): error: no member named 'SendFOGData' in namespace 'mozilla::glean::gmp'; did you mean simply 'SendFOGData'?
 0:11.81       gmp::SendFOGData(std::move(buf));
 0:11.81       ^~~~~~~~~~~~~~~~
 0:11.81       SendFOGData
 0:11.81 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(283,6): note: 'SendFOGData' declared here
 0:11.81 void SendFOGData(ipc::ByteBuf&& buf) {
 0:11.81      ^
 0:11.95 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(336,19): error: no member named 'GeckoMediaPluginServiceParent' in namespace 'mozilla::glean::gmp'
 0:11.95       RefPtr<gmp::GeckoMediaPluginServiceParent> gmps(
 0:11.95              ~~~~~^
 0:11.95 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(337,16): error: no member named 'GeckoMediaPluginServiceParent' in namespace 'mozilla::glean::gmp'
 0:11.95           gmp::GeckoMediaPluginServiceParent::GetSingleton());
 0:11.95           ~~~~~^
 0:11.95 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(336,54): error: parentheses were disambiguated as a function declaration [-Werror,-Wvexing-parse]
 0:11.95       RefPtr<gmp::GeckoMediaPluginServiceParent> gmps(
 0:11.95                                                      ^
 0:11.95 c:/projects/mozilla/mozilla-unified/toolkit/components/glean/ipc/FOGIPC.cpp(337,11): note: add a pair of parentheses to declare a variable
 0:11.95           gmp::GeckoMediaPluginServiceParent::GetSingleton());
 0:11.95           ^
 0:11.95           (

Looks like the mozilla namespace is not being found. I suspect this is because the using namespace mozilla within the file is bounded within a block earlier, so is not working here. If this is a unified build issue, builds may be benefiting from a unified build bringing the mozilla namespace in from some other source.

I'll further qualify these uses in a patch to get my build happy and avoid future issue.

This avoids a build issue, seemingly unified build related, where the now
qualified symbols are not found.

Taking another look, I'm not sure this should even be happening given namespace lookup rules. I'm not clear there should be an ambiguity problem here. My understanding is search for gmp::symbol should work within the mozilla namespace once the mozilla::glean::gmp failure happens. Removing the regressing bug and going to gaze at this a bit harder.

No longer regressed by: 1745511

Okay, this is fun. This not triggered by unified build issues, and is instead triggered by my WIP on bug 1739664.

The problem is that I'm introducing glean telemetry using gmp to group the telemetry. This results in the GleanMetrics.h file having a generated gmp namespace which exists at mozilla::glean::gmp. With that now part of the build, the lines mentioned in comment 0 fail because the mozilla::glean::gmp is selected earlier than mozilla::gmp, and that name space does not contain the symbols being used.

So I think the patch here makes sense, but the cause of the issue here is me footgunning myself, rather than anything like bug 1745511.

Severity: S2 → S3
Pushed by bvandyk@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cc587b2497a4 Further qualify mozilla::gmp namespace usage. r=florian
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: