Skip to content

Commit 30f89df

Browse files
committed
build: add node_lib_target_name to cctest deps
Currently the cctest target depend on the node_core_target_name target. But it is the node_lib_target_name target that compiles the sources now which means that if a source file in src is updated the cctest executable will not be re-linked against it, but will remain unchanged. The code will still be compiled, just not linked which means that if you are debugging you'll not see the changes and also a warning will be displayed about this issue. This commit changes the cctest target to depend on node_lib_target_name. PR-URL: #18576 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Yihong Wang <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 3d93f39 commit 30f89df

File tree

3 files changed

+25
-159
lines changed

3 files changed

+25
-159
lines changed

node.gyp

Lines changed: 3 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@
921921
'type': 'executable',
922922

923923
'dependencies': [
924-
'<(node_core_target_name)',
924+
'<(node_lib_target_name)',
925925
'rename_node_bin_win',
926926
'deps/gtest/gtest.gyp:gtest',
927927
'node_js2c#host',
@@ -930,39 +930,6 @@
930930
'node_dtrace_provider',
931931
],
932932

933-
'variables': {
934-
'obj_path': '<(obj_dir)/<(node_lib_target_name)/src',
935-
'obj_gen_path': '<(obj_dir)/<(node_lib_target_name)/gen',
936-
'obj_tracing_path': '<(obj_dir)/<(node_lib_target_name)/src/tracing',
937-
'obj_suffix': 'o',
938-
'obj_separator': '/',
939-
'conditions': [
940-
['OS=="win"', {
941-
'obj_suffix': 'obj',
942-
}],
943-
['GENERATOR=="ninja"', {
944-
'obj_path': '<(obj_dir)/src',
945-
'obj_gen_path': '<(obj_dir)/gen',
946-
'obj_tracing_path': '<(obj_dir)/src/tracing',
947-
'obj_separator': '/<(node_lib_target_name).',
948-
}, {
949-
'conditions': [
950-
['OS=="win"', {
951-
'obj_path': '<(obj_dir)/<(node_lib_target_name)',
952-
'obj_gen_path': '<(obj_dir)/<(node_lib_target_name)',
953-
'obj_tracing_path': '<(obj_dir)/<(node_lib_target_name)',
954-
}],
955-
['OS=="aix"', {
956-
'obj_path': '<(obj_dir)/<(node_lib_target_name)/src',
957-
'obj_gen_path': '<(obj_dir)/<(node_lib_target_name)/gen',
958-
'obj_tracing_path':
959-
'<(obj_dir)/<(node_lib_target_name)/src/tracing',
960-
}],
961-
]}
962-
]
963-
],
964-
},
965-
966933
'includes': [
967934
'node.gypi'
968935
],
@@ -979,7 +946,6 @@
979946
'defines': [ 'NODE_WANT_INTERNALS=1' ],
980947

981948
'sources': [
982-
'test/cctest/node_module_reg.cc',
983949
'test/cctest/node_test_fixture.cc',
984950
'test/cctest/test_aliased_buffer.cc',
985951
'test/cctest/test_base64.cc',
@@ -989,120 +955,30 @@
989955
'test/cctest/test_url.cc'
990956
],
991957

