Skip to content

Commit 0d5b979

Browse files
Revert "Handle non-Apple packaged GCC versions (#34)" (#36)
This reverts commit 0e9a3ae. Reverts #34 due to an error running the test suite on our Linux bots. https://lab.llvm.org/buildbot/#/builders/17/builds/10167 for example. ``` Traceback (most recent call last): File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/bin/lnt", line 33, in <module> sys.exit(load_entry_point('LNT', 'console_scripts', 'lnt')()) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/sandbox/lib/python3.10/site-packages/click-6.7-py3.10.egg/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/tests/test_suite.py", line 1189, in cli_action results = test_suite.run_test(test_suite.opts) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/tests/test_suite.py", line 310, in run_test cc_info = self._get_cc_info(cmake_vars) File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/tests/test_suite.py", line 714, in _get_cc_info return lnt.testing.util.compilers.get_cc_info( File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/testing/util/compilers.py", line 79, in get_cc_info m = re.match(r'(.*) version ([^ ]*) (?:[0-9]+ )?+(\([^(]*\))(.*)', File "/usr/lib/python3.10/re.py", line 190, in match return _compile(pattern, flags).match(string) File "/usr/lib/python3.10/re.py", line 303, in _compile p = sre_compile.compile(pattern, flags) File "/usr/lib/python3.10/sre_compile.py", line 788, in compile p = sre_parse.parse(p, flags) File "/usr/lib/python3.10/sre_parse.py", line 955, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) File "/usr/lib/python3.10/sre_parse.py", line 444, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, File "/usr/lib/python3.10/sre_parse.py", line 672, in _parse raise source.error("multiple repeat", re.error: multiple repeat at position 33 ```
1 parent 0e9a3ae commit 0d5b979

File tree

5 files changed

+3
-46
lines changed

5 files changed

+3
-46
lines changed

lnt/testing/util/compilers.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def get_cc_info(path, cc_flags=[]):
7676
logger.error("unable to find compiler version: %r: %r" %
7777
(cc, cc_version))
7878
else:
79-
m = re.match(r'(.*) version ([^ ]*) (?:[0-9]+ )?+(\([^(]*\))(.*)',
80-
version_ln)
79+
m = re.match(r'(.*) version ([^ ]*) +(\([^(]*\))(.*)', version_ln)
8180
if m is not None:
8281
cc_name, cc_version_num, cc_build_string, cc_extra = m.groups()
8382
else:
@@ -105,17 +104,15 @@ def get_cc_info(path, cc_flags=[]):
105104
cc_src_tag = cc_version_num
106105

107106
elif cc_name == 'gcc' and (cc_extra == '' or
108-
cc_extra == '(GCC)' or
109107
re.match(r' \(dot [0-9]+\)', cc_extra)):
110108
cc_norm_name = 'gcc'
111109
m = re.match(r'\(Apple Inc. build ([0-9]*)\)', cc_build_string)
112110
if m:
113111
cc_build = 'PROD'
114112
cc_src_tag, = m.groups()
115-
elif 'experimental' in cc_build_string:
116-
cc_build = 'DEV'
117113
else:
118-
cc_build = 'PROD'
114+
logger.error('unable to determine gcc build version: %r' %
115+
cc_build_string)
119116
elif (cc_name in ('clang', 'LLVM', 'Debian clang', 'Apple clang',
120117
'Apple LLVM') and
121118
(cc_extra == '' or 'based on LLVM' in cc_extra or

tests/SharedInputs/FakeCompilers/fakecompiler.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,6 @@ def print_verbose_info(self):
178178
"%s" "-cc1" "-E" ... more boring stuff here ...""" % (
179179
g_program,), file=sys.stderr)
180180

181-
class GCCDebian(FakeCompiler):
182-
compiler_name = "gcc-debian"
183-
184-
def print_verbose_info(self):
185-
print("""\
186-
Target: x86_64-linux-gnu
187-
gcc version 12.2.0 (Debian 12.2.0-14+deb12u1)""", file=sys.stderr)
188-
189-
def print_dumpmachine(self):
190-
print("x86_64-linux-gnu")
191-
192-
class GCCTrunk(FakeCompiler):
193-
compiler_name = "gcc-trunk"
194-
195-
def print_verbose_info(self):
196-
print("""\
197-
Target: x86_64-linux-gnu
198-
gcc version 16.0.0 20250807 (experimental) (GCC)""", file=sys.stderr)
199-
200-
def print_dumpmachine(self):
201-
print("x86_64-linux-gnu")
202-
203181

204182
fake_compilers = dict((value.compiler_name, value)
205183
for key, value in locals().items()

tests/SharedInputs/FakeCompilers/gcc-debian

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/SharedInputs/FakeCompilers/gcc-trunk

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/testing/Compilers.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,3 @@ def get_info(name):
6666
pprint.pprint(info)
6767
assert info['cc_name'] == 'clang'
6868
assert info['cc_version_number'] == '3.2'
69-
70-
# Check a GCC packaged from Debian.
71-
info = get_info("gcc-debian")
72-
pprint.pprint(info)
73-
assert info['cc_name'] == 'gcc'
74-
assert info['cc_build'] == 'PROD'
75-
assert info['cc_version_number'] == '12.2.0'
76-
assert info['cc_target'] == 'x86_64-linux-gnu'
77-
78-
# Check a GCC built from trunk.
79-
info = get_info("gcc-trunk")
80-
pprint.pprint(info)
81-
assert info['cc_name'] == 'gcc'
82-
assert info['cc_build'] == 'DEV'
83-
assert info['cc_version_number'] == '16.0.0'
84-
assert info['cc_target'] == 'x86_64-linux-gnu'

0 commit comments

Comments
 (0)