Skip to content

Commit fff922a

Browse files
committed
deps,build: compute torque_outputs in v8.gyp
PR-URL: #26685 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 4507246 commit fff922a

File tree

3 files changed

+9
-65
lines changed

3 files changed

+9
-65
lines changed

deps/v8/gypfiles/ForEachFormat.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2019 Refael Ackeramnn<[email protected]>. All rights reserved.
2+
# Use of this source code is governed by an MIT-style license.
3+
def DoMain(args):
4+
format_str = args.pop(0)
5+
return ' '.join(format_str % a for a in args)

deps/v8/gypfiles/v8.gyp

+2-65
Original file line numberDiff line numberDiff line change
@@ -92,71 +92,8 @@
9292
# "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h",
9393
# ]
9494
# }
95-
'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root',
96-
'torque_outputs': [
97-
'<(torque_output_root)/torque-generated/builtins-arguments-from-dsl-gen.cc',
98-
'<(torque_output_root)/torque-generated/builtins-arguments-from-dsl-gen.h',
99-
'<(torque_output_root)/torque-generated/builtins-array-from-dsl-gen.cc',
100-
'<(torque_output_root)/torque-generated/builtins-array-from-dsl-gen.h',
101-
'<(torque_output_root)/torque-generated/builtins-array-copywithin-from-dsl-gen.cc',
102-
'<(torque_output_root)/torque-generated/builtins-array-copywithin-from-dsl-gen.h',
103-
'<(torque_output_root)/torque-generated/builtins-array-filter-from-dsl-gen.cc',
104-
'<(torque_output_root)/torque-generated/builtins-array-filter-from-dsl-gen.h',
105-
'<(torque_output_root)/torque-generated/builtins-array-find-from-dsl-gen.cc',
106-
'<(torque_output_root)/torque-generated/builtins-array-find-from-dsl-gen.h',
107-
'<(torque_output_root)/torque-generated/builtins-array-findindex-from-dsl-gen.cc',
108-
'<(torque_output_root)/torque-generated/builtins-array-findindex-from-dsl-gen.h',
109-
'<(torque_output_root)/torque-generated/builtins-array-foreach-from-dsl-gen.cc',
110-
'<(torque_output_root)/torque-generated/builtins-array-foreach-from-dsl-gen.h',
111-
'<(torque_output_root)/torque-generated/builtins-array-join-from-dsl-gen.cc',
112-
'<(torque_output_root)/torque-generated/builtins-array-join-from-dsl-gen.h',
113-
'<(torque_output_root)/torque-generated/builtins-array-map-from-dsl-gen.cc',
114-
'<(torque_output_root)/torque-generated/builtins-array-map-from-dsl-gen.h',
115-
'<(torque_output_root)/torque-generated/builtins-array-of-from-dsl-gen.cc',
116-
'<(torque_output_root)/torque-generated/builtins-array-of-from-dsl-gen.h',
117-
'<(torque_output_root)/torque-generated/builtins-array-reverse-from-dsl-gen.cc',
118-
'<(torque_output_root)/torque-generated/builtins-array-reverse-from-dsl-gen.h',
119-
'<(torque_output_root)/torque-generated/builtins-array-slice-from-dsl-gen.cc',
120-
'<(torque_output_root)/torque-generated/builtins-array-slice-from-dsl-gen.h',
121-
'<(torque_output_root)/torque-generated/builtins-array-splice-from-dsl-gen.cc',
122-
'<(torque_output_root)/torque-generated/builtins-array-splice-from-dsl-gen.h',
123-
'<(torque_output_root)/torque-generated/builtins-array-unshift-from-dsl-gen.cc',
124-
'<(torque_output_root)/torque-generated/builtins-array-unshift-from-dsl-gen.h',
125-
'<(torque_output_root)/torque-generated/builtins-array-lastindexof-from-dsl-gen.cc',
126-
'<(torque_output_root)/torque-generated/builtins-array-lastindexof-from-dsl-gen.h',
127-
'<(torque_output_root)/torque-generated/builtins-base-from-dsl-gen.cc',
128-
'<(torque_output_root)/torque-generated/builtins-base-from-dsl-gen.h',
129-
'<(torque_output_root)/torque-generated/builtins-collections-from-dsl-gen.cc',
130-
'<(torque_output_root)/torque-generated/builtins-collections-from-dsl-gen.h',
131-
'<(torque_output_root)/torque-generated/builtins-data-view-from-dsl-gen.cc',
132-
'<(torque_output_root)/torque-generated/builtins-data-view-from-dsl-gen.h',
133-
'<(torque_output_root)/torque-generated/builtins-extras-utils-from-dsl-gen.cc',
134-
'<(torque_output_root)/torque-generated/builtins-extras-utils-from-dsl-gen.h',
135-
'<(torque_output_root)/torque-generated/builtins-growable-fixed-array-from-dsl-gen.cc',
136-
'<(torque_output_root)/torque-generated/builtins-growable-fixed-array-from-dsl-gen.h',
137-
'<(torque_output_root)/torque-generated/builtins-iterator-from-dsl-gen.cc',
138-
'<(torque_output_root)/torque-generated/builtins-iterator-from-dsl-gen.h',
139-
'<(torque_output_root)/torque-generated/builtins-object-from-dsl-gen.cc',
140-
'<(torque_output_root)/torque-generated/builtins-object-from-dsl-gen.h',
141-
'<(torque_output_root)/torque-generated/builtins-string-from-dsl-gen.cc',
142-
'<(torque_output_root)/torque-generated/builtins-string-from-dsl-gen.h',
143-
'<(torque_output_root)/torque-generated/builtins-typed-array-from-dsl-gen.cc',
144-
'<(torque_output_root)/torque-generated/builtins-typed-array-from-dsl-gen.h',
145-
'<(torque_output_root)/torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.cc',
146-
'<(torque_output_root)/torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.h',
147-
'<(torque_output_root)/torque-generated/builtins-typed-array-filter-from-dsl-gen.cc',
148-
'<(torque_output_root)/torque-generated/builtins-typed-array-filter-from-dsl-gen.h',
149-
'<(torque_output_root)/torque-generated/builtins-typed-array-foreach-from-dsl-gen.cc',
150-
'<(torque_output_root)/torque-generated/builtins-typed-array-foreach-from-dsl-gen.h',
151-
'<(torque_output_root)/torque-generated/builtins-typed-array-reduce-from-dsl-gen.cc',
152-
'<(torque_output_root)/torque-generated/builtins-typed-array-reduce-from-dsl-gen.h',
153-
'<(torque_output_root)/torque-generated/builtins-typed-array-reduceright-from-dsl-gen.cc',
154-
'<(torque_output_root)/torque-generated/builtins-typed-array-reduceright-from-dsl-gen.h',
155-
'<(torque_output_root)/torque-generated/builtins-typed-array-slice-from-dsl-gen.cc',
156-
'<(torque_output_root)/torque-generated/builtins-typed-array-slice-from-dsl-gen.h',
157-
'<(torque_output_root)/torque-generated/builtins-typed-array-subarray-from-dsl-gen.cc',
158-
'<(torque_output_root)/torque-generated/builtins-typed-array-subarray-from-dsl-gen.h',
159-
],
95+
'torque_outputs': [ '<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-from-dsl-gen.cc" <@(torque_namespaces))' ],
96+
'torque_outputs+': [ '<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-from-dsl-gen.h" <@(torque_namespaces))' ],
16097
'torque_generated_pure_headers': [
16198
'<(torque_output_root)/torque-generated/builtin-definitions-from-dsl.h',
16299
'<(torque_output_root)/torque-generated/class-definitions-from-dsl.h',

tools/gyp/pylib/gyp/input.py

+2
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ def ExpandVariables(input, phase, variables, build_file):
881881
oldwd = os.getcwd() # Python doesn't like os.open('.'): no fchdir.
882882
if build_file_dir: # build_file_dir may be None (see above).
883883
os.chdir(build_file_dir)
884+
sys.path.append(os.getcwd())
884885
try:
885886

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

0 commit comments

Comments
 (0)