Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not raise exception when listing targets #22868

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")')

Expand Down Expand Up @@ -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):
Expand All @@ -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 = {}
Expand Down