llvm fails to build with Python 3.14.0a3. ******************** TEST 'LLVM :: tools/opt-viewer/suppress.test' FAILED ******************** Exit Code: 1 Command Output (stdout): -- Reading YAML files... Rendering index page... Rendering HTML files... 1 of 1 -- Command Output (stderr): -- RUN: at line 1: /usr/bin/python3 /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py -s /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/test/tools/opt-viewer/Inputs/suppress -o /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/redhat-linux-build/test/tools/opt-viewer/Output/suppress.test.tmp /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/test/tools/opt-viewer/Inputs/suppress/s.opt.yaml --no-highlight --demangler=/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/redhat-linux-build/bin/llvm-cxxfilt + /usr/bin/python3 /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py -s /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/test/tools/opt-viewer/Inputs/suppress -o /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/redhat-linux-build/test/tools/opt-viewer/Output/suppress.test.tmp /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/test/tools/opt-viewer/Inputs/suppress/s.opt.yaml --no-highlight --demangler=/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/redhat-linux-build/bin/llvm-cxxfilt /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) /builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py:138: SyntaxWarning: invalid escape sequence '\S' indent = re.sub("\S", " ", indent) multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib64/python3.14/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) ~~~~^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/optpmap.py", line 25, in _wrapped_func return func(argument, filter_) File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 293, in _render_file SourceFileRenderer(source_dir, output_dir, filename, no_highlight).render(remarks) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 216, in render self.render_source_lines(self.source_stream, line_remarks) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 123, in render_source_lines self.render_inline_remarks(remark, html_line) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 126, in render_inline_remarks inlining_context = r.DemangledFunctionName ^^^^^^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/optrecord.py", line 153, in DemangledFunctionName return self.demangle(self.Function) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/optrecord.py", line 77, in demangle with cls.demangler_lock: ^^^^^^^^^^^^^^^^^^ AttributeError: type object 'Passed' has no attribute 'demangler_lock'. Did you mean: 'demangler_proc'? """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 471, in <module> main() ~~~~^^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 457, in main generate_report( ~~~~~~~~~~~~~~~^ all_remarks, ^^^^^^^^^^^^ ...<7 lines>... print_progress, ^^^^^^^^^^^^^^^ ) ^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/opt-viewer.py", line 376, in generate_report optpmap.pmap( ~~~~~~~~~~~~^ _render_file_bound, file_remarks.items(), num_jobs, should_print_progress ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/builddir/build/BUILD/llvm-19.1.6-build/llvm-project-19.1.6.src/llvm/tools/opt-viewer/optpmap.py", line 57, in pmap result = pool.map(_wrapped_func, func_and_args, *args, **kwargs) File "/usr/lib64/python3.14/multiprocessing/pool.py", line 367, in map return self._map_async(func, iterable, mapstar, chunksize).get() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.14/multiprocessing/pool.py", line 774, in get raise self._value AttributeError: type object 'Passed' has no attribute 'demangler_lock' https://docs.python.org/3.14/whatsnew/3.14.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08492403-llvm/ For all our attempts to build llvm with Python 3.14, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/llvm/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.14: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/ Let us know here if you have any questions. Python 3.14 is planned to be included in Fedora 43. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle. Changing version to 42.
This blocks sympy, which blocks 38 other packages.
Based on: https://reviews.llvm.org/D41784?id= https://github.com/androm3da/optviewer-demo/issues/4#issuecomment-718787822 https://github.com/llvm/llvm-project/issues/62403 I'd say this is a rece condition.
Naïvely, trying this: --- a/llvm/tools/opt-viewer/optrecord.py +++ b/llvm/tools/opt-viewer/optrecord.py @@ -65,16 +65,23 @@ class Remark(yaml.YAMLObject): default_demangler = "c++filt -n" demangler_proc = None + @classmethod + def get_demangler_lock(cls): + try: + return cls.demangler_lock + except AttributeError: + cls.demangler_lock = Lock() + return cls.demangler_lock + @classmethod def set_demangler(cls, demangler): cls.demangler_proc = subprocess.Popen( demangler.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE ) - cls.demangler_lock = Lock() @classmethod def demangle(cls, name): - with cls.demangler_lock: + with cls.get_demangler_lock(): cls.demangler_proc.stdin.write((name + "\n").encode("utf-8")) cls.demangler_proc.stdin.flush() return cls.demangler_proc.stdout.readline().rstrip().decode("utf-8")
https://github.com/llvm/llvm-project/pull/131214 fixes the race in our copr (and makes llvm build with Python 3.14).
This got fixed in LLVM 21 and got backported LLVM 20.1.3. See the results from: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8914108/ I'm closing this now. Thanks!