From 92a5c0ca49043320a37e39bd702a72d677202aea Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Tue, 28 Jan 2025 09:23:25 -0800 Subject: [PATCH] deal with CI that does -DUSE_CPU_EXTENSIONS=OFF --- bin/system_info/print_system_info.c | 6 ++++++ bin/system_info/test-print-system-info.py | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/bin/system_info/print_system_info.c b/bin/system_info/print_system_info.c index aac1b570f..5197e5d85 100644 --- a/bin/system_info/print_system_info.c +++ b/bin/system_info/print_system_info.c @@ -53,6 +53,12 @@ int main(void) { fprintf(stdout, " 'amd_bmi2': %s\n", aws_cpu_has_feature(AWS_CPU_FEATURE_BMI2) ? "true" : "false"); fprintf(stdout, " }\n"); +#if defined(AWS_USE_CPU_EXTENSIONS) + fprintf(stdout, " 'use cpu extensions': true\n"); +#else + fprintf(stdout, " 'use cpu extensions': false\n"); +#endif + fprintf(stdout, "}\n"); aws_system_environment_release(env); aws_logger_clean_up(&logger); diff --git a/bin/system_info/test-print-system-info.py b/bin/system_info/test-print-system-info.py index cf0145332..027cf2cf9 100755 --- a/bin/system_info/test-print-system-info.py +++ b/bin/system_info/test-print-system-info.py @@ -114,6 +114,14 @@ def detect_features_from_app(app_path: Path) -> Dict[str, bool]: name = m.group(1) is_present = m.group(2) == 'true' features[name] = is_present + + # if aws-c-common compiled with -DUSE_CPU_EXTENSIONS=OFF, skip this this test + for line in lines: + m = re.search(f"'use cpu extensions': false", line) + if m: + print("SKIP TEST: aws-c-common compiled with -DUSE_CPU_EXTENSIONS=OFF") + exit(0) + if not features: raise RuntimeError("Cannot find features text in stdout ???")