diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index a599b0f6e6c3cf..faa664b558c15d 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -226,9 +226,6 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, self.extra_gn_options = [] self.build_env = {} - if board == HostBoard.ARM64: - self.build_env['PKG_CONFIG_PATH'] = os.path.join(self.SysRootPath('SYSROOT_AARCH64'), 'lib/aarch64-linux-gnu/pkgconfig') - if enable_rpcs: self.extra_gn_options.append('import("//with_pw_rpc.gni")') @@ -348,6 +345,9 @@ def GnBuildArgs(self): raise Exception('Unknown host board type: %r' % self) def GnBuildEnv(self): + if self.board == HostBoard.ARM64: + self.build_env['PKG_CONFIG_PATH'] = os.path.join( + self.SysRootPath('SYSROOT_AARCH64'), 'lib/aarch64-linux-gnu/pkgconfig') return self.build_env def SysRootPath(self, name): @@ -366,20 +366,26 @@ def PreBuildCommand(self): if self.app == HostApp.TESTS and self.use_coverage: self._Execute(['ninja', '-C', self.output_dir, 'default'], title="Build-only") self._Execute(['find', os.path.join(self.output_dir, 'obj/src/'), '-depth', - '-name', 'tests', '-exec', 'rm -rf {} \;'], title="Cleanup unit tests") - self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), '--exclude', os.path.join(self.chip_dir, 'third_party/*'), '--exclude', '/usr/include/*', - '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") + '-name', 'tests', '-exec', 'rm -rf {} \\;'], title="Cleanup unit tests") + self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), + '--exclude', os.path.join(self.chip_dir, 'third_party/*'), + '--exclude', '/usr/include/*', + '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") def PostBuildCommand(self): if self.app == HostApp.TESTS and self.use_coverage: - self._Execute(['lcov', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), '--exclude', os.path.join(self.chip_dir, 'third_party/*'), '--exclude', '/usr/include/*', - '--output-file', os.path.join(self.coverage_dir, 'lcov_test.info')], title="Update coverage") + self._Execute(['lcov', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), + '--exclude', os.path.join(self.chip_dir, 'third_party/*'), + '--exclude', '/usr/include/*', + '--output-file', os.path.join(self.coverage_dir, 'lcov_test.info')], title="Update coverage") self._Execute(['lcov', '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_base.info'), '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_test.info'), '--output-file', os.path.join(self.coverage_dir, 'lcov_final.info') ], title="Final coverage info") self._Execute(['genhtml', os.path.join(self.coverage_dir, 'lcov_final.info'), '--output-directory', - os.path.join(self.coverage_dir, 'html')], title="HTML coverage") + os.path.join(self.coverage_dir, 'html')], title="HTML coverage") def build_outputs(self): outputs = {}