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

sanity_checks: Also disable builds by CPU family #1597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 23 additions & 2 deletions tools/sanity_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,19 +335,40 @@ def check_source_url(self, name: str, wrap_section: configparser.SectionProxy, v
self.assertTrue(version in source_url or version_ in source_url,
f'Version {version} not found in {source_url}')

@classmethod
def get_cpu_family(cls, builddir: str = '_build'):
if not hasattr(cls, "_cpu_family"):
options = ['-Dwraps=[]']
if Path(builddir, 'meson-private', 'cmd_line.txt').exists():
options.append('--wipe')
res = subprocess.run(['meson', 'setup', *options, builddir], check=True)
with Path(builddir, 'meson-logs', 'meson-log.txt').open() as log_f:
for line in log_f:
if line.startswith('Host machine cpu family:'):
cls._cpu_family = line.split(':', maxsplit=1)[1].strip()
break
else:
raise Exception('Unable to determine cpu family from Meson logs')
return cls._cpu_family

def check_new_release(self, name: str, builddir: str = '_build', deps=None, progs=None):
print() # Ensure output starts from an empty line (we're running under unittest).
if is_msys():
system = 'msys2'
else:
system = platform.system().lower()
cpu_family = self.get_cpu_family(builddir)
sys_cpu = f"{system}-{cpu_family}"
ci = self.ci_config.get(name, {})
# kept for backwards compatibility
expect_working = True
build_on = ci.get('build_on', {})
if ci.get('linux_only', False) and not is_linux():
expect_working = False
elif not ci.get('build_on', {}).get(system, True):
expect_working = False
elif sys_cpu in build_on:
expect_working = bool(build_on[sys_cpu])
else:
expect_working = bool(build_on.get(system, True) and build_on.get(cpu_family, True))

if deps:
skip_deps = ci.get('skip_dependency_check', [])
Expand Down
Loading