From 770c0128dd02863ed37449a36512ee8eccc5f004 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 13 Aug 2025 14:16:02 +0100 Subject: [PATCH] Revert "Handle non-Apple packaged GCC versions (#34)" This reverts commit 0e9a3ae0f9e0e0e0eeb364ab4b52b569d6bea471. --- lnt/testing/util/compilers.py | 9 +++----- .../FakeCompilers/fakecompiler.py | 22 ------------------- tests/SharedInputs/FakeCompilers/gcc-debian | 1 - tests/SharedInputs/FakeCompilers/gcc-trunk | 1 - tests/testing/Compilers.py | 16 -------------- 5 files changed, 3 insertions(+), 46 deletions(-) delete mode 120000 tests/SharedInputs/FakeCompilers/gcc-debian delete mode 120000 tests/SharedInputs/FakeCompilers/gcc-trunk diff --git a/lnt/testing/util/compilers.py b/lnt/testing/util/compilers.py index 574f4ffc..a232632a 100644 --- a/lnt/testing/util/compilers.py +++ b/lnt/testing/util/compilers.py @@ -76,8 +76,7 @@ def get_cc_info(path, cc_flags=[]): logger.error("unable to find compiler version: %r: %r" % (cc, cc_version)) else: - m = re.match(r'(.*) version ([^ ]*) (?:[0-9]+ )?+(\([^(]*\))(.*)', - version_ln) + m = re.match(r'(.*) version ([^ ]*) +(\([^(]*\))(.*)', version_ln) if m is not None: cc_name, cc_version_num, cc_build_string, cc_extra = m.groups() else: @@ -105,17 +104,15 @@ def get_cc_info(path, cc_flags=[]): cc_src_tag = cc_version_num elif cc_name == 'gcc' and (cc_extra == '' or - cc_extra == '(GCC)' or re.match(r' \(dot [0-9]+\)', cc_extra)): cc_norm_name = 'gcc' m = re.match(r'\(Apple Inc. build ([0-9]*)\)', cc_build_string) if m: cc_build = 'PROD' cc_src_tag, = m.groups() - elif 'experimental' in cc_build_string: - cc_build = 'DEV' else: - cc_build = 'PROD' + logger.error('unable to determine gcc build version: %r' % + cc_build_string) elif (cc_name in ('clang', 'LLVM', 'Debian clang', 'Apple clang', 'Apple LLVM') and (cc_extra == '' or 'based on LLVM' in cc_extra or diff --git a/tests/SharedInputs/FakeCompilers/fakecompiler.py b/tests/SharedInputs/FakeCompilers/fakecompiler.py index 5fe1970f..1df93baa 100755 --- a/tests/SharedInputs/FakeCompilers/fakecompiler.py +++ b/tests/SharedInputs/FakeCompilers/fakecompiler.py @@ -178,28 +178,6 @@ def print_verbose_info(self): "%s" "-cc1" "-E" ... more boring stuff here ...""" % ( g_program,), file=sys.stderr) -class GCCDebian(FakeCompiler): - compiler_name = "gcc-debian" - - def print_verbose_info(self): - print("""\ -Target: x86_64-linux-gnu -gcc version 12.2.0 (Debian 12.2.0-14+deb12u1)""", file=sys.stderr) - - def print_dumpmachine(self): - print("x86_64-linux-gnu") - -class GCCTrunk(FakeCompiler): - compiler_name = "gcc-trunk" - - def print_verbose_info(self): - print("""\ -Target: x86_64-linux-gnu -gcc version 16.0.0 20250807 (experimental) (GCC)""", file=sys.stderr) - - def print_dumpmachine(self): - print("x86_64-linux-gnu") - fake_compilers = dict((value.compiler_name, value) for key, value in locals().items() diff --git a/tests/SharedInputs/FakeCompilers/gcc-debian b/tests/SharedInputs/FakeCompilers/gcc-debian deleted file mode 120000 index 1b836b13..00000000 --- a/tests/SharedInputs/FakeCompilers/gcc-debian +++ /dev/null @@ -1 +0,0 @@ -fakecompiler.py \ No newline at end of file diff --git a/tests/SharedInputs/FakeCompilers/gcc-trunk b/tests/SharedInputs/FakeCompilers/gcc-trunk deleted file mode 120000 index 1b836b13..00000000 --- a/tests/SharedInputs/FakeCompilers/gcc-trunk +++ /dev/null @@ -1 +0,0 @@ -fakecompiler.py \ No newline at end of file diff --git a/tests/testing/Compilers.py b/tests/testing/Compilers.py index 6aacc667..901c4a02 100644 --- a/tests/testing/Compilers.py +++ b/tests/testing/Compilers.py @@ -66,19 +66,3 @@ def get_info(name): pprint.pprint(info) assert info['cc_name'] == 'clang' assert info['cc_version_number'] == '3.2' - -# Check a GCC packaged from Debian. -info = get_info("gcc-debian") -pprint.pprint(info) -assert info['cc_name'] == 'gcc' -assert info['cc_build'] == 'PROD' -assert info['cc_version_number'] == '12.2.0' -assert info['cc_target'] == 'x86_64-linux-gnu' - -# Check a GCC built from trunk. -info = get_info("gcc-trunk") -pprint.pprint(info) -assert info['cc_name'] == 'gcc' -assert info['cc_build'] == 'DEV' -assert info['cc_version_number'] == '16.0.0' -assert info['cc_target'] == 'x86_64-linux-gnu'