Skip to content

Commit 52689fe

Browse files
authored
Remove old FIDL tables.c file from build (#821)
Now that #798 added the new tables.c file, and https://fxrev.dev/946309 moved the content from the old file to the new file, we can stop generating the old file (i.e. stop passing --tables to fidlc). See https://fxbug.dev/42115242 for context.
1 parent 8c56fbb commit 52689fe

File tree

2 files changed

+43
-65
lines changed

2 files changed

+43
-65
lines changed

build/fuchsia/fidl_gen_cpp.py

-12
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ def main():
4141
parser.add_argument('--root', dest='root', action='store', required=True)
4242
parser.add_argument('--json', dest='json', action='store', required=True)
4343
parser.add_argument('--fidlgen-output-root', dest='fidlgen_output_root', action='store', required=False)
44-
parser.add_argument('--output-c-tables', dest='output_c_tables', action='store', required=True)
4544
parser.add_argument('--target-api-level', dest='target_api_level', action='store', required=False)
46-
# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
47-
parser.add_argument('--new-tables-path', dest='new_tables_path', action='store', required=False)
4845

4946
args = parser.parse_args()
5047

@@ -54,8 +51,6 @@ def main():
5451

5552
fidlc_command = [
5653
args.fidlc_bin,
57-
'--tables',
58-
args.output_c_tables,
5954
'--json',
6055
args.json
6156
]
@@ -80,13 +75,6 @@ def main():
8075

8176
subprocess.check_call(fidlc_command)
8277

83-
# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
84-
if args.fidlgen_bin:
85-
# Write tables.c so that GN doesn't complain about a missing output before the roll.
86-
assert args.new_tables_path
87-
with open(args.new_tables_path, "w") as f:
88-
print("// This will contain coding tables once https://fxbug.dev/39388 is done.", file=f)
89-
9078
if args.fidlgen_output_root:
9179
assert os.path.exists(args.json)
9280
for fidlgen_bin in args.fidlgen_bin:

build/fuchsia/sdk.gni

+43-53
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ template("fuchsia_fidl_library") {
9090
library_name_json = "${meta_json.name}.json"
9191

9292
foreach(dep, meta_json.deps) {
93-
_deps += [ ":$dep" ]
93+
# TODO(https://fxbug.dev/42172334): Make zx less special.
94+
if (dep != "zx") {
95+
_deps += [ ":$dep" ]
96+
}
9497
}
9598

9699
config_name = "config_$target_name"
@@ -106,10 +109,6 @@ template("fuchsia_fidl_library") {
106109

107110
inputs = [ invoker.meta ]
108111

109-
# TODO(fxbug.dev/39388): These are the old coding tables generated by fidlc.
110-
# Switch to the fidlgen_hlcpp coding tables.
111-
outputs = [ "$target_gen_dir/$library_name_slashes/cpp/old_tables.c" ]
112-
113112
args = [
114113
"--fidlc-bin",
115114
rebase_path("${_fuchsia_tools_path}/fidlc"),
@@ -119,8 +118,6 @@ template("fuchsia_fidl_library") {
119118
rebase_path(invoker.meta),
120119
"--json",
121120
rebase_path("$target_gen_dir/$library_name_json"),
122-
"--output-c-tables",
123-
rebase_path("$target_gen_dir/$library_name_slashes/cpp/old_tables.c"),
124121
]
125122

126123
if (fuchsia_target_api_level != -1) {
@@ -130,47 +127,41 @@ template("fuchsia_fidl_library") {
130127
]
131128
}
132129

133-
if (!defined(invoker.only_generate_tables) ||
134-
!invoker.only_generate_tables) {
135-
outputs += [
136-
"$target_gen_dir/$library_name_slashes/cpp/fidl.cc",
137-
"$target_gen_dir/$library_name_slashes/cpp/fidl.h",
138-
"$target_gen_dir/$library_name_slashes/cpp/fidl_test_base.h",
139-
"$target_gen_dir/$library_name_slashes/cpp/tables.c",
140-
141-
"$target_gen_dir/fidl/$library_name/cpp/common_types.cc",
142-
"$target_gen_dir/fidl/$library_name/cpp/common_types.h",
143-
"$target_gen_dir/fidl/$library_name/cpp/fidl.h",
144-
"$target_gen_dir/fidl/$library_name/cpp/hlcpp_conversion.h",
145-
"$target_gen_dir/fidl/$library_name/cpp/markers.h",
146-
"$target_gen_dir/fidl/$library_name/cpp/natural_messaging.cc",
147-
"$target_gen_dir/fidl/$library_name/cpp/natural_messaging.h",
148-
"$target_gen_dir/fidl/$library_name/cpp/natural_ostream.cc",
149-
"$target_gen_dir/fidl/$library_name/cpp/natural_ostream.h",
150-
"$target_gen_dir/fidl/$library_name/cpp/natural_types.cc",
151-
"$target_gen_dir/fidl/$library_name/cpp/natural_types.h",
152-
"$target_gen_dir/fidl/$library_name/cpp/type_conversions.cc",
153-
"$target_gen_dir/fidl/$library_name/cpp/type_conversions.h",
154-
"$target_gen_dir/fidl/$library_name/cpp/wire.h",
155-
"$target_gen_dir/fidl/$library_name/cpp/wire_messaging.cc",
156-
"$target_gen_dir/fidl/$library_name/cpp/wire_messaging.h",
157-
"$target_gen_dir/fidl/$library_name/cpp/wire_test_base.h",
158-
"$target_gen_dir/fidl/$library_name/cpp/wire_types.cc",
159-
"$target_gen_dir/fidl/$library_name/cpp/wire_types.h",
160-
]
130+
outputs = [
131+
"$target_gen_dir/$library_name_slashes/cpp/fidl.cc",
132+
"$target_gen_dir/$library_name_slashes/cpp/fidl.h",
133+
"$target_gen_dir/$library_name_slashes/cpp/fidl_test_base.h",
134+
"$target_gen_dir/$library_name_slashes/cpp/tables.c",
135+
136+
"$target_gen_dir/fidl/$library_name/cpp/common_types.cc",
137+
"$target_gen_dir/fidl/$library_name/cpp/common_types.h",
138+
"$target_gen_dir/fidl/$library_name/cpp/fidl.h",
139+
"$target_gen_dir/fidl/$library_name/cpp/hlcpp_conversion.h",
140+
"$target_gen_dir/fidl/$library_name/cpp/markers.h",
141+
"$target_gen_dir/fidl/$library_name/cpp/natural_messaging.cc",
142+
"$target_gen_dir/fidl/$library_name/cpp/natural_messaging.h",
143+
"$target_gen_dir/fidl/$library_name/cpp/natural_ostream.cc",
144+
"$target_gen_dir/fidl/$library_name/cpp/natural_ostream.h",
145+
"$target_gen_dir/fidl/$library_name/cpp/natural_types.cc",
146+
"$target_gen_dir/fidl/$library_name/cpp/natural_types.h",
147+
"$target_gen_dir/fidl/$library_name/cpp/type_conversions.cc",
148+
"$target_gen_dir/fidl/$library_name/cpp/type_conversions.h",
149+
"$target_gen_dir/fidl/$library_name/cpp/wire.h",
150+
"$target_gen_dir/fidl/$library_name/cpp/wire_messaging.cc",
151+
"$target_gen_dir/fidl/$library_name/cpp/wire_messaging.h",
152+
"$target_gen_dir/fidl/$library_name/cpp/wire_test_base.h",
153+
"$target_gen_dir/fidl/$library_name/cpp/wire_types.cc",
154+
"$target_gen_dir/fidl/$library_name/cpp/wire_types.h",
155+
]
161156

162-
args += [
163-
"--fidlgen-bin",
164-
rebase_path("${_fuchsia_tools_path}/fidlgen_cpp"),
165-
"--fidlgen-bin",
166-
rebase_path("${_fuchsia_tools_path}/fidlgen_hlcpp"),
167-
"--fidlgen-output-root",
168-
rebase_path("$target_gen_dir"),
169-
# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
170-
"--new-tables-path",
171-
rebase_path("$target_gen_dir/$library_name_slashes/cpp/tables.c"),
172-
]
173-
}
157+
args += [
158+
"--fidlgen-bin",
159+
rebase_path("${_fuchsia_tools_path}/fidlgen_cpp"),
160+
"--fidlgen-bin",
161+
rebase_path("${_fuchsia_tools_path}/fidlgen_hlcpp"),
162+
"--fidlgen-output-root",
163+
rebase_path("$target_gen_dir"),
164+
]
174165
}
175166

176167
source_set(target_name) {
@@ -313,12 +304,11 @@ template("fuchsia_sdk") {
313304
meta = part_meta_rebased
314305
}
315306
} else if (part_type == "fidl_library") {
316-
fuchsia_fidl_library(subtarget_name) {
317-
meta = part_meta_rebased
318-
319-
# TODO(fxbug.dev/90838): Remove the zx special-case when generic
320-
# option is available.
321-
only_generate_tables = subtarget_name == "zx"
307+
# TODO(https://fxbug.dev/42172334): Make zx less special.
308+
if (subtarget_name != "zx") {
309+
fuchsia_fidl_library(subtarget_name) {
310+
meta = part_meta_rebased
311+
}
322312
}
323313
} else if (part_type == "cc_prebuilt_library") {
324314
_fuchsia_cc_prebuilt_library(subtarget_name) {

0 commit comments

Comments
 (0)