Skip to content

override_options : ['cython_language=cpp'] broken in master #14284

Closed

Description

@rgommers

Describe the bug

The SciPy test suite was broken (reported in scipy/scipy#22534), it looks by the options refactor. There are several test cases that exercise our Cython API by compiling Cython files using it in C and C++ modes. The test cases itself are complex, the error is::

ERROR: No specified compiler can handle file extending_cpp.cpython-313-x86_64-linux-gnu.so.p/extending_cpp.pyx.cpp

The problem seems to be that this construct is broken:

py.extension_module(..., override_options : ['cython_language=cpp'])

This override_options case is covered in the docs (https://mesonbuild.com/Cython.html#c-intermediate-support), but not covered by test cases/cython.

To Reproduce

project('my project', 'cython', 'cpp')

py = import('python').find_installation(pure: false)

py.extension_module(
    'foo',
    'foo_cpp.pyx',
    override_options : ['cython_language=cpp'],
)

With foo_cpp.pyx contents:

def the_answer():
    return 43

Here added as a new test case: https://github.com/rgommers/meson/tree/cython-override-test

It currently fails:

% meson setup build
...
ERROR: No specified compiler can handle file foo.cpython-39-darwin.so.p/foo_cpp.pyx.cpp

Expected behavior
The build to succeed.

system parameters

  • native build
  • Linux and macOS (probably all platforms)
  • Python 3.13.2
  • meson --version: 1.7.99, commit d995cbc
  • ninja --version: 1.12.1

Activity

  1. added this to the optionrefactor milestone on Feb 21, 2025
  2. added a commit that references this issue on Feb 24, 2025
    537f3a4
  3. jpakkane commented on Feb 24, 2025

    @jpakkane
    Member

    Can you test if the linked MR fixes this for you?

  4. added 2 commits that reference this issue on Feb 24, 2025
    1619995
    7e84bdc
  5. rgommers commented on Feb 25, 2025

    @rgommers
    ContributorAuthor

    Can you test if the linked MR fixes this for you?

    Yep, that fixes it!

  6. added a commit that references this issue on Feb 25, 2025
    f446896
  7. added a commit that references this issue on May 1, 2025
    02d01f6
  8. added a commit that references this issue on Jul 3, 2025
    a574f5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions