Closed Bug 1218160 Opened 6 years ago Closed 6 years ago

BasicLayers.h: error: implicit instantiation of undefined template 'mozilla::RefPtr<gfxContext>' RefPtr<gfxContext> mDefaultTarget;

Categories

(Firefox Build System :: General, defect)

x86_64
macOS
defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ewong, Unassigned)

References

Details

Getting this build failure on OSX64 Comm-central (for SeaMonkey and Thunderbird):

/builds/slave/c-cen-t-osx64/build/clang/bin/clang++ -arch x86_64 -o nsBaseWidget.o -c  -fvisibility=hidden -fvisibility-inlines-hidden -DMOZ_CROSS_PROCESS_IME -DOS_POSIX=1 -DOS_MACOSX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/builds/slave/c-cen-t-osx64/build/mozilla/widget -I. -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/ipc/ipdl/_ipdlheaders -I/builds/slave/c-cen-t-osx64/build/mozilla/ipc/chromium/src -I/builds/slave/c-cen-t-osx64/build/mozilla/ipc/glue -I/builds/slave/c-cen-t-osx64/build/mozilla/dom/base -I/builds/slave/c-cen-t-osx64/build/mozilla/dom/ipc -I/builds/slave/c-cen-t-osx64/build/mozilla/layout/base -I/builds/slave/c-cen-t-osx64/build/mozilla/layout/forms -I/builds/slave/c-cen-t-osx64/build/mozilla/layout/generic -I/builds/slave/c-cen-t-osx64/build/mozilla/layout/xul -I/builds/slave/c-cen-t-osx64/build/mozilla/view -I/builds/slave/c-cen-t-osx64/build/mozilla/widget -I/builds/slave/c-cen-t-osx64/build/mozilla/widget/cocoa -I../dist/include  -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/dist/include/nspr -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/dist/include/nss       -fPIC  -Qunused-arguments  -DMOZILLA_CLIENT -include ../mozilla-config.h -MD -MP -MF .deps/nsBaseWidget.o.pp -Qunused-arguments  -Qunused-arguments -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -gdwarf-2 -isysroot /Developer/SDKs/MacOSX10.7.sdk -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNO_X11 -pipe  -DNDEBUG -DTRIMMED -gdwarf-2 -O3 -fno-omit-frame-pointer   -DNO_X11   /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp
Unified_cpp_widget0.o
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:11:
In file included from ../dist/include/mozilla/layers/ImageBridgeChild.h:16:
../dist/include/mozilla/layers/CompositableForwarder.h:199:22: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::SyncObject>'
  RefPtr<SyncObject> mSyncObject;
                     ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
/builds/slave/c-cen-t-osx64/build/clang/bin/clang++ -arch x86_64 -o Unified_cpp_storage1.o -c  -fvisibility=hidden -fvisibility-inlines-hidden -DOS_POSIX=1 -DOS_MACOSX=1 -DMOZ_STORAGE_MEMORY -DSQLITE_MAX_LIKE_PATTERN_LENGTH=50000 -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/builds/slave/c-cen-t-osx64/build/mozilla/storage -I. -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/ipc/ipdl/_ipdlheaders -I/builds/slave/c-cen-t-osx64/build/mozilla/ipc/chromium/src -I/builds/slave/c-cen-t-osx64/build/mozilla/ipc/glue -I/builds/slave/c-cen-t-osx64/build/mozilla/db/sqlite3/src -I/builds/slave/c-cen-t-osx64/build/mozilla/dom/base -I../dist/include  -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/dist/include/nspr -I/builds/slave/c-cen-t-osx64/build/objdir/x86_64/dist/include/nss       -fPIC  -Qunused-arguments  -DMOZILLA_CLIENT -include ../mozilla-config.h -MD -MP -MF .deps/Unified_cpp_storage1.o.pp -Qunused-arguments  -Qunused-arguments -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -gdwarf-2 -isysroot /Developer/SDKs/MacOSX10.7.sdk -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNO_X11 -pipe  -DNDEBUG -DTRIMMED -gdwarf-2 -O3 -fno-omit-frame-pointer      /builds/slave/c-cen-t-osx64/build/objdir/x86_64/storage/Unified_cpp_storage1.cpp
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:26:
../dist/include/BasicLayers.h:185:22: error: implicit instantiation of undefined template 'mozilla::RefPtr<gfxContext>'
  RefPtr<gfxContext> mDefaultTarget;
                     ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:26:
../dist/include/BasicLayers.h:187:22: error: implicit instantiation of undefined template 'mozilla::RefPtr<gfxContext>'
  RefPtr<gfxContext> mTarget;
                     ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:26:
../dist/include/BasicLayers.h:189:24: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::ImageFactory>'
  RefPtr<ImageFactory> mFactory;
                       ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
In file included from ../dist/include/ClientLayerManager.h:18:
../dist/include/mozilla/layers/ShadowLayers.h:363:33: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::LayerTransactionChild>'
  RefPtr<LayerTransactionChild> mShadowManager;
                                ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
../dist/include/ClientLayerManager.h:324:22: error: implicit instantiation of undefined template 'mozilla::RefPtr<gfxContext>'
  RefPtr<gfxContext> mShadowTarget;
                     ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
../dist/include/ClientLayerManager.h:326:34: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::TransactionIdAllocator>'
  RefPtr<TransactionIdAllocator> mTransactionIdAllocator;
                                 ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
../dist/include/ClientLayerManager.h:349:32: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::ShadowLayerForwarder>'
  RefPtr<ShadowLayerForwarder> mForwarder;
                               ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:7:
In file included from ../dist/include/mozilla/TextEventDispatcher.h:14:
In file included from ../dist/include/mozilla/TextRange.h:14:
In file included from ../dist/include/nsStyleConsts.h:12:
In file included from ../dist/include/nsFont.h:11:
In file included from ../dist/include/gfxFontFamilyList.h:13:
../dist/include/nsTArray.h:2260:48: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::TextureClientPool>'
    char mAutoBuf[sizeof(nsTArrayHeader) + N * sizeof(elem_type)];
                                               ^
../dist/include/nsTArray.h:2258:3: note: in instantiation of member class 'nsAutoArrayBase<nsTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool> >, 2>::<anonymous union at ../dist/include/nsTArray.h:2258:3>' requested here
  union
  ^
../dist/include/nsTArray.h:2295:29: note: in instantiation of template class 'nsAutoArrayBase<nsTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool> >, 2>' requested here
class nsAutoTArray : public nsAutoArrayBase<nsTArray<E>, N>
                            ^
../dist/include/ClientLayerManager.h:350:45: note: in instantiation of template class 'nsAutoTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool>, 2>' requested here
  nsAutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
                                            ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:6:
In file included from ../dist/include/mozilla/ArrayUtils.h:21:
../dist/include/mozilla/Alignment.h:28:7: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::TextureClientPool>'
    T mT;
      ^
../dist/include/mozilla/Alignment.h:32:35: note: in instantiation of member class 'mozilla::AlignmentFinder<mozilla::RefPtr<mozilla::layers::TextureClientPool> >::Aligner' requested here
  static const size_t alignment = sizeof(Aligner) - sizeof(T);
                                  ^
../dist/include/nsTArray.h:2262:49: note: in instantiation of template class 'mozilla::AlignmentFinder<mozilla::RefPtr<mozilla::layers::TextureClientPool> >' requested here
    mozilla::AlignedElem<(MOZ_ALIGNOF(Header) > MOZ_ALIGNOF(elem_type)) ?
                                                ^
../dist/include/mozilla/Alignment.h:35:33: note: expanded from macro 'MOZ_ALIGNOF'
#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
                                ^
../dist/include/nsTArray.h:2258:3: note: in instantiation of member class 'nsAutoArrayBase<nsTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool> >, 2>::<anonymous union at ../dist/include/nsTArray.h:2258:3>' requested here
  union
  ^
../dist/include/nsTArray.h:2295:29: note: in instantiation of template class 'nsAutoArrayBase<nsTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool> >, 2>' requested here
class nsAutoTArray : public nsAutoArrayBase<nsTArray<E>, N>
                            ^
../dist/include/ClientLayerManager.h:350:45: note: in instantiation of template class 'nsAutoTArray<mozilla::RefPtr<mozilla::layers::TextureClientPool>, 2>' requested here
  nsAutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
                                            ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
../dist/include/ClientLayerManager.h:354:34: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::layers::ClientLayerManager::MemoryPressureObserver>'
  RefPtr<MemoryPressureObserver> mMemoryPressureObserver;
                                 ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:27:
../dist/include/ClientLayerManager.h:52:19: error: cannot initialize object parameter of type 'mozilla::layers::LayerManager' with an expression of type 'mozilla::layers::ClientLayerManager'
    LayerManager::Destroy();
                  ^~~~~~~
../dist/include/ClientLayerManager.h:82:12: error: cannot initialize object parameter of type 'const mozilla::layers::CompositableForwarder' with an expression of type 'mozilla::layers::ShadowLayerForwarder'
    return AsShadowForwarder()->GetCompositorBackendType();
           ^~~~~~~~~~~~~~~~~~~
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:28:
../dist/include/mozilla/layers/Compositor.h:541:27: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::gfx::DrawTarget>'
  RefPtr<gfx::DrawTarget> mTarget;
                          ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:44:
