typelib.py fails to compile nsILDAPOperation.idl

RESOLVED FIXED in mozilla9

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jcranmer, Assigned: khuey)

Tracking

unspecified
mozilla9
x86_64
Windows 7
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
nsILDAPOperation.idl
/usr/bin/python2.6 -u /src/trunk/mozilla/config/pythonpath.py \
          -I/src/trunk/mozilla/other-licenses/ply \
          -I/src/trunk/mozilla/xpcom/idl-parser \
          -I/src/trunk/mozilla/xpcom/typelib/xpt/tools \
          /src/trunk/mozilla/xpcom/idl-parser/typelib.py --cachedir=/src/trunk/mozilla/xpcom/idl-parser -I/src/trunk/ldap/xpcom/public -I../../../mozilla/dist/idl /src/trunk/ldap/xpcom/public/nsILDAPOperation.idl -d .deps/nsILDAPOperation.xpt.pp -o _xpidlgen/nsILDAPOperation.xpt
Traceback (most recent call last):
  File "/src/trunk/mozilla/config/pythonpath.py", line 52, in <module>
    main(sys.argv[1:])
  File "/src/trunk/mozilla/config/pythonpath.py", line 44, in main
    execfile(script, frozenglobals)
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 312, in <module>
    write_typelib(idl, outfd, file)
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 265, in write_typelib
    ifaces.append(build_interface(p, ifaces))
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 237, in build_interface
    build_method(member)
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 202, in build_method
    params.append(build_param(p))
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 194, in build_param
    type = get_type(p.realtype, p.paramtype, iid_is=iid_is, size_is=size_is)
  File "/src/trunk/mozilla/xpcom/idl-parser/typelib.py", line 129, in get_type
    raise Exception("Unknown type!")
Exception: Unknown type!

This may be an issue related to typedefs-to-native
(Reporter)

Updated

6 years ago
Blocks: 681720
In nsLDAPOperation.idl, if I change:

typedef PRUint32 PRIntervalTime;

to

typedef unsigned long PRIntervalTime;

then it passes. Whilst it could be argued that we should just be using unsigned long, should typedefs-to-native also be working?
(Reporter)

Comment 2

6 years ago
I recall from checking header generation that most type analysis fully unloads the typedef chain, so it should be.
Created attachment 555817 [details] [diff] [review]
Loop to unroll typedefs
Attachment #555817 - Flags: review?(ted.mielczarek)
I didn't test nsILDAPOperation.idl, but this fixes a similar contrived test case (which fails without this patch).
(Reporter)

Comment 5

6 years ago
I patched it similarly locally and nsILDAPOperation compiled without error.
Comment on attachment 555817 [details] [diff] [review]
Loop to unroll typedefs

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

Add a test for this? I landed my simple test harness from bug 677671.
Attachment #555817 - Flags: review?(ted.mielczarek) → review+
(In reply to Ted Mielczarek [:ted, :luser] from comment #6)
> Comment on attachment 555817 [details] [diff] [review]
> Loop to unroll typedefs
> 
> Review of attachment 555817 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Add a test for this? I landed my simple test harness from bug 677671.

I don't think that's enough to test this.  The bug is in typelib.py.  Frankly, I'm tempted just to modify an IDL file in m-c to use this :-P
http://hg.mozilla.org/mozilla-central/rev/28e83c8a39e4
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.