MCPcopy Create free account
hub / github.com/comaps/comaps / build

Method build

tools/python/routing/src/utils.py:162–177  ·  view source on GitHub ↗
(self, *, aim, binary_cache_suffix=None, cmake_options="")

Source from the content-addressed store, hash-verified

160 self.hash = hash
161
162 def build(self, *, aim, binary_cache_suffix=None, cmake_options=""):
163 os.chdir(self.build_dir)
164 binary_path = self._get_cached_binary_name(binary=aim, binary_cache_suffix=binary_cache_suffix)
165 if os.path.exists(binary_path):
166 LOG.info(f'Found cached binary: {binary_path}')
167 return
168
169 branch_hash = get_branch_hash_name(branch=self.branch, hash=self.hash)
170 output_prefix = os.path.join(self.build_dir, branch_hash + '_')
171
172 cmake_cmd = f'{self.cmake_cmd} {self.omim_path} {cmake_options}'
173 self._run_system(cmd=cmake_cmd, output_file=output_prefix + 'cmake_run.log', log_cmd=True)
174 make_cmd = f'make -j{self.cpu_count} {aim}'
175 self._run_system(cmd=make_cmd, output_file=output_prefix + 'make_run.log', log_cmd=True)
176 LOG.info(f'Build {aim} done')
177 self._run_system(cmd=f'cp {aim} {binary_path}')
178
179 def run(self, *, binary, binary_cache_suffix=None, args, env=None, output_file=None, log_error_code=True):
180 binary_path = self._get_cached_binary_name(binary=binary, binary_cache_suffix=binary_cache_suffix)

Callers 3

mainFunction · 0.95
run_routes_builder_toolFunction · 0.45
run_heap_comparisonFunction · 0.45

Calls 4

_run_systemMethod · 0.95
get_branch_hash_nameFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected