Closed Bug 1712811 Opened 3 years ago Closed 3 years ago

QuotaCommon.h:1324:62: error: invalid use of incomplete type

Categories

(Core :: Storage: Quota Manager, defect, P2)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- unaffected
firefox89 --- unaffected
firefox90 --- fixed

People

(Reporter: petr.sumbera, Assigned: janv)

References

(Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

Solaris builds fails with:

 6:44.09 /builds/psumbera/mozilla-central-build/dom/indexedDB/test/gtest/TestFileInfo.cpp:185:30:   required from here
 6:44.09 /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla/dom/quota/QuotaCommon.h:1324:62: error: invalid use of incomplete type 'using ResultType = class mozilla::Variant<mozilla::QMResult, nsresult, mozilla::Nothing>' {aka 'class mozilla::Variant<mozilla::QMResult, nsresult, mozilla::Nothing>'}
 6:44.09  1324 |     mozilla::dom::quota::LogError(nsDependentCString(aExpr), ResultType(aRv),
 6:44.09       |                                                              ^~~~~~~~~~~~~~~

The first bad revision is:
changeset: 580568:08b0dccfddf7
user: Masayuki Nakano <masayuki@d-toybox.com>
date: Tue May 25 06:46:18 2021 +0000
description:
Bug 1540037 - part 20: Move UndoAsAction() and RedoAsAction() from TextEditor to EditorBase r=m_kato

Keywords: regression
Regressed by: 1540037

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

Component: Untriaged → Storage: IndexedDB
Product: Firefox → Core

Probably the next child revision looks more related.

Component: Storage: IndexedDB → Storage: Quota Manager
Flags: needinfo?(jvarga)
Regressed by: 1709352
No longer regressed by: 1540037
Has Regression Range: --- → yes

The main thing going on here is that a mozilla/Variant.h include is missing in QuotaCommon.h. But it's only needed when QM_ERROR_STACKS_ENABLED is defined. Which it is only when if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG) as per the definition in QMResult.h. But then there are many blocks doing

#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
...
#  ifdef QM_ERROR_STACKS_ENABLED
...
#  else
...
#  endif
...
#endif

where the else part is never going to be used, which also means Maybe.h is never used.

Thanks, Jan already spotted this, too. Patch is on the way on the regressing bug.

Petr, you have beaten me again :-)

(In reply to Mike Hommey [:glandium] from comment #3)

where the else part is never going to be used, which also means Maybe.h is never used.

Maybe.h is also needed for ToMaybeRef in QuotaCommon.h

I submitted a patch to add the missing include.

Flags: needinfo?(jvarga)
Assignee: nobody → jvarga
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Jan, FYI your patch(es) hasn't fixed the issue for me (Fedora 32 on ppc64le).

(In reply to Dan Horák from comment #7)

Jan, FYI your patch(es) hasn't fixed the issue for me (Fedora 32 on ppc64le).

It worked for me with following addition (as MIke suggested above):

--- a/dom/quota/QuotaCommon.h   Wed May 12 01:05:20 2021 -0700
+++ b/dom/quota/QuotaCommon.h   Thu May 27 08:13:38 2021 +0000
@@ -22,6 +22,7 @@
 #include "mozilla/Maybe.h"
 #include "mozilla/Result.h"
 #include "mozilla/ResultExtensions.h"
+#include "mozilla/Variant.h"
 #include "mozilla/ThreadLocal.h"
 #include "mozilla/dom/QMResult.h"
 #include "mozilla/ipc/ProtocolUtils.h"

Yup, that fixes the issue. The conditional include from https://phabricator.services.mozilla.com/D116121 doesn't seem to be right.

Flags: needinfo?(jvarga)

I know what's wrong. QMResult.h must be included before that.

(In reply to Jan Varga [:janv] from comment #10)

I know what's wrong. QMResult.h must be included before that.

I updated the patch in Phab, can someone re-test it ?
Thanks.

Flags: needinfo?(jvarga)

(In reply to Jan Varga [:janv] from comment #11)

I updated the patch in Phab, can someone re-test it ?

Works for me.

Severity: -- → S3
Priority: -- → P2

A fix for this landed in the original bug 1709352.
Exact patch: https://phabricator.services.mozilla.com/D116121

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.