MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

tools/build_addons.py:106–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 raise RuntimeError('Cannot find out dir, did you run build?')
105
106def main():
107 if sys.platform == 'cygwin':
108 raise RuntimeError('This script does not support running with cygwin python.')
109
110 parser = argparse.ArgumentParser(
111 description='Install headers and rebuild child directories')
112 parser.add_argument('target', help='target directory to build addons')
113 parser.add_argument('--headers-dir',
114 help='path to node headers directory, if not specified '
115 'new headers will be generated for building',
116 default=None)
117 parser.add_argument('--out-dir', help='path to the output directory',
118 default=None)
119 parser.add_argument('--loglevel', help='loglevel of node-gyp',
120 default='silent')
121 parser.add_argument('--skip-tests', help='skip building tests',
122 default='')
123 parser.add_argument('--only-tests', help='only build tests in the list',
124 default='')
125 parser.add_argument('--node-gyp', help='path to node-gyp script',
126 default='deps/npm/node_modules/node-gyp/bin/node-gyp.js')
127 parser.add_argument('--is-win', help='build for Windows target',
128 action='store_true', default=(sys.platform == 'win32'))
129 parser.add_argument('--config', help='build config (Release or Debug)',
130 default='Release')
131 args, unknown_args = parser.parse_known_args()
132
133 if not args.out_dir:
134 args.out_dir = get_default_out_dir(args)
135
136 exit_code = 1
137 if args.headers_dir:
138 exit_code = rebuild_addons(args)
139 else:
140 # When --headers-dir is not specified, generate headers into a temp dir and
141 # build with the new headers.
142 try:
143 args.headers_dir = tempfile.mkdtemp()
144 generate_headers(args.headers_dir, unknown_args)
145 exit_code = rebuild_addons(args)
146 finally:
147 shutil.rmtree(args.headers_dir)
148 return exit_code
149
150if __name__ == '__main__':
151 sys.exit(main())

Callers 1

build_addons.pyFile · 0.70

Calls 5

get_default_out_dirFunction · 0.85
rebuild_addonsFunction · 0.85
mkdtempMethod · 0.80
generate_headersFunction · 0.70
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…