Skip to content

Use really invalid meson code to trigger exception

8cfc7e6
Select commit
Loading
Failed to load commit list.
Open

Print meson output in case of error during editable rebuild #750

Use really invalid meson code to trigger exception
8cfc7e6
Select commit
Loading
Failed to load commit list.
Cirrus CI / manylinux-python3.8 failed May 27, 2025 in 1m 45s

Task Summary

Instruction test failed in 01:42

Details

⚠️ Not enough compute credits to prioritize tasks!

✅ 00:00 clone
❌ 01:42 test

                sys.meta_path.insert(0, finder)
    
                # Insert invalid code in the meson build file
                path.write_text('<not valid')
    
                # Import module and trigger rebuild: the build fails and ImportErrror is raised
                stdout = io.StringIO()
                with redirect_stdout(stdout):
                    with pytest.raises(
                        ImportError, match=r're-building the purelib-and-platlib (?s:.)*ERROR: Invalid source tree:'
                    ):
>                       import plat  # noqa: F401
E                       Failed: DID NOT RAISE <class 'ImportError'>

/tmp/cirrus-ci-build/tests/test_editable.py:380: Failed
----------------------------- Captured stdout call -----------------------------
+ meson setup /tmp/cirrus-ci-build/tests/packages/purelib-and-platlib /tmp/pytest-of-root/pytest-0/test_editable_meson_file_rebui1 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pytest-of-root/pytest-0/test_editable_meson_file_rebui1/meson-python-native-file.ini
The Meson build system
Version: 1.8.1
Source dir: /tmp/cirrus-ci-build/tests/packages/purelib-and-platlib
Build dir: /tmp/pytest-of-root/pytest-0/test_editable_meson_file_rebui1
Build type: native build
Project name: purelib-and-platlib
Project version: 1.0.0
C compiler for the host machine: cc (gcc 13.3.1 "cc (GCC) 13.3.1 20240611 (Red Hat 13.3.1-2)")
C linker for the host machine: cc ld.bfd 2.40-21
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (/tmp/cirrus-ci-build/env/bin/python3)
Found pkg-config: YES (/usr/bin/pkg-config) 1.4.2
Run-time dependency python found: YES 3.8
Build targets in project: 1

purelib-and-platlib 1.0.0

  User defined options
    Native files: /tmp/pytest-of-root/pytest-0/test_editable_meson_file_rebui1/meson-python-native-file.ini
    b_ndebug    : if-release
    b_vscrt     : md
    buildtype   : release

Found ninja-1.8.2 at /usr/bin/ninja
=========================== short test summary info ============================
SKIPPED [1] tests/test_editable.py:161: importlib.resources not available
SKIPPED [3] tests/test_options.py:18: Ninja version too old
SKIPPED [1] tests/test_project.py:333: requires MSVC
SKIPPED [3] tests/test_project.py:345: macOS specific test
SKIPPED [2] tests/test_project.py:362: macOS specific test
SKIPPED [1] tests/test_tags.py:47: macOS specific test
SKIPPED [1] tests/test_tags.py:59: macOS specific test
SKIPPED [1] tests/test_tags.py:69: macOS specific test
SKIPPED [2] tests/test_wheel.py:283: macOS specific test
FAILED tests/test_editable.py::test_editable_meson_file_rebuild_error[] - Failed: DID NOT RAISE <class 'ImportError'>
FAILED tests/test_editable.py::test_editable_meson_file_rebuild_error[verbose] - Failed: DID NOT RAISE <class 'ImportError'>
============= 2 failed, 120 passed, 15 skipped in 85.82s (0:01:25) =============
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������