Skip to content

Commit

Permalink
tc_build: llvm: Move use of build_targets out of ninja_cmd
Browse files Browse the repository at this point in the history
Otherwise, they will get added to each invocation of ninja. build_target
should have been added to just the 'self.run_cmd(ninja_cmd)'. While this
does not (currently) cause any problems, it is unnecessary to specify
the base build targets on each subsequent invocation of ninja because
they will have already been built.

To make it clearer for the future, rename ninja_cmd to base_ninja_cmd.

Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Nov 8, 2023
1 parent 8c22ecd commit c6765eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tc_build/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ def build(self):
raise RuntimeError('BOLT requested without a builder?')

build_start = time.time()
ninja_cmd = ['ninja', '-C', self.folders.build, *self.build_targets]
self.run_cmd(ninja_cmd)
base_ninja_cmd = ['ninja', '-C', self.folders.build]
self.run_cmd([*base_ninja_cmd, *self.build_targets])

if self.check_targets:
check_targets = [f"check-{target}" for target in self.check_targets]
self.run_cmd([*ninja_cmd, *check_targets])
self.run_cmd([*base_ninja_cmd, *check_targets])

tc_build.utils.print_info(f"Build duration: {tc_build.utils.get_duration(build_start)}")

Expand All @@ -160,7 +160,7 @@ def build(self):
install_targets = [f"install-{target}" for target in self.install_targets]
else:
install_targets = ['install']
self.run_cmd([*ninja_cmd, *install_targets], capture_output=True)
self.run_cmd([*base_ninja_cmd, *install_targets], capture_output=True)
tc_build.utils.create_gitignore(self.folders.install)

def can_use_perf(self):
Expand Down

0 comments on commit c6765eb

Please sign in to comment.