Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix inspector dependency resolution #27026

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions src/inspector/node_inspector.gypi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
'variables': {
'protocol_tool_path': '../../tools/inspector_protocol',
'node_inspector_path': '../../src/inspector',
'node_inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Protocol.cpp',
Expand Down Expand Up @@ -67,23 +66,14 @@
'<(SHARED_INTERMEDIATE_DIR)',
'<(SHARED_INTERMEDIATE_DIR)/src', # for inspector
],
'copies': [
{
'files': [
'<(node_inspector_path)/node_protocol_config.json',
'<(node_inspector_path)/node_protocol.pdl'
],
'destination': '<(SHARED_INTERMEDIATE_DIR)',
}
],
'actions': [
{
'action_name': 'convert_node_protocol_to_json',
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.pdl',
'node_protocol.pdl',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'<(SHARED_INTERMEDIATE_DIR)/src/node_protocol.json',
],
'action': [
'python',
Expand All @@ -95,8 +85,8 @@
{
'action_name': 'node_protocol_generated_sources',
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol_config.json',
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'node_protocol_config.json',
'<(SHARED_INTERMEDIATE_DIR)/src/node_protocol.json',
'<@(node_protocol_files)',
],
'outputs': [
Expand All @@ -108,15 +98,15 @@
'tools/inspector_protocol/code_generator.py',
'--jinja_dir', '<@(protocol_tool_path)/..',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/',
'--config', '<(SHARED_INTERMEDIATE_DIR)/node_protocol_config.json',
'--config', 'src/inspector/node_protocol_config.json',
],
'message': 'Generating node protocol sources from protocol json',
},
{
'action_name': 'concatenate_protocols',
'inputs': [
'../../deps/v8/src/inspector/js_protocol.pdl',
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'<(SHARED_INTERMEDIATE_DIR)/src/node_protocol.json',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/concatenated_protocol.json',
Expand Down
7 changes: 3 additions & 4 deletions tools/inspector_protocol/code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

def read_config():
# pylint: disable=W0703
def json_to_object(data, output_base, config_base):
def json_to_object(data, output_base):
def json_object_hook(object_dict):
items = [(k, os.path.join(config_base, v) if k == "path" else v) for (k, v) in object_dict.items()]
items = [(k, os.path.join(output_base, v) if k == "path" else v) for (k, v) in object_dict.items()]
items = [(k, os.path.join(output_base, v) if k == "output" else v) for (k, v) in items]
keys, values = list(zip(*items))
return collections.namedtuple('X', keys)(*values)
Expand Down Expand Up @@ -71,7 +71,6 @@ def init_defaults(config_tuple, path, defaults):
if not config_file:
raise Exception("Config file name must be specified")
config_file = config_file.decode('utf8')
config_base = os.path.dirname(config_file)
config_values = arg_options.config_value
if not config_values:
config_values = []
Expand All @@ -84,7 +83,7 @@ def init_defaults(config_tuple, path, defaults):
try:
config_json_file = open(config_file, "r")
config_json_string = config_json_file.read()
config_partial = json_to_object(config_json_string, output_base, config_base)
config_partial = json_to_object(config_json_string, output_base)
config_json_file.close()
defaults = {
".use_snake_file_names": False,
Expand Down