992-
'libraries': [
993-
'<(obj_path)<(obj_separator)async_wrap.<(obj_suffix)',
994-
'<(obj_path)<(obj_separator)handle_wrap.<(obj_suffix)',
995-
'<(obj_path)<(obj_separator)env.<(obj_suffix)',
996-
'<(obj_path)<(obj_separator)node.<(obj_suffix)',
997-
'<(obj_path)<(obj_separator)node_buffer.<(obj_suffix)',
998-
'<(obj_path)<(obj_separator)node_debug_options.<(obj_suffix)',
999-
'<(obj_path)<(obj_separator)node_i18n.<(obj_suffix)',
1000-
'<(obj_path)<(obj_separator)node_perf.<(obj_suffix)',
1001-
'<(obj_path)<(obj_separator)node_platform.<(obj_suffix)',
1002-
'<(obj_path)<(obj_separator)node_url.<(obj_suffix)',
1003-
'<(obj_path)<(obj_separator)util.<(obj_suffix)',
1004-
'<(obj_path)<(obj_separator)string_bytes.<(obj_suffix)',
1005-
'<(obj_path)<(obj_separator)string_decoder.<(obj_suffix)',
1006-
'<(obj_path)<(obj_separator)string_search.<(obj_suffix)',
1007-
'<(obj_path)<(obj_separator)stream_base.<(obj_suffix)',
1008-
'<(obj_path)<(obj_separator)node_constants.<(obj_suffix)',
1009-
'<(obj_tracing_path)<(obj_separator)agent.<(obj_suffix)',
1010-
'<(obj_tracing_path)<(obj_separator)node_trace_buffer.<(obj_suffix)',
1011-
'<(obj_tracing_path)<(obj_separator)node_trace_writer.<(obj_suffix)',
1012-
'<(obj_tracing_path)<(obj_separator)trace_event.<(obj_suffix)',
1013-
'<(obj_gen_path)<(obj_separator)node_javascript.<(obj_suffix)',
1014-
],
1015-
1016958
'conditions': [
1017959
[ 'node_use_openssl=="true"', {
1018-
'conditions': [
1019-
['node_target_type!="static_library"', {
1020-
'libraries': [
1021-
'<(obj_path)<(obj_separator)node_crypto.<(obj_suffix)',
1022-
'<(obj_path)<(obj_separator)node_crypto_bio.<(obj_suffix)',
1023-
'<(obj_path)<(obj_separator)node_crypto_clienthello.<(obj_suffix)',
1024-
'<(obj_path)<(obj_separator)tls_wrap.<(obj_suffix)',
1025-
],
1026-
}],
1027-
],
1028960
'defines': [
1029961
'HAVE_OPENSSL=1',
1030962
],
1031963
}],
1032964
[ 'node_use_perfctr=="true"', {
1033965
'defines': [ 'HAVE_PERFCTR=1' ],
1034-
'libraries': [
1035-
'<(obj_path)<(obj_separator)node_counters.<(obj_suffix)',
1036-
'<(obj_path)<(obj_separator)'
1037-
'node_win32_perfctr_provider.<(obj_suffix)',
1038-
],
1039966
}],
1040967
['v8_enable_inspector==1', {
1041968
'sources': [
1042969
'test/cctest/test_inspector_socket.cc',
1043970
'test/cctest/test_inspector_socket_server.cc'
1044971
],
1045-
'conditions': [
1046-
['node_target_type!="static_library"', {
1047-
'libraries': [
1048-
'<(obj_path)<(obj_separator)inspector_agent.<(obj_suffix)',
1049-
'<(obj_path)<(obj_separator)inspector_io.<(obj_suffix)',
1050-
'<(obj_path)<(obj_separator)inspector_js_api.<(obj_suffix)',
1051-
'<(obj_path)<(obj_separator)inspector_socket.<(obj_suffix)',
1052-
'<(obj_path)<(obj_separator)inspector_socket_server.<(obj_suffix)',
1053-
],
1054-
}],
1055-
],
1056972
'defines': [
1057973
'HAVE_INSPECTOR=1',
1058974
],
1059-
}],
1060-
[ 'node_use_dtrace=="true" and node_target_type!="static_library"', {
1061-
'libraries': [
1062-
'<(obj_path)<(obj_separator)node_dtrace.<(obj_suffix)',
1063-
],
1064-
'conditions': [
1065-
['OS!="mac" and OS!="linux"', {
1066-
'libraries': [
1067-
'<(obj_path)<(obj_separator)node_dtrace_provider.<(obj_suffix)',
1068-
'<(obj_path)<(obj_separator)node_dtrace_ustack.<(obj_suffix)',
1069-
]
1070-
}],
1071-
['OS=="linux"', {
1072-
'libraries': [
1073-
'<(SHARED_INTERMEDIATE_DIR)<(obj_separator)'
1074-
'node_dtrace_provider.<(obj_suffix)',
1075-
]
1076-
}],
1077-
],
1078-
}, {
1079-
'conditions': [
1080-
[ 'node_use_etw=="true" and OS=="win"', {
1081-
'libraries': [
1082-
'<(obj_path)<(obj_separator)node_dtrace.<(obj_suffix)',
1083-
'<(obj_path)<(obj_separator)'
1084-
'node_win32_etw_provider.<(obj_suffix)',
1085-
],
1086-
}]
1087-
]
1088-
}],
1089-
[ 'OS=="win" and node_target_type!="static_library"', {
1090-
'libraries': [
1091-
'<(obj_path)<(obj_separator)backtrace_win32.<(obj_suffix)',
1092-
],
1093975
}, {
1094-
'conditions': [
1095-
['node_target_type!="static_library"', {
1096-
'libraries': [
1097-
'<(obj_path)<(obj_separator)backtrace_posix.<(obj_suffix)',
1098-
],
1099-
}],
1100-
],
976+
'defines': [ 'HAVE_INSPECTOR=0' ]
1101977
}],
1102978
['OS=="solaris"', {
1103979
'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]
1104980
}],
1105-
]
981+
],
1106982
}
1107983
], # end targets
1108984

test/cctest/node_module_reg.cc

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/cctest/test_node_postmortem_metadata.cc

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
#include "node_postmortem_metadata.cc"
2-
31
#include "gtest/gtest.h"
42
#include "node.h"
53
#include "node_internals.h"
64
#include "node_test_fixture.h"
75
#include "req_wrap-inl.h"
86
#include "tracing/agent.h"
97
#include "v8.h"
8+
#include "v8abbr.h"
9+
10+
extern "C" {
11+
extern uintptr_t
12+
nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap;
13+
extern uintptr_t
14+
nodedbg_offset_Environment__handle_wrap_queue___Environment_HandleWrapQueue;
15+
extern int debug_symbols_generated;
16+
extern int nodedbg_const_Environment__kContextEmbedderDataIndex__int;
17+
extern uintptr_t
18+
nodedbg_offset_Environment_HandleWrapQueue__head___ListNode_HandleWrap;
19+
extern uintptr_t
20+
nodedbg_offset_Environment__req_wrap_queue___Environment_ReqWrapQueue;
21+
extern uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
22+
extern uintptr_t nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
23+
extern uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
24+
extern uintptr_t nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
25+
extern uintptr_t
26+
nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
27+
extern uintptr_t
28+
nodedbg_offset_BaseObject__persistent_handle___v8_Persistent_v8_Object;
29+
}
1030

1131

1232
class DebugSymbolsTest : public EnvironmentTestFixture {};

0 commit comments

Comments
 (0)