Bug 2250682

Summary: mlir fails to build with Python 3.13: Test suite fails
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: mlirAssignee: serge-sans-paille <sergesanspaille>
Status: CLOSED COMPLETED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: kkleine, ksurma, mhroncok, npopov, sergesanspaille, tstellar, tuliom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mlir-18.1.6-2.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-04 16:01:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    

Description Karolina Surma 2023-11-20 14:36:41 UTC
mlir fails to build with Python 3.13.0a1.

This report is automated and not very verbose, but we'll try to get back here with details.

Test suite failed:
Failed Tests (59):
  MLIR :: python/develoment_files.py
  MLIR :: python/dialects/arith_dialect.py
  MLIR :: python/dialects/async_dialect.py
  MLIR :: python/dialects/builtin.py
  MLIR :: python/dialects/complex_dialect.py
  MLIR :: python/dialects/func.py
  MLIR :: python/dialects/gpu.py
  MLIR :: python/dialects/linalg/opdsl/arguments.py
  MLIR :: python/dialects/linalg/opdsl/assignments.py
  MLIR :: python/dialects/linalg/opdsl/doctests.py
  MLIR :: python/dialects/linalg/opdsl/emit_convolution.py
  MLIR :: python/dialects/linalg/opdsl/emit_fill.py
  MLIR :: python/dialects/linalg/opdsl/emit_matmul.py
  MLIR :: python/dialects/linalg/opdsl/emit_misc.py
  MLIR :: python/dialects/linalg/opdsl/emit_pooling.py
  MLIR :: python/dialects/linalg/opdsl/metadata.py
  MLIR :: python/dialects/linalg/opdsl/shape_maps_iteration.py
  MLIR :: python/dialects/linalg/opdsl/test_core_named_ops.py
  MLIR :: python/dialects/linalg/ops.py
  MLIR :: python/dialects/math_dialect.py
  MLIR :: python/dialects/memref.py
  MLIR :: python/dialects/ml_program.py
  MLIR :: python/dialects/ods_helpers.py
  MLIR :: python/dialects/pdl_ops.py
  MLIR :: python/dialects/pdl_types.py
  MLIR :: python/dialects/python_test.py
  MLIR :: python/dialects/quant.py
  MLIR :: python/dialects/scf.py
  MLIR :: python/dialects/shape.py
  MLIR :: python/dialects/sparse_tensor/dialect.py
  MLIR :: python/dialects/sparse_tensor/passes.py
  MLIR :: python/dialects/tensor.py
  MLIR :: python/dialects/tosa.py
  MLIR :: python/dialects/transform.py
  MLIR :: python/dialects/transform_gpu_ext.py
  MLIR :: python/dialects/transform_loop_ext.py
  MLIR :: python/dialects/transform_structured_ext.py
  MLIR :: python/dialects/vector.py
  MLIR :: python/execution_engine.py
  MLIR :: python/ir/affine_expr.py
  MLIR :: python/ir/affine_map.py
  MLIR :: python/ir/array_attributes.py
  MLIR :: python/ir/attributes.py
  MLIR :: python/ir/blocks.py
  MLIR :: python/ir/builtin_types.py
  MLIR :: python/ir/context_lifecycle.py
  MLIR :: python/ir/context_managers.py
  MLIR :: python/ir/debug.py
  MLIR :: python/ir/diagnostic_handler.py
  MLIR :: python/ir/dialects.py
  MLIR :: python/ir/exception.py
  MLIR :: python/ir/insertion_point.py
  MLIR :: python/ir/integer_set.py
  MLIR :: python/ir/location.py
  MLIR :: python/ir/module.py
  MLIR :: python/ir/operation.py
  MLIR :: python/ir/symbol_table.py
  MLIR :: python/ir/value.py
  MLIR :: python/pass_manager.py

Testing Time: 15.40s
  Unsupported:  350
  Passed     : 1271
  Failed     :   59
FAILED: test/CMakeFiles/check-mlir /builddir/build/BUILD/mlir-17.0.4.src/redhat-linux-build/test/CMakeFiles/check-mlir 

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06660882-mlir/

For all our attempts to build mlir with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/mlir/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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.

Comment 1 Tulio Magno Quites Machado Filho 2023-11-30 13:59:16 UTC
There appears to be an issue very early:

[56/57] cd /builddir/build/BUILD/mlir-17.0.4.src/redhat-linux-build/test && /usr/bin/python3.13 /usr/bin/lit -sv /builddir/build/BUILD/mlir-17.0.4.src/redhat-linux-build/test
/usr/lib/python3.13/site-packages/lit/TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'
  """
/usr/lib/python3.13/site-packages/lit/TestRunner.py:1561: SyntaxWarning: invalid escape sequence '\s'
  match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
lit: /usr/lib/python3.13/site-packages/lit/discovery.py:250: warning: test suite 'MLIR-Unit' contained no tests


Then, most tests fail with:

FAIL: MLIR :: python/dialects/builtin.py (1609 of 1680)
******************** TEST 'MLIR :: python/dialects/builtin.py' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/bin/python3.13 /builddir/build/BUILD/mlir-17.0.4.src/test/python/dialects/builtin.py | /usr/bin/FileCheck /builddir/build/BUILD/mlir-17.0.4.src/test/python/dialects/builtin.py
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /usr/bin/FileCheck /builddir/build/BUILD/mlir-17.0.4.src/test/python/dialects/builtin.py


And 3 others had segmentation faults, e.g.:

FAIL: MLIR :: python/develoment_files.py (1611 of 1680)
******************** TEST 'MLIR :: python/develoment_files.py' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/bin/python3.13 /builddir/build/BUILD/mlir-17.0.4.src/test/python/develoment_files.py 2>&1
--
Exit Code: 139

Command Output (stderr):
--
/builddir/build/BUILD/mlir-17.0.4.src/redhat-linux-build/test/python/Output/develoment_files.py.script: line 1: 1539915 Segmentation fault      (core dumped) /usr/bin/python3.13 /builddir/build/BUILD/mlir-17.0.4.src/test/python/develoment_files.py 2>&1

Comment 2 Tulio Magno Quites Machado Filho 2023-11-30 14:09:26 UTC
The syntax warnings have already been fixed upstream in LLVM 18 with commit e919a83f96fe016378926855cb79f9b86102f6e4.

Comment 3 Aoife Moloney 2024-02-15 23:05:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.