Commit 1170df97 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Revert "bindings: Generate entries for .cpp/.h files from IDL dictionaries in GN"

This reverts commit 5d0edd94.

Reason for revert: Possible cause of Chromium Win x64 PGO Builder compile failures; hypothesis is that filenames are exceeding the maximum path length.  See https://build.chromium.org/p/chromium.fyi/builders/Chromium%20Win%20x64%20PGO%20Builder/builds/19881 .

This will likely also fix bug 728584 as a side effect, though we could fix that differently long term.

Original change's description:
> bindings: Generate entries for .cpp/.h files from IDL dictionaries in GN
> 
> By auto-generating those entries, we can stop requiring people to manually
> update lists such as |generated_core_dictionary_files| every time Blink's
> lists of IDL dictionary files change.
> 
> Since the names of the generated .cpp/.h follow a fixed, specific format
> that only depends on their respective IDL file's path and file name, we can
> use GN itself to do some path introspection and generate the file names we
> want in idl_impl().
> 
> While here, change the names of idl_impl()'s required arguments to make
> their purpose more explicit: it is not immediately obvious that we
> differentiate unions and callback functions from dictionary files in terms
> of where the latter are generated and their file names, as well as why
> idl_impl() only expects non-dictionary files in its outputs list. A good
> next step would be generating dictionary impl files separately from unions
> and callbacks to avoid the confusion altogether.
> 
> Bug: 725996
> Change-Id: I41b06e8d71f33b21d77944216fcb07d0557ac47b
> Reviewed-on: https://chromium-review.googlesource.com/517795
> Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
> Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
> Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#476262}

TBR=peria@chromium.org,yukishiino@chromium.org,raphael.kubo.da.costa@intel.com,bashi@chromium.org,haraken@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 725996,728584

Change-Id: I3d41d2517c33b30b92b72686f669881eb62a7a00
Reviewed-on: https://chromium-review.googlesource.com/521702
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476422}
parent e243e269
...@@ -27,10 +27,11 @@ idl_compiler("generate_bindings_modules_v8_interfaces") { ...@@ -27,10 +27,11 @@ idl_compiler("generate_bindings_modules_v8_interfaces") {
} }
idl_impl("bindings_modules_impl_generated") { idl_impl("bindings_modules_impl_generated") {
dict_idls = modules_dictionary_idl_files sources = modules_dictionary_idl_files
non_dict_outputs = bindings_modules_generated_union_type_files + outputs = bindings_modules_generated_union_type_files +
generated_modules_callback_function_files generated_modules_dictionary_files +
non_dict_output_dir = bindings_modules_v8_output_dir generated_modules_callback_function_files
output_dir = bindings_modules_v8_output_dir
target_component = "modules" target_component = "modules"
} }
......
...@@ -245,17 +245,12 @@ template("idl_compiler") { ...@@ -245,17 +245,12 @@ template("idl_compiler") {
} }
} }
# Runs idl_compiler.py to generate IDL dictionary impl files, unions and # Runs the idl_compiler to generate IDL dictionary and union impl files.
# callback functions.
# #
# Parameters: # Parameters:
# dict_idls = a list of dictionary IDL files to process. the callback and # sources = a list of IDL files to process
# union IDL file names are already known and do not need to be # outputs = a list of files to write to
# specified. # output_dir = the directory to put the output files
# non_dict_outputs = a list of files generated from callback functions and
# unions. the list of files generated from |dict_idls| is
# added automatically and does not need to be specified.
# non_dict_output_dir = the directory to put the non-dict output files.
# target_component = component to generate code for # target_component = component to generate code for
template("idl_impl") { template("idl_impl") {
dictionary_impl_output_dir = "$root_gen_dir/blink/" dictionary_impl_output_dir = "$root_gen_dir/blink/"
...@@ -263,7 +258,7 @@ template("idl_impl") { ...@@ -263,7 +258,7 @@ template("idl_impl") {
action(target_name) { action(target_name) {
script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py"
idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp"
write_file(idl_files_list, rebase_path(invoker.dict_idls, root_build_dir)) write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir))
inputs = idl_lexer_parser_files + idl_compiler_files # to be explicit (covered by parsetab) inputs = idl_lexer_parser_files + idl_compiler_files # to be explicit (covered by parsetab)
inputs += [ inputs += [
...@@ -272,27 +267,14 @@ template("idl_impl") { ...@@ -272,27 +267,14 @@ template("idl_impl") {
"$bindings_scripts_output_dir/cached_jinja_templates.stamp", "$bindings_scripts_output_dir/cached_jinja_templates.stamp",
"$bindings_dir/IDLExtendedAttributes.txt", "$bindings_dir/IDLExtendedAttributes.txt",
] ]
inputs += [ idl_files_list ] + invoker.dict_idls inputs += [ idl_files_list ] + invoker.sources
outputs = invoker.non_dict_outputs outputs = invoker.outputs
# Derive the names of the generated dictionary impl files. Contrary to
# generated interfaces, callbacks and unions, these files go to
# $root_gen_dir/blink/{core,modules}/<module name>/<IDLName>.{cpp,h}.
foreach(dict_idl, invoker.dict_idls) {
rel_path = rebase_path(dict_idl, "//third_party/WebKit/Source")
impl_dir = get_path_info(rel_path, "dir")
idl_name = get_path_info(rel_path, "name")
outputs += [
"${dictionary_impl_output_dir}$impl_dir/$idl_name.cpp",
"${dictionary_impl_output_dir}$impl_dir/$idl_name.h",
]
}
args = [ args = [
"--cache-dir", "--cache-dir",
rebase_path(bindings_scripts_output_dir, root_build_dir), rebase_path(bindings_scripts_output_dir, root_build_dir),
"--output-dir", "--output-dir",
rebase_path(invoker.non_dict_output_dir, root_build_dir), rebase_path(invoker.output_dir, root_build_dir),
"--impl-output-dir", "--impl-output-dir",
rebase_path(dictionary_impl_output_dir, root_build_dir), rebase_path(dictionary_impl_output_dir, root_build_dir),
"--info-dir", "--info-dir",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment