Bug 121877

Summary: generate-message-receiver.py can't handle nested #ifs
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Gergő Balogh <gbalogh.u-szeged>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, aroben, benjamin, commit-queue, darin, enrica, galpeter, kling, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 121818, 124147    
Attachments:
Description Flags
generated cpp with nested ifdefs
none
generated cpp without nested ifdefs
none
Patch
none
workaround
none
patch
none
patch none

Csaba Osztrogonác
Reported 2013-09-24 16:14:58 PDT
http://trac.webkit.org/changeset/156350 revealed that generate-message-receiver.py script can't handle nested ifdefs properly and it broke the non Mac builds.
Attachments
generated cpp with nested ifdefs (7.55 KB, text/plain)
2013-09-24 16:21 PDT, Csaba Osztrogonác
no flags
generated cpp without nested ifdefs (8.01 KB, text/plain)
2013-09-24 16:22 PDT, Csaba Osztrogonác
no flags
Patch (1.79 KB, patch)
2013-09-25 02:36 PDT, Csaba Osztrogonác
no flags
workaround (1.70 KB, patch)
2013-09-25 04:53 PDT, Csaba Osztrogonác
no flags
patch (11.78 KB, patch)
2013-10-18 05:39 PDT, Gergő Balogh
no flags
patch (11.78 KB, patch)
2013-10-18 05:51 PDT, Gergő Balogh
no flags
Csaba Osztrogonác
Comment 1 2013-09-24 16:21:48 PDT
Created attachment 212516 [details] generated cpp with nested ifdefs
Csaba Osztrogonác
Comment 2 2013-09-24 16:22:23 PDT
Created attachment 212517 [details] generated cpp without nested ifdefs
Csaba Osztrogonác
Comment 3 2013-09-24 16:23:29 PDT
Csaba Osztrogonác
Comment 4 2013-09-25 02:36:08 PDT
Created attachment 212547 [details] Patch workaround to avoid adding nested #ifs until proper fix
Peter Gal
Comment 5 2013-09-25 03:41:02 PDT
View in context: https://bugs.webkit.org/attachment.cgi?id=212547&action=review > Source/WebKit2/Scripts/webkit2/parser.py:51 > + sys.stderr.write('ERROR: Nested #ifs aren\'t supported, please fix %s\n' % file.name) You can mix ' and " together then you don't need to escape the ' (use " for the string start and end) > Source/WebKit2/Scripts/webkit2/parser.py:52 > + os._exit(1) The standard way to exit is sys.exit(n) as dictated by the python documentation.
Csaba Osztrogonác
Comment 6 2013-09-25 04:53:23 PDT
Created attachment 212553 [details] workaround updated patch based on Peter's review
Peter Gal
Comment 7 2013-09-25 04:57:15 PDT
(In reply to comment #6) > Created an attachment (id=212553) [details] > workaround > > updated patch based on Peter's review LGTM (BTW: Much better isn't? :))
Csaba Osztrogonác
Comment 8 2013-10-10 10:05:57 PDT
Is there any objection against adding this guard to avoid adding nested #ifs until proper fix?
Csaba Osztrogonác
Comment 9 2013-10-10 13:00:44 PDT
Comment on attachment 212553 [details] workaround Clearing flags on attachment: 212553 Committed r157243: <http://trac.webkit.org/changeset/157243>
Gergő Balogh
Comment 10 2013-10-18 05:39:16 PDT
WebKit Commit Bot
Comment 11 2013-10-18 05:41:23 PDT
Attachment 214558 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/Scripts/webkit2/messages_unittest.py', u'Source/WebKit2/Scripts/webkit2/parser.py']" exit_code: 1 Source/WebKit2/ChangeLog:9: Line contains tab character. [whitespace/tab] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gergő Balogh
Comment 12 2013-10-18 05:51:13 PDT
Peter Gal
Comment 13 2013-11-07 00:54:51 PST
(In reply to comment #12) > Created an attachment (id=214559) [details] > patch I think this would be really good to have. I've seen other bug reports where they expected to have nested #if-s
Alexey Proskuryakov
Comment 14 2013-11-07 09:16:05 PST
Certainly a good thing, just needs someone to review the code.
Csaba Osztrogonác
Comment 15 2013-11-12 08:48:39 PST
Is there a brave WK2 owner somewhere for reviewing this patch? :)
WebKit Commit Bot
Comment 16 2013-11-14 14:17:53 PST
Comment on attachment 214559 [details] patch Clearing flags on attachment: 214559 Committed r159312: <http://trac.webkit.org/changeset/159312>
WebKit Commit Bot
Comment 17 2013-11-14 14:17:56 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.