Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Issue 18190004: Add Python flow to bindings generation, move dummy-generating IDL files over (Closed)

Created:
7 years, 5 months ago by Nils Barth (inactive)
Modified:
7 years, 5 months ago
Reviewers:
haraken
CC:
blink-reviews, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin, do-not-use, kojih, dominicc1
Visibility:
Public.

Description

To transition to bindings generation in Python rather than Perl, we're adding a parallel flow in GYP, and moving IDL files one-by-one as the generator is able to handle them. This CL contains the necessary build changes and basic Python scripts, but does not include the parser or code generator, which will come later. The build generates exactly the same bindings files before and after this CL. In detail, this CL: * Splits the existing GYP target 'bindings_sources' in two: - 'perl_bindings_sources' (rename existing), - 'python_bindings_sources' (new one, just copy-paste Perl one and change script), ...and splits the various 'idl_files' lists into 'perl_...' and 'python_...', so we can just move files one-by-one from the Perl list to the Python list. * Adds generate_bindings.py, the main Python bindings build script Almost complete, just does not call the parser or the real code generator. * Adds a stub build_ir.py This will eventually be the main AST to IR converter, but for now just does dependency resolution and raises an IdlNotFoundError exception, instructing generate_bindings.py to make dummy files. * Adds a stub code_generator_v8.py, which only generates dummy files (.cpp and .h only needed to provide 'outputs' for build). * Moves the 37 IDL files that generate dummy files over to Python. Also a few cleanups I noticed on the way (commented inline). BUG=239771 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153878

Patch Set 1 #

Patch Set 2 : Wording #

Patch Set 3 : Tweak similarity #

Total comments: 38

Patch Set 4 : Revised #

Total comments: 16

Patch Set 5 : Rebase, fix run-bindings-test, remove supplemental #

Patch Set 6 : Revised 2 #

Total comments: 10

Patch Set 7 : Revision 3 #

Patch Set 8 : Revision 3 (tweak similarity) #

Total comments: 14

Patch Set 9 : Revision 4 (IdlDocument -> IdlDefinitions) #

Total comments: 5

Patch Set 10 : Final #

