Skip to content

Commit

Permalink
Merge "fix proto deps to handle indirect dependencies" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
atetubou authored and Gerrit Code Review committed Oct 24, 2024
2 parents 7c86eb2 + d888a30 commit 318f113
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gn/proto_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ template("perfetto_proto_library") {
rebase_path(invoker.generate_descriptor, proto_path)
deps = deps_
import_dirs = import_dirs_
forward_variables_from(invoker, vars_to_forward)
forward_variables_from(invoker, vars_to_forward + [ "proto_deps" ])
}

# Not needed for descriptor proto_library target.
Expand Down
1 change: 1 addition & 0 deletions gn/standalone/proto_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@ template("proto_library") {
}
} # source_set(source_set_name)
}
not_needed(invoker, ["proto_deps"])
} # template
33 changes: 33 additions & 0 deletions protos/perfetto/trace/track_event/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,42 @@ perfetto_proto_library("@TYPE@") {
]
}

config("descriptor_inputs_config") {
inputs = [
"debug_annotation.proto",
"log_message.proto",
"task_execution.proto",
"chrome_active_processes.proto",
"chrome_application_state_info.proto",
"chrome_compositor_scheduler_state.proto",
"chrome_content_settings_event_info.proto",
"chrome_frame_reporter.proto",
"chrome_histogram_sample.proto",
"chrome_keyed_service.proto",
"chrome_latency_info.proto",
"chrome_legacy_ipc.proto",
"chrome_message_pump.proto",
"chrome_mojo_event_info.proto",
"chrome_renderer_scheduler_state.proto",
"chrome_user_event.proto",
"chrome_window_handle_event_info.proto",
"screenshot.proto",
"source_location.proto",
]
}

group("descriptor_inputs") {
public_configs = [ ":descriptor_inputs_config" ]
}

perfetto_proto_library("descriptor") {
proto_generators = [ "descriptor" ]
generate_descriptor = "track_event.descriptor"
sources = [ "track_event.proto" ]

# TODO(lalitm): remove this target when we found better way to propagate
# indirect input deps.
proto_deps = [ ":descriptor_inputs" ]

link_deps = [ ":source_set" ]
}
34 changes: 34 additions & 0 deletions protos/third_party/chromium/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,44 @@ perfetto_proto_library("@TYPE@") {
public_deps = [ "../../perfetto/trace/track_event:@TYPE@" ]
}

config("descriptor_inputs_config") {
inputs = [
"../../perfetto/trace/track_event/track_event.proto",
"../../perfetto/trace/track_event/debug_annotation.proto",
"../../perfetto/trace/track_event/source_location.proto",
"../../perfetto/trace/track_event/log_message.proto",
"../../perfetto/trace/track_event/task_execution.proto",
"../../perfetto/trace/track_event/chrome_active_processes.proto",
"../../perfetto/trace/track_event/chrome_application_state_info.proto",
"../../perfetto/trace/track_event/chrome_compositor_scheduler_state.proto",
"../../perfetto/trace/track_event/chrome_content_settings_event_info.proto",
"../../perfetto/trace/track_event/chrome_frame_reporter.proto",
"../../perfetto/trace/track_event/chrome_histogram_sample.proto",
"../../perfetto/trace/track_event/chrome_keyed_service.proto",
"../../perfetto/trace/track_event/chrome_latency_info.proto",
"../../perfetto/trace/track_event/chrome_legacy_ipc.proto",
"../../perfetto/trace/track_event/chrome_message_pump.proto",
"../../perfetto/trace/track_event/chrome_mojo_event_info.proto",
"../../perfetto/trace/track_event/chrome_renderer_scheduler_state.proto",
"../../perfetto/trace/track_event/chrome_user_event.proto",
"../../perfetto/trace/track_event/chrome_window_handle_event_info.proto",
"../../perfetto/trace/track_event/screenshot.proto",
]
}

group("descriptor_inputs") {
public_configs = [ ":descriptor_inputs_config" ]
}

perfetto_proto_library("@TYPE@") {
proto_generators = [ "descriptor" ]
sources = chrome_track_event_sources
generate_descriptor = "chrome_track_event.descriptor"

# TODO(lalitm): remove this target when we found better way to propagate
# indirect input deps.
proto_deps = [ ":descriptor_inputs" ]

link_deps = [ ":source_set" ]

# When rolled into Chrome, extension descriptor is going to be linked into
Expand Down

0 comments on commit 318f113

Please sign in to comment.