Skip to content

Commit

Permalink
deps,build: compute torque_outputs in v8.gyp
Browse files Browse the repository at this point in the history
PR-URL: #26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
refack committed Mar 28, 2019
1 parent 4507246 commit fff922a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 65 deletions.
5 changes: 5 additions & 0 deletions deps/v8/gypfiles/ForEachFormat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2019 Refael Ackeramnn<refack@gmail.com>. All rights reserved.
# Use of this source code is governed by an MIT-style license.
def DoMain(args):
format_str = args.pop(0)
return ' '.join(format_str % a for a in args)
67 changes: 2 additions & 65 deletions deps/v8/gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -92,71 +92,8 @@
# "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h",
# ]
# }
'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root',
'torque_outputs': [
'<(torque_output_root)/torque-generated/builtins-arguments-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-arguments-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-copywithin-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-copywithin-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-filter-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-filter-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-find-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-find-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-findindex-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-findindex-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-foreach-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-foreach-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-join-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-join-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-map-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-map-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-of-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-of-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-reverse-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-reverse-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-slice-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-slice-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-splice-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-splice-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-unshift-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-unshift-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-array-lastindexof-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-array-lastindexof-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-base-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-base-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-collections-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-collections-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-data-view-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-data-view-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-extras-utils-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-extras-utils-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-growable-fixed-array-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-growable-fixed-array-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-iterator-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-iterator-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-object-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-object-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-string-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-string-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-filter-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-filter-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-foreach-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-foreach-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-reduce-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-reduce-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-reduceright-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-reduceright-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-slice-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-slice-from-dsl-gen.h',
'<(torque_output_root)/torque-generated/builtins-typed-array-subarray-from-dsl-gen.cc',
'<(torque_output_root)/torque-generated/builtins-typed-array-subarray-from-dsl-gen.h',
],
'torque_outputs': [ '<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-from-dsl-gen.cc" <@(torque_namespaces))' ],
'torque_outputs+': [ '<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-from-dsl-gen.h" <@(torque_namespaces))' ],
'torque_generated_pure_headers': [
'<(torque_output_root)/torque-generated/builtin-definitions-from-dsl.h',
'<(torque_output_root)/torque-generated/class-definitions-from-dsl.h',
Expand Down
2 changes: 2 additions & 0 deletions tools/gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ def ExpandVariables(input, phase, variables, build_file):
oldwd = os.getcwd() # Python doesn't like os.open('.'): no fchdir.
if build_file_dir: # build_file_dir may be None (see above).
os.chdir(build_file_dir)
sys.path.append(os.getcwd())
try:

parsed_contents = shlex.split(contents)
Expand All @@ -891,6 +892,7 @@ def ExpandVariables(input, phase, variables, build_file):
"module (%s): %s" % (parsed_contents[0], e))
replacement = str(py_module.DoMain(parsed_contents[1:])).rstrip()
finally:
sys.path.pop()
os.chdir(oldwd)
assert replacement != None
elif command_string:
Expand Down

0 comments on commit fff922a

Please sign in to comment.