Patch Set 11 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+560 lines, -8854 lines) Patch
M Source/bindings/derived_sources.gyp View 1 2 3 4 5 6 7 8 9 8 chunks +126 lines, -44 lines 0 comments Download
D Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -6049 lines 0 comments Download
D Source/bindings/scripts/IDLParser.pm View 1 2 3 1 chunk +0 lines, -2239 lines 0 comments Download
D Source/bindings/scripts/IDLSerializer.pm View 1 2 3 1 chunk +0 lines, -126 lines 0 comments Download
A Source/bindings/scripts/code_generator_v8.py View 1 2 3 4 5 6 7 8 1 chunk +56 lines, -0 lines 0 comments Download
A + Source/bindings/scripts/deprecated_code_generator_v8.pm View 1 2 3 4 5 6 7 8 9 10 4 chunks +3 lines, -5 lines 0 comments Download
A + Source/bindings/scripts/deprecated_generate_bindings.pl View 1 2 3 4 7 chunks +15 lines, -27 lines 0 comments Download
A + Source/bindings/scripts/deprecated_idl_parser.pm View 1 2 3 7 chunks +12 lines, -12 lines 0 comments Download
A + Source/bindings/scripts/deprecated_idl_serializer.pm View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
D Source/bindings/scripts/generate-bindings.pl View 1 2 3 4 1 chunk +0 lines, -311 lines 0 comments Download
A Source/bindings/scripts/idl_compiler.py View 1 2 3 4 5 6 7 8 9 1 chunk +103 lines, -0 lines 0 comments Download
A Source/bindings/scripts/idl_reader.py View 1 2 3 4 5 6 7 8 9 1 chunk +73 lines, -0 lines 0 comments Download
A Source/bindings/scripts/interface_dependency_resolver.py View 1 2 3 4 5 6 7 8 1 chunk +123 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 13 chunks +21 lines, -15 lines 0 comments Download
M Source/modules/modules.gypi View 1 2 3 9 chunks +28 lines, -26 lines 0 comments Download
M Tools/Scripts/webkitpy/bindings/main.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (0 generated)
Nils Barth (inactive)
Hi haraken, Here's the "Python build changes" CL! (No parser or code generator yet, but ...
7 years, 5 months ago (2013-07-08 05:24:37 UTC) #1
haraken
This is a great step to move things forward! https://codereview.chromium.org/18190004/diff/3001/Source/bindings/derived_sources.gyp File Source/bindings/derived_sources.gyp (right): https://codereview.chromium.org/18190004/diff/3001/Source/bindings/derived_sources.gyp#newcode54 Source/bindings/derived_sources.gyp:54: ...
7 years, 5 months ago (2013-07-08 06:06:29 UTC) #2
Nils Barth (inactive)
Thanks for detailed comments haraken! Revised as per comments. Changes (from previous) are almost all ...
7 years, 5 months ago (2013-07-09 08:48:16 UTC) #3
haraken
https://codereview.chromium.org/18190004/diff/8001/Source/bindings/derived_sources.gyp File Source/bindings/derived_sources.gyp (right): https://codereview.chromium.org/18190004/diff/8001/Source/bindings/derived_sources.gyp#newcode259 Source/bindings/derived_sources.gyp:259: '<(SHARED_INTERMEDIATE_DIR)/supplemental_dependency.tmp', I think this was renamed to InterfaceDependencies.txt. https://codereview.chromium.org/18190004/diff/8001/Source/bindings/scripts/build_ir.py ...
7 years, 5 months ago (2013-07-09 11:16:47 UTC) #4
Nils Barth (inactive)
Revised per comments. Other than comment and name changes, reorganized main call to read the ...
7 years, 5 months ago (2013-07-10 02:38:31 UTC) #5
haraken
Thanks for the iterative improvement! I think it's almost ready to go. https://codereview.chromium.org/18190004/diff/29001/Source/bindings/scripts/idl_compiler.py File Source/bindings/scripts/idl_compiler.py ...
7 years, 5 months ago (2013-07-10 04:06:50 UTC) #6
haraken
> Anyway, I've replaced all references in the code to "AST" or "IR" > with ...
7 years, 5 months ago (2013-07-10 04:09:28 UTC) #7
Nils Barth (inactive)
Quick wording question. On 2013/07/10 04:06:50, haraken wrote: > frontend (lexer => parser => read_idl.py) ...
7 years, 5 months ago (2013-07-10 04:21:03 UTC) #8
haraken
> or as nouns like: > lexer => parser => object constructor => interface merger ...
7 years, 5 months ago (2013-07-10 04:40:21 UTC) #9
Nils Barth (inactive)
On 2013/07/10 04:40:21, haraken wrote: > > or as nouns like: > > lexer => ...
7 years, 5 months ago (2013-07-10 04:56:44 UTC) #10
haraken
> It's actually semantic validator (it checks *values*, namely Extended Attribute > names and values); ...
7 years, 5 months ago (2013-07-10 05:00:29 UTC) #11
Nils Barth (inactive)
On 2013/07/10 05:00:29, haraken wrote: > > So how's this: <snip> > Looks like a ...
7 years, 5 months ago (2013-07-10 05:03:31 UTC) #12
Nils Barth (inactive)
Revised per comments. 2 "new" files are due to refactoring for clearer interface (so not ...
7 years, 5 months ago (2013-07-10 06:00:14 UTC) #13
haraken
The final round of comments! https://codereview.chromium.org/18190004/diff/55001/Source/bindings/scripts/idl_compiler.py File Source/bindings/scripts/idl_compiler.py (right): https://codereview.chromium.org/18190004/diff/55001/Source/bindings/scripts/idl_compiler.py#newcode47 Source/bindings/scripts/idl_compiler.py:47: moving IDL files to ...
7 years, 5 months ago (2013-07-10 06:22:47 UTC) #14
Nils Barth (inactive)
Revised: * Rename IdlDocument to IdlDefinitions ("Document" isn't in the spec, "Definitions" is; details below) ...
7 years, 5 months ago (2013-07-10 07:04:10 UTC) #15
haraken
LGTM. This is a good start of the new Python flow! https://codereview.chromium.org/18190004/diff/61001/Source/bindings/scripts/idl_reader.py File Source/bindings/scripts/idl_reader.py (right): ...
7 years, 5 months ago (2013-07-10 07:13:45 UTC) #16
Nils Barth (inactive)
Thanks for patient review; final revision, committing. (On to the parser!) https://codereview.chromium.org/18190004/diff/61001/Source/bindings/scripts/idl_reader.py File Source/bindings/scripts/idl_reader.py (right): ...
7 years, 5 months ago (2013-07-10 07:35:36 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/18190004/64001
7 years, 5 months ago (2013-07-10 07:36:32 UTC) #18
commit-bot: I haz the power
Failed to apply patch for Tools/Scripts/webkitpy/bindings/main.py: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago (2013-07-10 07:36:37 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/18190004/69001
7 years, 5 months ago (2013-07-10 07:43:53 UTC) #20
commit-bot: I haz the power
7 years, 5 months ago (2013-07-10 10:18:34 UTC) #21
Message was sent while issue was closed.
Change committed as 153878

Powered by Google App Engine
This is Rietveld 408576698