Closed Bug 11199 Opened 21 years ago Closed 20 years ago

xpidl should remove output file on failure

Categories

(Core :: XPCOM, defect, P3, minor)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mike+mozilla, Assigned: beard)

Details

Currently, some kinds of compilation failure have xpidl returning false, but
leaving a half-constructed output file.  This could be confusing.
Status: NEW → ASSIGNED
Target Milestone: M12
Marking as assigned.
This is a problem because if there's an .idl file for which xpidl fails for some
late-detected error, a truncated .h file still gets generated... and a
subsequent make in the same directory will succeed.  A pain when developing.

Fix in hand for unix and (I believe) win32.  I found NSPR code in
macio.c:_MD_Delete to delete a file, but it's scary.  Patrick, any suggestions?
Is this even a problem on the mac?
Target Milestone: M12 → M13
lets get this done in m13
If you do remove objects on the Mac, the IDE goes ahead and deletes the output
files. I can add code to the drop-in compiler to delete as well, since I know
which file is the output file.
Assignee: mccabe → beard
Status: ASSIGNED → NEW
Fix checked in for Unix and Windows; punted on the Mac.

Patrick, can you take this?  Closing it and also punting is also an option.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Checked in a fix for this. Let me know if it works. I need some kind of file
with an error in it that demonstrates the bug.
Removing the output file when xpidl returns an error should do the trick.
Thanks for fixing this!

This problem cropped up when error s were detected at output-generation time
(after parsing.)  An example problem is marking an interface as scriptable when
it contains non-scriptable methods, such as methods with native return types.
Previous to this fix, if you compiled such a file with the make system, you'd
get an error (and an aborted make) the first time you compiled the file, but on
the second time, the make system would detect a partial file with a correct
timestamp, and wouldn't try to recompile the file.
Component: xpidl → XPCOM
QA Contact: mike+mozilla → xpcom
You need to log in before you can comment on or make changes to this bug.