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

Function files

tools/install.py:152–212  ·  view source on GitHub ↗
(options, action)

Source from the content-addressed store, hash-verified

150 action(options, files_in_path, subdir + os.path.sep)
151
152def files(options, action):
153 node_bin = 'node'
154 if options.is_win:
155 node_bin += '.exe'
156 action(options, [os.path.join(options.build_dir, node_bin)], os.path.join('bin', node_bin))
157
158 if 'true' == options.variables.get('node_shared'):
159 if options.is_win:
160 action(options, [os.path.join(options.build_dir, 'libnode.dll')], 'bin/libnode.dll')
161 action(options, [os.path.join(options.build_dir, 'libnode.lib')], 'lib/libnode.lib')
162 elif sys.platform == 'zos':
163 # GYP will output to lib.target; see _InstallableTargetInstallPath
164 # function in tools/gyp/pylib/gyp/generator/make.py
165 output_prefix = os.path.join(options.build_dir, 'lib.target')
166
167 output_lib = 'libnode.' + options.variables.get('shlib_suffix')
168 action(options, [os.path.join(output_prefix, output_lib)], os.path.join('lib', output_lib))
169
170 # create libnode.x that references libnode.so (C++ addons compat)
171 os.system(os.path.dirname(os.path.realpath(__file__)) +
172 '/zos/modifysidedeck.sh ' +
173 abspath(options.install_path, 'lib', output_lib) + ' ' +
174 abspath(options.install_path, 'lib/libnode.x') + ' libnode.so')
175
176 # install libnode.version.so
177 so_name = 'libnode.' + re.sub(r'\.x$', '.so', options.variables.get('shlib_suffix'))
178 action(options, [os.path.join(output_prefix, so_name)], options.variables.get('libdir') + '/' + so_name)
179
180 # create symlink of libnode.so -> libnode.version.so (C++ addons compat)
181 link_path = abspath(options.install_path, 'lib/libnode.so')
182 try_symlink(options, so_name, link_path)
183 else:
184 # Ninja and Makefile generators output the library in different directories;
185 # find out which one we have, and install first found
186 output_lib_name = 'libnode.' + options.variables.get('shlib_suffix')
187 output_lib_candidate_paths = [
188 os.path.join(options.build_dir, output_lib_name),
189 os.path.join(options.build_dir, "lib", output_lib_name),
190 ]
191 try:
192 output_lib = next(filter(os.path.exists, output_lib_candidate_paths))
193 except StopIteration as not_found:
194 raise RuntimeError("No libnode.so to install!") from not_found
195 action(options, [output_lib],
196 os.path.join(options.variables.get('libdir'), output_lib_name))
197
198 action(options, [os.path.join(options.v8_dir, 'tools/gdbinit')], 'share/doc/node/')
199 action(options, [os.path.join(options.v8_dir, 'tools/lldb_commands.py')], 'share/doc/node/')
200
201 if 'openbsd' in sys.platform:
202 action(options, ['doc/node.1'], 'man/man1/')
203 else:
204 action(options, ['doc/node.1'], 'share/man/man1/')
205
206 if 'true' == options.variables.get('node_install_npm'):
207 npm_files(options, action)
208
209 if 'true' == options.variables.get('node_install_corepack'):

Callers 1

runFunction · 0.85

Calls 11

actionFunction · 0.85
abspathFunction · 0.85
try_symlinkFunction · 0.85
npm_filesFunction · 0.85
corepack_filesFunction · 0.85
headersFunction · 0.85
getMethod · 0.65
nextFunction · 0.50
filterFunction · 0.50
joinMethod · 0.45
realpathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…