Closed Bug 814967 Opened 12 years ago Closed 11 years ago

Fix includes in mailnews/ .idl files so that builds no longer fail randomly with "error: name 'nsMsgSocketType' specified twice"

Categories

(MailNews Core :: Build Config, defect)

x86
Linux
defect
Not set
major

Tracking

(thunderbird19 fixed, seamonkey2.16 fixed)

RESOLVED FIXED
Thunderbird 20.0
Tracking Status
thunderbird19 --- fixed
seamonkey2.16 --- fixed

People

(Reporter: mcsmurf, Assigned: mcsmurf)

Details

Attachments

(2 files, 2 obsolete files)

SeaMonkey Linux trunk sometimes(?) fails to compile, log from today's nightly build:
Traceback (most recent call last):
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/mozilla/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/mozilla/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mozilla/dist/sdk/bin/header.py", line 524, in <module>
    idl.resolve(options.incdirs, p)
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 287, in resolve
    p.resolve(self)
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 253, in resolve
    parent.setName(type)
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 265, in setName
    self.namemap.set(object)
  File "/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 211, in set
    raise IDLError("name '%s' specified twice. Previous location: %s" % (object.name, self._d[object.name].location), object.location)
xpidl.IDLError: error: name 'nsMsgSocketType' specified twice. Previous location: /builds/slave/comm-cen-trunk-lnx-ntly/build/mailnews/base/public/MailNewsTypes2.idl line 38:0
interface nsMsgSocketType {
^, ../../../../mozilla/dist/idl/MailNewsTypes2.idl line 38:0
interface nsMsgSocketType {
^
NEXT ERROR make[7]: *** [_xpidlgen/nsIMsgDatabase.h] Error 1
make[7]: *** Deleting file `_xpidlgen/nsIMsgDatabase.h'
make[7]: Leaving directory `/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mailnews/db/msgdb/public'
make[6]: Leaving directory `/builds/slave/comm-cen-trunk-lnx-ntly/build/objdir/mailnews/db/msgdb'
NEXT ERROR make[6]: *** [public_export] Error 2
make[5]: *** [db/msgdb_export] Error 2
make[5]: *** Waiting for unfinished jobs....

http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1353832204.1353832899.27156.gz&fulltext=1#err0
I'd guess this is fallout from bug 465339. I also see it quite frequently locally (Win7 x64, pymake with -j8).
Here's another build failure, I think it's related so maybe we can fix it here, too:
From the Linux 64-bit SeaMonkey tinderbox, build failure in nsIMsgFilter.idl:
Traceback (most recent call last):
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/mozilla/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/mozilla/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/objdir/mozilla/dist/sdk/bin/header.py", line 524, in <module>
    idl.resolve(options.incdirs, p)
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 287, in resolve
    p.resolve(self)
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 253, in resolve
    parent.setName(type)
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 265, in setName
    self.namemap.set(object)
  File "/builds/slave/comm-cen-trunk-lnx64-ntly/build/objdir/mozilla/dist/sdk/bin/xpidl.py", line 211, in set
    raise IDLError("name '%s' specified twice. Previous location: %s" % (object.name, self._d[object.name].location), object.location)
xpidl.IDLError: error: name 'nsMsgSocketType' specified twice. Previous location: /builds/slave/comm-cen-trunk-lnx64-ntly/build/mailnews/base/public/MailNewsTypes2.idl line 38:0
interface nsMsgSocketType {
^, ../../../../mozilla/dist/idl/MailNewsTypes2.idl line 38:0
interface nsMsgSocketType {
^
NEXT ERROR make[7]: *** [_xpidlgen/nsIMsgFilter.h] Error 1
Yes, most likely a result of the same bug. The main thing to do here is to look at the includes in nsIMsgDatabase.idl and see if a) you can replace the include by an "interface" definition, b) reduce where MailNewsTypes2.idl is included in the include tree.

Once you've done those, build & compile and add any missing includes as necessary.

Same with nsIMsgFilter.idl.
Attached patch Like this? (obsolete) — Splinter Review
I'm not sure if this is how it should be done, but it works at least. nsIMsgSearchTerm.idl and nsIMsgSearchValue.idl both include nsMsgSearchCore.idl which includes MailNewsTypes2.idl (would it have worked, too if I only had removed one of those two includes?). In nsIMsgDatabase.idl I removed nsIMsgDBView.idl from the include list, it includes MailNewsTypes2.idl. I also removed MailNewsTypes2.idl itself from the include list as it gets included via nsIDBChangeAnnouncer.idl.
Attachment #686506 - Flags: review?(mbanner)
Attached patch Like this? (obsolete) — Splinter Review
Forgot to add a change, see Comment 4 for what this patch does.
Attachment #686506 - Attachment is obsolete: true
Attachment #686506 - Flags: review?(mbanner)
Attachment #686507 - Flags: review?(mbanner)
Actually the nsIMsgSearchScopeTerm.idl include (in nsIMsgFilter.idl) includes nsIMsgSearchSession.idl which includes nsIMsgSearchValue.idl which includes nsMsgSearchCore.idl which includes MailNewsTypes2.idl again :)
Attached patch Like this?Splinter Review
Need to remove nsIMsgSearchScopeTerm.idl, too as it also includes MailNewsTypes2.idl via the nsIMsgSearchSession.idl include path. Now only nsMsgFilterCore.idl in nsIMsgFilter.idl should include MailNewsTypes2.idl.
Attachment #686511 - Flags: review?(mbanner)
Attachment #686507 - Attachment is obsolete: true
Attachment #686507 - Flags: review?(mbanner)
Try run for c42a35f5a00b is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=c42a35f5a00b
Results (out of 11 total builds):
    success: 9
    failure: 2
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/mcsmurf@mcsmurf.de-c42a35f5a00b
Comment on attachment 686511 [details] [diff] [review]
Like this?

Review of attachment 686511 [details] [diff] [review]:
-----------------------------------------------------------------

Yep, looks good. Thanks.
Attachment #686511 - Flags: review?(mbanner) → review+
Pushed: https://hg.mozilla.org/comm-central/rev/14a8939f9f47
Assignee: nobody → bugzilla
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 20.0
Attached patch Another patchSplinter Review
Appending to this bug here as it's the same issue. A Linux SeaMonkey build failed with the same error message as in Comment 0. The cause is that nsIMsgNewsFolder.idl includes both nsIMsgThread.idl and nsIMsgIncomingServer.idl. Both files include MailNewsTypes2.idl.
reopening because of new patch, pushed patch to try.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 696649 [details] [diff] [review]
Another patch

Compiling this patch worked fine locally (test with -j4 and -j6), it also worked fine on Try: https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=34cace5c617b. See Comment 11 why this patch is needed.
Attachment #696649 - Flags: review?(mbanner)
Attachment #696649 - Flags: review?(mbanner) → review+
Pushed Attachment 696649 [details] [diff]: https://hg.mozilla.org/comm-central/rev/2862496cc60c
Summary: SeaMonkey trunk build failure (nsIMsgDatabase.idl) → Fix includes in mailnews/ .idl files so that builds no longer fail randomly with "error: name 'nsMsgSocketType' specified twice"
Resolving for now, I think I saw another occurrence of this bug a few weeks ago. But I'll file a new bug then if I see this happen again.
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
Comment on attachment 686511 [details] [diff] [review]
Like this?

I'm seeing this on today's SeaMonkey beta build, assuming the patch applies, Mark can I get you're approval to land [I think these are safe to land]
Attachment #686511 - Flags: approval-comm-beta?
Comment on attachment 696649 [details] [diff] [review]
Another patch

Review of attachment 696649 [details] [diff] [review]:
-----------------------------------------------------------------

I'm seeing this on today's SeaMonkey beta build, assuming the patch applies, Mark can I get you're approval to land [I think these are safe to land]
Attachment #696649 - Flags: approval-comm-beta?
I'll note these two patches are already on aurora. And that SeaMonkey Council has not been given the "right" to do approvals for mailnews/* yet despite a few attempt at discussing, so hoping this can get triaged by next week!
Flags: needinfo?(mbanner)
Comment on attachment 686511 [details] [diff] [review]
Like this?

Yeah these should be fine, less risk of builds braking during release etc.
Attachment #686511 - Flags: approval-comm-beta? → approval-comm-beta+
Flags: needinfo?(mbanner)
Attachment #696649 - Flags: approval-comm-beta? → approval-comm-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: