Last Comment Bug 681714 - typelib.py fails to compile nsILDAPOperation.idl
: typelib.py fails to compile nsILDAPOperation.idl
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: mozilla9
Assigned To: Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
:
:
Mentors:
Depends on:
Blocks: 681720
  Show dependency treegraph
 
Reported: 2011-08-24 11:46 PDT by Joshua Cranmer [:jcranmer]
Modified: 2011-08-28 06:03 PDT (History)
3 users (show)
khuey: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Loop to unroll typedefs (1021 bytes, patch)
2011-08-25 13:01 PDT, Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
ted: review+
Details | Diff | Splinter Review

Description Joshua Cranmer [:jcranmer] 2011-08-24 11:46:00 PDT
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
Comment 1 Mark Banner (:standard8) 2011-08-24 12:28:43 PDT
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?
Comment 2 Joshua Cranmer [:jcranmer] 2011-08-24 12:31:11 PDT
I recall from checking header generation that most type analysis fully unloads the typedef chain, so it should be.
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-25 13:01:29 PDT
Created attachment 555817 [details] [diff] [review]
Loop to unroll typedefs
Comment 4 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-25 13:02:20 PDT
I didn't test nsILDAPOperation.idl, but this fixes a similar contrived test case (which fails without this patch).
Comment 5 Joshua Cranmer [:jcranmer] 2011-08-25 13:14:00 PDT
I patched it similarly locally and nsILDAPOperation compiled without error.
Comment 6 Ted Mielczarek [:ted.mielczarek] 2011-08-26 12:47:29 PDT
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.
Comment 7 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-28 06:02:38 PDT
(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
Comment 8 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-28 06:03:07 PDT
http://hg.mozilla.org/mozilla-central/rev/28e83c8a39e4

Note You need to log in before you can comment on or make changes to this bug.