In file included from ../dist/include/mozilla/MouseEvents.h:13:
In file included from ../dist/include/mozilla/dom/DataTransfer.h:22:
../dist/include/mozilla/dom/File.h:176:20: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::dom::BlobImpl>'
  RefPtr<BlobImpl> mImpl;
                   ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:44:
In file included from ../dist/include/mozilla/MouseEvents.h:13:
In file included from ../dist/include/mozilla/dom/DataTransfer.h:22:
../dist/include/mozilla/dom/File.h:71:3: error: static_cast from 'mozilla::dom::Blob *' to 'nsIDOMBlob *' is not allowed
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Blob, nsIDOMBlob)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../dist/include/nsCycleCollectionParticipant.h:593:3: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS'
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                                   \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../dist/include/nsCycleCollectionParticipant.h:529:3: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_CLASS_BODY'
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK(_class, _base)                 \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../dist/include/nsCycleCollectionParticipant.h:522:12: note: expanded from macro 'NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK'
    return NS_ISUPPORTS_CAST(_base*, p);                                       \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../dist/include/nsISupportsUtils.h:118:29: note: expanded from macro 'NS_ISUPPORTS_CAST'
  static_cast<nsISupports*>(static_cast<__unambiguousBase>(__expr))
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:44:
In file included from ../dist/include/mozilla/MouseEvents.h:13:
In file included from ../dist/include/mozilla/dom/DataTransfer.h:22:
../dist/include/mozilla/dom/File.h:683:21: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::dom::BlobImplMemory::DataOwner>'
  RefPtr<DataOwner> mDataOwner;
                    ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:44:
In file included from ../dist/include/mozilla/MouseEvents.h:13:
In file included from ../dist/include/mozilla/dom/DataTransfer.h:22:
../dist/include/mozilla/dom/File.h:718:53: error: implicit instantiation of undefined template 'mozilla::RefPtr<nsTemporaryFileInputStream::FileDescOwner>'
  RefPtr<nsTemporaryFileInputStream::FileDescOwner> mFileDescOwner;
                                                    ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
In file included from /builds/slave/c-cen-t-osx64/build/mozilla/widget/nsBaseWidget.cpp:44:
In file included from ../dist/include/mozilla/MouseEvents.h:13:
../dist/include/mozilla/dom/DataTransfer.h:292:20: error: implicit instantiation of undefined template 'mozilla::RefPtr<mozilla::dom::FileList>'
  RefPtr<FileList> mFiles;
                   ^
../dist/include/mozilla/layers/AtomicRefCountedWithFinalize.h:66:18: note: template is declared here
    friend class RefPtr;
                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[5]: *** [nsBaseWidget.o] Error 1
make[4]: *** [widget/target] Error 2
make[4]: *** Waiting for unfinished jobs....
libstorage.a.desc
Blocks: 1207245
Hey Nathan, this affects comm-central but not mozilla-central, also it only affects OSX. Any suggestions on what is causing this?
Flags: needinfo?(nfroyd)
(In reply to Philip Chee from comment #1)
> Hey Nathan, this affects comm-central but not mozilla-central, also it only
> affects OSX. Any suggestions on what is causing this?

Not sure, although it does look like AtomicRefCountedWithFinalize includes two friend declarations, one for RefPtr and one for ::RefPtr, which might be screwing with things.  You could try removing the first one and see if that fixes things?  I thought I had to remove that at one point, but I see I either forgot or the problem went away...  r=me on the removal if does work.

Alternatively, you could preprocess the troublesome source file in its comm-central incarnation and its mozilla-central incarnation, and then diff those to see if there were any obvious problems.
Flags: needinfo?(nfroyd)
I ran into this as well trying to build m-c (OS X desktop). Nathan's suggestion in comment 2 seems to fix it for me. Try push to make sure it doesn't break anything else: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a0ee30b44e54
(In reply to Nathan Froyd [:froydnj] from comment #2)

> Alternatively, you could preprocess the troublesome source file in its
> comm-central incarnation and its mozilla-central incarnation, and then diff
> those to see if there were any obvious problems.

There is only one file. comm-central uses the mozilla-central one. See the mozilla.dev.platform thread about merging comm-central in to mozilla-central
(In reply to Philip Chee from comment #4)
> (In reply to Nathan Froyd [:froydnj] from comment #2)
> 
> > Alternatively, you could preprocess the troublesome source file in its
> > comm-central incarnation and its mozilla-central incarnation, and then diff
> > those to see if there were any obvious problems.
> 
> There is only one file. comm-central uses the mozilla-central one. See the
> mozilla.dev.platform thread about merging comm-central in to mozilla-central

Sure.  I was thinking that maybe there are different build settings that screw things up when it's compiled as a part of mozilla-central vs. comm-central, and preprocessing might point to those.  I didn't say my ideas were good ones. ;)
https://hg.mozilla.org/mozilla-central/rev/f65b294e99b2
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.