Skip to content

Commit

Permalink
update BUILD.gn for new files
Browse files Browse the repository at this point in the history
introduced in nodejs/node#29349
  • Loading branch information
codebytere committed Oct 16, 2019
1 parent 1b2fa04 commit 1e9c1aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ src_disable_node_use_v8_platform_in_node_options.patch
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
inherit_electron_crashpad_pipe_name_in_child_process.patch
fixme_revert_crypto_add_support_for_rsa-pss_keys.patch
chore_re-add_compileandcall_this_should_be_added_as_a_helper_in.patch
fix_extern_the_nativemoduleenv_and_options_parser_for_debug_builds.patch
Expand Down
19 changes: 12 additions & 7 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792f2119fcb
index 0000000000000000000000000000000000000000..bfe6555be5239c6d9cad59e8b845638d50f31ee3
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,442 @@
@@ -0,0 +1,447 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
Expand Down Expand Up @@ -1051,6 +1051,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
+ "lib/internal/fixed_queue.js",
+ "lib/internal/freelist.js",
+ "lib/internal/freeze_intrinsics.js",
+ "lib/internal/fs/dir.js",
+ "lib/internal/fs/promises.js",
+ "lib/internal/fs/read_file_context.js",
+ "lib/internal/fs/rimraf.js",
Expand Down Expand Up @@ -1105,6 +1106,8 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
+ "lib/internal/repl/history.js",
+ "lib/internal/repl/utils.js",
+ "lib/internal/socket_list.js",
+ "lib/internal/source_map/source_map.js",
+ "lib/internal/source_map/source_map_cache.js",
+ "lib/internal/test/binding.js",
+ "lib/internal/timers.js",
+ "lib/internal/tls.js",
Expand Down Expand Up @@ -1190,6 +1193,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
+ "src/node_constants.cc",
+ "src/node_contextify.cc",
+ "src/node_credentials.cc",
+ "src/node_dir.cc",
+ "src/node_domain.cc",
+ "src/node_env_var.cc",
+ "src/node_errors.cc",
Expand Down Expand Up @@ -1271,6 +1275,7 @@ index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792
+ "src/node_constants.h",
+ "src/node_context_data.h",
+ "src/node_contextify.h",
+ "src/node_dir.h",
+ "src/node_errors.h",
+ "src/node_file.h",
+ "src/node_http_parser_impl.h",
Expand Down Expand Up @@ -1534,7 +1539,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index 2d105483ba10533d992de3265121e6ab9edce2ed..8a8fd5f7fad4a69b65e06d67225a398385d3bbbf 100644
index a61a186edd3c92d6f0bd760a9990b5c8ed57e6fa..e4963fdfd9b93a6f50a4f1035f63e95432dd8d8e 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down Expand Up @@ -1666,25 +1671,25 @@ index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2e
+
+ out_file.writelines(new_contents)
diff --git a/tools/js2c.py b/tools/js2c.py
index 0189dd762919162c8a897d291bdda3cfd600eab6..7b3e90af88b873c32f8ed51712f7dfdff3c1c706 100755
index 1346b2a87046d3472577875c887b3b44a63280ed..752344d68c3f63b4c5e491b33d4576ed48f8b74f 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -261,9 +261,17 @@ def NormalizeFileName(filename):
@@ -261,10 +261,18 @@ def NormalizeFileName(filename):
split = ['internal'] + split
else: # `lib/**/*.js` so drop the 'lib' part
split = split[1:]
+
if len(split):
filename = '/'.join(split)
- return os.path.splitext(filename)[0]
+
+ # Electron-specific: when driving the node build from Electron, we generate
+ # config.gypi in a separate directory and pass the absolute path to js2c.
+ # This overrides the absolute path so that the variable names in the
+ # generated C are as if it was in the root node directory.
+ if filename.endswith("/config.gypi"):
+ filename = "config.gypi"
+
+ return os.path.splitext(filename)[0]

def JS2C(source_files, target):
Expand Down

0 comments on commit 1e9c1aa

Please sign in to comment.