From 3b5773fee389c52077bd9f2dd324739af27fb6b5 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Sun, 24 Mar 2019 22:58:29 -0400 Subject: [PATCH] build,deps: move gypfiles out 2/2 - moving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * move all used files to `tools/v8_gypfiles` directory * fix references in node configuration PR-URL: https://github.com/nodejs/node/pull/26685 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Refael Ackermann --- .flake8 | 3 + .gitignore | 3 +- Makefile | 12 ++- common.gypi | 19 +--- deps/v8/gypfiles/OWNERS | 1 - deps/v8/gypfiles/README.txt | 9 -- node.gypi | 14 +-- .../v8_gypfiles}/ForEachFormat.py | 0 .../v8_gypfiles/broken}/all.gyp | 0 .../v8_gypfiles/broken}/coverage_wrapper.py | 0 .../v8_gypfiles/broken}/gyp_environment.py | 0 .../v8_gypfiles/broken}/gyp_v8 | 5 +- .../v8_gypfiles/broken}/gyp_v8.py | 0 .../v8_gypfiles/broken}/mac/asan.gyp | 0 .../v8_gypfiles/broken}/mkgrokdump.gyp | 0 .../v8_gypfiles/broken}/parser-shell.gyp | 0 .../v8_gypfiles/broken}/samples.gyp | 0 .../broken}/set_clang_warning_flags.gypi | 0 .../v8_gypfiles/broken}/shim_headers.gypi | 0 .../v8_gypfiles/broken}/standalone.gypi | 0 .../v8_gypfiles/broken}/sysroot_ld_flags.sh | 0 .../v8_gypfiles/broken}/v8-monolithic.gyp | 0 .../v8_gypfiles/broken}/v8vtune.gyp | 0 .../v8_gypfiles/broken}/verify_source_deps.py | 0 .../v8/gypfiles => tools/v8_gypfiles}/d8.gyp | 0 .../v8_gypfiles}/extras-libraries.cc | 0 .../v8_gypfiles}/features.gypi | 0 .../v8_gypfiles}/inspector.gypi | 88 +++++++++---------- .../v8_gypfiles}/toolchain.gypi | 0 .../v8/gypfiles => tools/v8_gypfiles}/v8.gyp | 9 +- .../v8_gypfiles}/v8_external_snapshot.gypi | 0 31 files changed, 67 insertions(+), 96 deletions(-) create mode 100644 .flake8 delete mode 100644 deps/v8/gypfiles/OWNERS delete mode 100644 deps/v8/gypfiles/README.txt rename {deps/v8/gypfiles => tools/v8_gypfiles}/ForEachFormat.py (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/all.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/coverage_wrapper.py (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/gyp_environment.py (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/gyp_v8 (99%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/gyp_v8.py (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/mac/asan.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/mkgrokdump.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/parser-shell.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/samples.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/set_clang_warning_flags.gypi (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/shim_headers.gypi (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/standalone.gypi (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/sysroot_ld_flags.sh (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/v8-monolithic.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/v8vtune.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles/broken}/verify_source_deps.py (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/d8.gyp (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/extras-libraries.cc (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/features.gypi (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/inspector.gypi (76%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/toolchain.gypi (100%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/v8.gyp (99%) rename {deps/v8/gypfiles => tools/v8_gypfiles}/v8_external_snapshot.gypi (100%) diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000000..859c4d3575d --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +exclude=.git,deps,lib,src,test/fixtures,tools/*_macros.py,tools/gyp,tools/inspector_protocol,tools/jinja2,tools/markupsafe,tools/pip,tools/v8_gypfiles/broken +select=E901,E999,F821,F822,F823 diff --git a/.gitignore b/.gitignore index 05e859c3066..41b7beb222d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ !.editorconfig !.eslintignore !.eslintrc.js +!.flake8 !.gitattributes !.github !.gitignore @@ -123,8 +124,6 @@ deps/uv/docs/src/guide/ # do not override V8's .gitignore !deps/v8/** # ignore VS compiler output unhandled by V8's .gitignore -deps/v8/gypfiles/Debug/ -deps/v8/gypfiles/Release/ deps/v8/third_party/eu-strip/ .DS_Store diff --git a/Makefile b/Makefile index 062d70b8445..346f355ea7a 100644 --- a/Makefile +++ b/Makefile @@ -123,10 +123,10 @@ with-code-cache: test-code-cache: with-code-cache $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) code-cache -out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ - deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \ - deps/v8/gypfiles/features.gypi deps/v8/gypfiles/v8.gyp node.gyp \ - config.gypi +out/Makefile: config.gypi common.gypi node.gyp \ + deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp \ + tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ + tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make config.gypi: configure configure.py @@ -1305,9 +1305,7 @@ ifneq ("","$(wildcard tools/pip/site-packages)") # Lints the Python code with flake8. # Flag the build if there are Python syntax errors or undefined names lint-py: - PYTHONPATH=tools/pip $(PYTHON) -m flake8 . \ - --count --show-source --statistics --select=E901,E999,F821,F822,F823 \ - --exclude=.git,deps,lib,src,test/fixtures,tools/*_macros.py,tools/gyp,tools/inspector_protocol,tools/jinja2,tools/markupsafe,tools/pip + PYTHONPATH=tools/pip $(PYTHON) -m flake8 --count --show-source --statistics . else lint-py: @echo "Python linting with flake8 is not avalible" diff --git a/common.gypi b/common.gypi index 80ed796a393..23ac7205baa 100644 --- a/common.gypi +++ b/common.gypi @@ -80,16 +80,10 @@ }], ['GENERATOR=="ninja"', { 'obj_dir': '<(PRODUCT_DIR)/obj', - 'conditions': [ - [ 'build_v8_with_gn=="true"', { - 'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/libv8_monolith.a', - }, { - 'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/libv8_base.a', - }], - ] + 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_base.a', }, { 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/obj.target/deps/v8/gypfiles/libv8_base.a', + 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_base.a', }], ['OS == "win"', { 'os_posix': 0, @@ -104,15 +98,6 @@ 'obj_dir%': '<(PRODUCT_DIR)/obj.target', 'v8_base': '<(PRODUCT_DIR)/libv8_base.a', }], - ['build_v8_with_gn == "true"', { - 'conditions': [ - ['GENERATOR == "ninja"', { - 'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/libv8_monolith.a', - }, { - 'v8_base': '<(PRODUCT_DIR)/obj.target/v8_monolith/geni/gn/obj/libv8_monolith.a', - }], - ], - }], ['openssl_fips != ""', { 'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)', }, { diff --git a/deps/v8/gypfiles/OWNERS b/deps/v8/gypfiles/OWNERS deleted file mode 100644 index 0e56af31294..00000000000 --- a/deps/v8/gypfiles/OWNERS +++ /dev/null @@ -1 +0,0 @@ -machenbach@chromium.org diff --git a/deps/v8/gypfiles/README.txt b/deps/v8/gypfiles/README.txt deleted file mode 100644 index 5f242ada342..00000000000 --- a/deps/v8/gypfiles/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -For build instructions, please refer to: - -https://code.google.com/p/v8/wiki/BuildingWithGYP - -TL;DR version on *nix: -$ make dependencies # Only needed once. -$ make ia32.release -j8 -$ make ia32.release.check # Optionally: run tests. - diff --git a/node.gypi b/node.gypi index 6d7547fe060..b53ccfd6beb 100644 --- a/node.gypi +++ b/node.gypi @@ -85,15 +85,9 @@ 'dependencies': [ 'deps/v8/gypfiles/d8.gyp:d8' ], }], [ 'node_use_bundled_v8=="true"', { - 'conditions': [ - [ 'build_v8_with_gn=="true"', { - 'dependencies': ['deps/v8/gypfiles/v8-monolithic.gyp:v8_monolith'], - }, { - 'dependencies': [ - 'deps/v8/gypfiles/v8.gyp:v8', - 'deps/v8/gypfiles/v8.gyp:v8_libplatform', - ], - }], + 'dependencies': [ + 'tools/v8_gypfiles/v8.gyp:v8', + 'tools/v8_gypfiles/v8.gyp:v8_libplatform', ], }], [ 'node_use_v8_platform=="true"', { @@ -132,7 +126,7 @@ target_arch=="ia32" or target_arch=="x32")', { 'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ], 'dependencies': [ - 'deps/v8/gypfiles/v8vtune.gyp:v8_vtune' + 'tools/v8_gypfiles/v8vtune.gyp:v8_vtune' ], }], [ 'node_no_browser_globals=="true"', { diff --git a/deps/v8/gypfiles/ForEachFormat.py b/tools/v8_gypfiles/ForEachFormat.py similarity index 100% rename from deps/v8/gypfiles/ForEachFormat.py rename to tools/v8_gypfiles/ForEachFormat.py diff --git a/deps/v8/gypfiles/all.gyp b/tools/v8_gypfiles/broken/all.gyp similarity index 100% rename from deps/v8/gypfiles/all.gyp rename to tools/v8_gypfiles/broken/all.gyp diff --git a/deps/v8/gypfiles/coverage_wrapper.py b/tools/v8_gypfiles/broken/coverage_wrapper.py similarity index 100% rename from deps/v8/gypfiles/coverage_wrapper.py rename to tools/v8_gypfiles/broken/coverage_wrapper.py diff --git a/deps/v8/gypfiles/gyp_environment.py b/tools/v8_gypfiles/broken/gyp_environment.py similarity index 100% rename from deps/v8/gypfiles/gyp_environment.py rename to tools/v8_gypfiles/broken/gyp_environment.py diff --git a/deps/v8/gypfiles/gyp_v8 b/tools/v8_gypfiles/broken/gyp_v8 similarity index 99% rename from deps/v8/gypfiles/gyp_v8 rename to tools/v8_gypfiles/broken/gyp_v8 index 62e13d86e6c..a0971cce36e 100644 --- a/deps/v8/gypfiles/gyp_v8 +++ b/tools/v8_gypfiles/broken/gyp_v8 @@ -32,14 +32,15 @@ import argparse import glob -import gyp_environment import os import platform import shlex -import subprocess import sys script_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.insert(0, script_dir) +import gyp_environment + v8_root = os.path.abspath(os.path.join(script_dir, os.pardir)) sys.path.insert(0, os.path.join(v8_root, 'tools', 'gyp', 'pylib')) diff --git a/deps/v8/gypfiles/gyp_v8.py b/tools/v8_gypfiles/broken/gyp_v8.py similarity index 100% rename from deps/v8/gypfiles/gyp_v8.py rename to tools/v8_gypfiles/broken/gyp_v8.py diff --git a/deps/v8/gypfiles/mac/asan.gyp b/tools/v8_gypfiles/broken/mac/asan.gyp similarity index 100% rename from deps/v8/gypfiles/mac/asan.gyp rename to tools/v8_gypfiles/broken/mac/asan.gyp diff --git a/deps/v8/gypfiles/mkgrokdump.gyp b/tools/v8_gypfiles/broken/mkgrokdump.gyp similarity index 100% rename from deps/v8/gypfiles/mkgrokdump.gyp rename to tools/v8_gypfiles/broken/mkgrokdump.gyp diff --git a/deps/v8/gypfiles/parser-shell.gyp b/tools/v8_gypfiles/broken/parser-shell.gyp similarity index 100% rename from deps/v8/gypfiles/parser-shell.gyp rename to tools/v8_gypfiles/broken/parser-shell.gyp diff --git a/deps/v8/gypfiles/samples.gyp b/tools/v8_gypfiles/broken/samples.gyp similarity index 100% rename from deps/v8/gypfiles/samples.gyp rename to tools/v8_gypfiles/broken/samples.gyp diff --git a/deps/v8/gypfiles/set_clang_warning_flags.gypi b/tools/v8_gypfiles/broken/set_clang_warning_flags.gypi similarity index 100% rename from deps/v8/gypfiles/set_clang_warning_flags.gypi rename to tools/v8_gypfiles/broken/set_clang_warning_flags.gypi diff --git a/deps/v8/gypfiles/shim_headers.gypi b/tools/v8_gypfiles/broken/shim_headers.gypi similarity index 100% rename from deps/v8/gypfiles/shim_headers.gypi rename to tools/v8_gypfiles/broken/shim_headers.gypi diff --git a/deps/v8/gypfiles/standalone.gypi b/tools/v8_gypfiles/broken/standalone.gypi similarity index 100% rename from deps/v8/gypfiles/standalone.gypi rename to tools/v8_gypfiles/broken/standalone.gypi diff --git a/deps/v8/gypfiles/sysroot_ld_flags.sh b/tools/v8_gypfiles/broken/sysroot_ld_flags.sh similarity index 100% rename from deps/v8/gypfiles/sysroot_ld_flags.sh rename to tools/v8_gypfiles/broken/sysroot_ld_flags.sh diff --git a/deps/v8/gypfiles/v8-monolithic.gyp b/tools/v8_gypfiles/broken/v8-monolithic.gyp similarity index 100% rename from deps/v8/gypfiles/v8-monolithic.gyp rename to tools/v8_gypfiles/broken/v8-monolithic.gyp diff --git a/deps/v8/gypfiles/v8vtune.gyp b/tools/v8_gypfiles/broken/v8vtune.gyp similarity index 100% rename from deps/v8/gypfiles/v8vtune.gyp rename to tools/v8_gypfiles/broken/v8vtune.gyp diff --git a/deps/v8/gypfiles/verify_source_deps.py b/tools/v8_gypfiles/broken/verify_source_deps.py similarity index 100% rename from deps/v8/gypfiles/verify_source_deps.py rename to tools/v8_gypfiles/broken/verify_source_deps.py diff --git a/deps/v8/gypfiles/d8.gyp b/tools/v8_gypfiles/d8.gyp similarity index 100% rename from deps/v8/gypfiles/d8.gyp rename to tools/v8_gypfiles/d8.gyp diff --git a/deps/v8/gypfiles/extras-libraries.cc b/tools/v8_gypfiles/extras-libraries.cc similarity index 100% rename from deps/v8/gypfiles/extras-libraries.cc rename to tools/v8_gypfiles/extras-libraries.cc diff --git a/deps/v8/gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi similarity index 100% rename from deps/v8/gypfiles/features.gypi rename to tools/v8_gypfiles/features.gypi diff --git a/deps/v8/gypfiles/inspector.gypi b/tools/v8_gypfiles/inspector.gypi similarity index 76% rename from deps/v8/gypfiles/inspector.gypi rename to tools/v8_gypfiles/inspector.gypi index b67b83de049..79e582cea9e 100644 --- a/deps/v8/gypfiles/inspector.gypi +++ b/tools/v8_gypfiles/inspector.gypi @@ -3,6 +3,9 @@ # found in the LICENSE file. { + 'includes': [ + '../../deps/v8/third_party/inspector_protocol/inspector_protocol.gypi', + ], 'variables': { 'inspector_protocol_path': '<(V8_ROOT)/third_party/inspector_protocol', 'inspector_path': '<(V8_ROOT)/src/inspector', @@ -83,48 +86,45 @@ '<(V8_ROOT)/src/inspector/wasm-translation.h', ] }, - 'includes': [ - '<(V8_ROOT)/third_party/inspector_protocol/inspector_protocol.gypi', - ], - 'include_dirs': [ - '<(inspector_generated_output_root)', - ], - 'actions': [ - { - 'action_name': 'protocol_compatibility', - 'inputs': [ - '<(inspector_path)/js_protocol.pdl', - ], - 'outputs': [ - '<@(inspector_generated_output_root)/src/js_protocol.stamp', - ], - 'action': [ - 'python', - '<(inspector_protocol_path)/check_protocol_compatibility.py', - '--stamp', '<@(_outputs)', - '<@(_inputs)', - ], - 'message': 'Checking inspector protocol compatibility', - }, - { - 'action_name': 'protocol_generated_sources', - 'inputs': [ - '<(inspector_path)/js_protocol.pdl', - '<(inspector_path)/inspector_protocol_config.json', - '<@(inspector_protocol_files)', - ], - 'outputs': [ - '<@(inspector_generated_sources)', - ], - 'process_outputs_as_sources': 1, - 'action': [ - 'python', - '<(inspector_protocol_path)/code_generator.py', - '--jinja_dir', '<(V8_ROOT)/third_party', - '--output_base', '<(inspector_generated_output_root)/src/inspector', - '--config', '<(inspector_path)/inspector_protocol_config.json', - ], - 'message': 'Generating inspector protocol sources from protocol json', - }, - ], + 'include_dirs': [ + '<(inspector_generated_output_root)', + ], + 'actions': [ + { + 'action_name': 'protocol_compatibility', + 'inputs': [ + '<(inspector_path)/js_protocol.pdl', + ], + 'outputs': [ + '<@(inspector_generated_output_root)/src/js_protocol.stamp', + ], + 'action': [ + 'python', + '<(inspector_protocol_path)/check_protocol_compatibility.py', + '--stamp', '<@(_outputs)', + '<@(_inputs)', + ], + 'message': 'Checking inspector protocol compatibility', + }, + { + 'action_name': 'protocol_generated_sources', + 'inputs': [ + '<(inspector_path)/js_protocol.pdl', + '<(inspector_path)/inspector_protocol_config.json', + '<@(inspector_protocol_files)', + ], + 'outputs': [ + '<@(inspector_generated_sources)', + ], + 'process_outputs_as_sources': 1, + 'action': [ + 'python', + '<(inspector_protocol_path)/code_generator.py', + '--jinja_dir', '<(V8_ROOT)/third_party', + '--output_base', '<(inspector_generated_output_root)/src/inspector', + '--config', '<(inspector_path)/inspector_protocol_config.json', + ], + 'message': 'Generating inspector protocol sources from protocol json', + }, + ], } diff --git a/deps/v8/gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi similarity index 100% rename from deps/v8/gypfiles/toolchain.gypi rename to tools/v8_gypfiles/toolchain.gypi diff --git a/deps/v8/gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp similarity index 99% rename from deps/v8/gypfiles/v8.gyp rename to tools/v8_gypfiles/v8.gyp index 549eae0158b..72a8dfe56e3 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -3,6 +3,7 @@ # found in the LICENSE file. { 'variables': { + 'V8_ROOT': '../../deps/v8', 'v8_code': 1, 'v8_random_seed%': 314159265, 'v8_vector_stores%': 0, @@ -397,8 +398,8 @@ }, ], ['OS=="win"', { - 'msvs_precompiled_header': '<(V8_ROOT)/<(V8_ROOT)/<(V8_ROOT)/tools/msvs/pch/v8_pch.h', - 'msvs_precompiled_source': '<(V8_ROOT)/<(V8_ROOT)/<(V8_ROOT)/tools/msvs/pch/v8_pch.cc', + 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', + 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', @@ -2025,8 +2026,8 @@ ], }], ['OS=="win"', { - 'msvs_precompiled_header': '<(V8_ROOT)/<(V8_ROOT)/<(V8_ROOT)/tools/msvs/pch/v8_pch.h', - 'msvs_precompiled_source': '<(V8_ROOT)/<(V8_ROOT)/<(V8_ROOT)/tools/msvs/pch/v8_pch.cc', + 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', + 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', diff --git a/deps/v8/gypfiles/v8_external_snapshot.gypi b/tools/v8_gypfiles/v8_external_snapshot.gypi similarity index 100% rename from deps/v8/gypfiles/v8_external_snapshot.gypi rename to tools/v8_gypfiles/v8_external_snapshot.gypi