Open Bug 998926 Opened 10 years ago Updated 2 years ago

binding tests fail to build OSX and Windows debug when doing a non-clobber after an opt build: unknown type name 'LongOrBoolean' in TestBindingHeader.h

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect

Tracking

(Not tracked)

People

(Reporter: blassey, Unassigned)

References

(Depends on 1 open bug)

Details

flyingfox:mozilla-central blassey$ make -C objdir-osx/dom/bindings/test/
/Applications/Xcode.app/Contents/Developer/usr/bin/make export
make[1]: Nothing to be done for `export'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make compile
TestCodeGenBinding.o
/usr/bin/clang++ -o TestCodeGenBinding.o -c  -fvisibility=hidden -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DNO_NSPR_10_SUPPORT -I/Users/blassey/src/mozilla-central/dom/bindings/test -I. -I../../../dist/include/mozilla/dom -I/Users/blassey/src/mozilla-central/dom/bindings -I/Users/blassey/src/mozilla-central/js/xpconnect/src -I/Users/blassey/src/mozilla-central/js/xpconnect/wrappers -I.. -I../../../dist/include  -I/Users/blassey/src/mozilla-central/objdir-osx/dist/include/nspr -I/Users/blassey/src/mozilla-central/objdir-osx/dist/include/nss  -I/Users/blassey/src/mozilla-central/objdir-osx/dist/include -I/Users/blassey/src/mozilla-central/modules/zlib/src    -fPIC  -Qunused-arguments  -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MP -MF .deps/TestCodeGenBinding.o.pp -Qunused-arguments  -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNO_X11 -pipe -Wno-uninitialized  -DDEBUG -D_DEBUG -DTRACING -g -O3 -fno-omit-frame-pointer      /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:521:25: error: unknown type name 'LongOrBoolean'
  void PassUnion2(const LongOrBoolean& arg);
                        ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:522:37: error: unknown type name 'ObjectOrLongOrBoolean'
  void PassUnion3(JSContext*, const ObjectOrLongOrBoolean& arg);
                                    ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:523:25: error: unknown type name 'NodeOrLongOrBoolean'
  void PassUnion4(const NodeOrLongOrBoolean& arg);
                        ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:524:37: error: unknown type name 'ObjectOrBoolean'
  void PassUnion5(JSContext*, const ObjectOrBoolean& arg);
                                    ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:525:37: error: unknown type name 'ObjectOrString'
  void PassUnion6(JSContext*, const ObjectOrString& arg);
                                    ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:526:37: error: unknown type name 'ObjectOrStringOrLong'; did you mean 'ObjectOrNullOrLong'?
  void PassUnion7(JSContext*, const ObjectOrStringOrLong& arg);
                                    ^~~~~~~~~~~~~~~~~~~~
                                    ObjectOrNullOrLong
../../../dist/include/mozilla/dom/UnionTypes.h:2761:7: note: 'ObjectOrNullOrLong' declared here
class ObjectOrNullOrLong
      ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:527:37: error: unknown type name 'ObjectOrStringOrBoolean'
  void PassUnion8(JSContext*, const ObjectOrStringOrBoolean& arg);
                                    ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:528:37: error: unknown type name 'ObjectOrStringOrLongOrBoolean'
  void PassUnion9(JSContext*, const ObjectOrStringOrLongOrBoolean& arg);
                                    ^
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:529:26: error: unknown type name 'EventInitOrLong'; did you mean 'EventInitAtoms'?
  void PassUnion10(const EventInitOrLong& arg);
                         ^~~~~~~~~~~~~~~
                         EventInitAtoms
../../../dist/include/mozilla/dom/GeneratedAtomList.h:541:8: note: 'EventInitAtoms' declared here
struct EventInitAtoms
       ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:530:38: error: unknown type name 'CustomEventInitOrLong'; did you mean 'CustomEventInitAtoms'?
  void PassUnion11(JSContext*, const CustomEventInitOrLong& arg);
                                     ^~~~~~~~~~~~~~~~~~~~~
                                     CustomEventInitAtoms
../../../dist/include/mozilla/dom/GeneratedAtomList.h:302:8: note: 'CustomEventInitAtoms' declared here
struct CustomEventInitAtoms
       ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:531:26: error: unknown type name 'EventInitOrLong'; did you mean 'EventInitAtoms'?
  void PassUnion12(const EventInitOrLong& arg);
                         ^~~~~~~~~~~~~~~
                         EventInitAtoms
../../../dist/include/mozilla/dom/GeneratedAtomList.h:541:8: note: 'EventInitAtoms' declared here
struct EventInitAtoms
       ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:532:38: error: unknown type name 'ObjectOrLongOrNull'; did you mean 'ObjectOrLong'?
  void PassUnion13(JSContext*, const ObjectOrLongOrNull& arg);
                                     ^~~~~~~~~~~~~~~~~~
                                     ObjectOrLong
./../TestCodeGenBinding.h:34:7: note: 'ObjectOrLong' declared here
class ObjectOrLong;
      ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:533:38: error: unknown type name 'ObjectOrLongOrNull'; did you mean 'ObjectOrLong'?
  void PassUnion14(JSContext*, const ObjectOrLongOrNull& arg);
                                     ^~~~~~~~~~~~~~~~~~
                                     ObjectOrLong
./../TestCodeGenBinding.h:34:7: note: 'ObjectOrLong' declared here
class ObjectOrLong;
      ^
In file included from /Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:4:
/Users/blassey/src/mozilla-central/dom/bindings/test/TestBindingHeader.h:534:36: error: unknown type name 'EventHandlerNonNullOrNullOrLong'
  void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
                                   ^
/Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:30792:7: error: cannot initialize object parameter of type 'const nsWrapperCache' with an expression of type 'mozilla::dom::TestInterface'
  if (self->GetWrapperPreserveColor()) {
      ^~~~
/Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:31915:9: error: cannot initialize object parameter of type 'const nsWrapperCache' with an expression of type 'mozilla::dom::TestInterface'
  obj = aObject->GetWrapper();
        ^~~~~~~
/Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:31936:9: error: cannot initialize object parameter of type 'const nsWrapperCache' with an expression of type 'mozilla::dom::TestInterface'
  obj = aObject->GetWrapper();
        ^~~~~~~
/Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:31957:9: error: cannot initialize object parameter of type 'const nsWrapperCache' with an expression of type 'mozilla::dom::TestInterface'
  obj = aObject->GetWrapper();
        ^~~~~~~
/Users/blassey/src/mozilla-central/objdir-osx/dom/bindings/TestCodeGenBinding.cpp:31968:9: error: cannot initialize object parameter of type 'const nsWrapperCache' with an expression of type 'mozilla::dom::TestInterface'
  obj = aObject->GetWrapper();
        ^~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [TestCodeGenBinding.o] Error 1
make: *** [default] Error 2
Did you compile in dom/bindings first?

(I compile this code on OSX all the time, so I'm pretty darned sure it generally works....)
Flags: needinfo?(blassey.bugs)
(In reply to Boris Zbarsky [:bz] from comment #1)
> Did you compile in dom/bindings first?
> 
> (I compile this code on OSX all the time, so I'm pretty darned sure it
> generally works....)

just ran ./mach build
Flags: needinfo?(blassey.bugs)
That's really odd.  Is that type in your dist/include/mozilla/dom/UnionTypes.h?
Flags: needinfo?(blassey.bugs)
(In reply to Boris Zbarsky [:bz] from comment #3)
> That's really odd.  Is that type in your
> dist/include/mozilla/dom/UnionTypes.h?

No, it isn't
Flags: needinfo?(blassey.bugs)
fwiw... I only see LongOrBoolean used in this test https://mxr.mozilla.org/mozilla-central/search?string=LongOrBoolean
LongOrBoolean is an autogenerated type created when a WebIDL file uses "(long or boolean)", which TestCodeGen.webidl does.

I really don't understand why this is not working for you.  Was this an opt tree that is now being recompiled as debug without clobbering in between or something?
(In reply to Boris Zbarsky [:bz] from comment #6)
> LongOrBoolean is an autogenerated type created when a WebIDL file uses
> "(long or boolean)", which TestCodeGen.webidl does.
> 
> I really don't understand why this is not working for you.  Was this an opt
> tree that is now being recompiled as debug without clobbering in between or
> something?

It might have been. I'll try again with a clobber build.
clobber fixed it. Do you want to close this as invalid? or fix the dependencies?
I'd prefer the latter.  Not sure why we didn't regenerate things when switching from opt to debug; I thought we had explicit deps on the configure state.
Component: DOM → Build Config
Flags: needinfo?(gps)
Summary: binding tests fail to build OSX debug: unknown type name 'LongOrBoolean' → binding tests fail to build OSX debug when doing a non-clobber after an opt build: unknown type name 'LongOrBoolean'
(In reply to comment #9)
> I'd prefer the latter.  Not sure why we didn't regenerate things when switching
> from opt to debug; I thought we had explicit deps on the configure state.

Could this be because we don't count the mozconfig file as part of your build dependencies properly?
I'd think the output of configure is part of GLOBAL_DEPS, though!
I'm out of commission for a while. Redirecting request.
Flags: needinfo?(gps) → needinfo?(mshal)
I can't seem to reproduce this. Can you clarify what your mozconfig was before & after, and what files you changed in between (I assume TestCodeGen.webidl based on your output)?
Flags: needinfo?(mshal) → needinfo?(blassey.bugs)
mozconfig before:
. $topsrcdir/browser/config/mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-osx

ac_add_options --disable-crashreporter

mozconfig after:
. $topsrcdir/browser/config/mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-osx

ac_add_options --enable-debug
ac_add_options --disable-crashreporter


No files touched, just built, ran, realized I didn't build debug, modified my mozconfig and rebuilt.
Flags: needinfo?(blassey.bugs)
So here's what I'm doing:

1) Use your 'mozconfig before'
2) ./mach build
3) Use your 'mozconfig after'
4) ./mach build
5) touch dom/bindings/test/TestCodeGen.webidl
6) make -C objdir-osx/dom/bindings/test
(only 'python -m mozbuild.action.buildlist ...' runs)
7) make -C objdir-osx/dom/bindings
(preprocessor runs on TestCodeGen.webidl)
8) delete a line from TestCodeGen.webidl
9) make -C objdir-osx/dom/bindings
('python -m mozbuild.action.webidl' fails because of the removed line)
10) add the line back in
11) make -C objdir-osx/dom/bindings
(things build successfully again)

I'm missing something here that you were doing, but I'm not sure what.
* for steps 2 & 4, I'm running "./mach build && ./mach package" and I am running it between step 2 and step 3
* for me, the build is failing at step #4
(In reply to Michael Shal [:mshal] from comment #15)
> So here's what I'm doing:
> 
> 1) Use your 'mozconfig before'
> 2) ./mach build
> 3) Use your 'mozconfig after'

You need a step 3.5) ./mach configure

> 4) ./mach build

I hit this today by doing that.
Still with us, I went from having an empty mozconfig to one that has only "ac_add_options --enable-debug".
I hit this today with the following setup:
* tip of mozilla-central without a .mozconfig
* ./mach clobber && ./mach build
* add a .mozconfig with --enable-debug, --disable-opt
* ./mach build
I expect this basically happens because of bug 1103153.
Depends on: 1103153
I hit this today on MSVC2015 with:
51:49.58 c:\fx\dom\bindings\test\TestBindingHeader.h(604): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
51:49.58 c:\fx\dom\bindings\test\TestBindingHeader.h(604): error C2143: syntax error: missing ',' before '&'

followed by other similar errors.
Summary: binding tests fail to build OSX debug when doing a non-clobber after an opt build: unknown type name 'LongOrBoolean' → binding tests fail to build OSX and Windows debug when doing a non-clobber after an opt build: unknown type name 'LongOrBoolean' in TestBindingHeader.h
I ran into this today after changing my mozconfig from:

    ac_add_options --target=x86_64-w64-mingw32
    ac_add_options --host=x86_64-w64-mingw32
    
    ## Debug Build
    mk_add_options 'MOZ_DUMP_PAINTING=1'
    ac_add_options --enable-debug
    ac_add_options --enable-debug-symbols
    ac_add_options --enable-profiling
    
    #ac_add_options --disable-optimize
    ac_add_options --enable-optimize=-Og
    
    ## Release Build
    #ac_add_options --enable-optimize --disable-debug


to:

    ac_add_options --target=x86_64-w64-mingw32
    ac_add_options --host=x86_64-w64-mingw32
    
    ## Debug Build
    #mk_add_options 'MOZ_DUMP_PAINTING=1'
    #ac_add_options --enable-debug
    #ac_add_options --enable-debug-symbols
    #ac_add_options --enable-profiling

    #ac_add_options --disable-optimize
    #ac_add_options --enable-optimize=-Og

    ## Release Build
    ac_add_options --enable-optimize --disable-debug

and running "mach build" without a "mach clobber" in between. My previous debug build had been done with "mach build binaries", if that matters.
Yes, we know this happens.  We know why it happens too; see comment 20...
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.