MCPcopy Create free account
hub / github.com/nodejs/node / find_build_directory

Function find_build_directory

deps/v8/tools/run_perf.py:744–769  ·  view source on GitHub ↗

Returns the location of d8 or node in the build output directory. This supports a seamless transition between legacy build location (out/Release) and new build location (out/build).

(base_path, arch)

Source from the content-addressed store, hash-verified

742
743
744def find_build_directory(base_path, arch):
745 """Returns the location of d8 or node in the build output directory.
746
747 This supports a seamless transition between legacy build location
748 (out/Release) and new build location (out/build).
749 """
750 def is_build(path):
751 # We support d8 or node as executables. We don't support testing on
752 # Windows.
753 return (os.path.isfile(os.path.join(path, 'd8')) or
754 os.path.isfile(os.path.join(path, 'node')))
755 possible_paths = [
756 # Location developer wrapper scripts is using.
757 '%s.release' % arch,
758 # Current build location on bots.
759 'build',
760 # Legacy build location on bots.
761 'Release',
762 ]
763 possible_paths = [os.path.join(base_path, p) for p in possible_paths]
764 actual_paths = list(filter(is_build, possible_paths))
765 assert actual_paths, 'No build directory found.'
766 assert len(
767 actual_paths
768 ) == 1, 'Found ambiguous build directories use --binary-override-path.'
769 return actual_paths[0]
770
771
772class CacheHandler:

Callers 1

MainFunction · 0.85

Calls 3

listFunction · 0.50
filterFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected