Skip to content

[Bug]: latest meson release (v1.12) doesn't work with GraalPy #1078

Description

@skirpichev

Describe the bug

Here build log from our CI:

Run pip install --verbose .[ci] -Cbuild-dir=build \
Using pip 24.3.1 from /opt/hostedtoolcache/GraalPy/25.0.3/x64/lib/python3.12/site-packages/pip (python 3.12)
WARNING: Disabling truststore because platform isn't supported
Looking in indexes: https://pypi.org/simple, https://www.graalvm.org/python/wheels/
Processing /home/runner/work/python-gmp/python-gmp
  Installing build dependencies: started
  Running command pip subprocess to install build dependencies
  Using pip 24.3.1 from /opt/hostedtoolcache/GraalPy/25.0.3/x64/lib/python3.12/site-packages/pip (python 3.12)
  WARNING: Disabling truststore because platform isn't supported
  Looking in indexes: https://pypi.org/simple, https://www.graalvm.org/python/wheels/, https://www.graalvm.org/python/wheels/
  Loading GraalPy post-release patch repository from [https://raw.githubusercontent.com/oracle/graalpython/refs/heads/github/patches/25.0.3/graalpython/lib-graalpython/patches/.](https://raw.githubusercontent.com/oracle/graalpython/refs/heads/github/patches/25.0.3/graalpython/lib-graalpython/patches/) This can be controlled with PIP_GRAALPY_PATCHES_URL environment variable. Set to 'disabled' to disable
  Collecting meson-python
    Obtaining dependency information for meson-python from https://files.pythonhosted.org/packages/90/ad/77f9483e180cabab2772ac222aedd3dfab858e60d992f40414a3f08e7494/meson_python-0.20.0-py3-none-any.whl.metadata
    Downloading meson_python-0.20.0-py3-none-any.whl.metadata (2.1 kB)
  Collecting meson>=1.2.3 (from meson-python)
    Obtaining dependency information for meson>=1.2.3 from https://files.pythonhosted.org/packages/07/68/b0117422eb0a46d9d8d9e328f0c5b5c835179bfc058688bca35c90c89eba/meson-1.12.0-py3-none-any.whl.metadata
    Downloading meson-1.12.0-py3-none-any.whl.metadata (1.7 kB)
  Collecting packaging>=23.2 (from meson-python)
    Obtaining dependency information for packaging>=23.2 from https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl.metadata
    Downloading packaging-26.3-py3-none-any.whl.metadata (3.5 kB)
  Collecting pyproject-metadata>=0.9.0 (from meson-python)
    Obtaining dependency information for pyproject-metadata>=0.9.0 from https://files.pythonhosted.org/packages/b9/8e/d883718e872abc214ba053f60f7e6edc2abd5ffbd1544beb01a9c92ddd3c/pyproject_metadata-0.12.1-py3-none-any.whl.metadata
    Downloading pyproject_metadata-0.12.1-py3-none-any.whl.metadata (6.5 kB)
  Downloading meson_python-0.20.0-py3-none-any.whl (29 kB)
  Downloading meson-1.12.0-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 4.7 MB/s eta 0:00:00
  Downloading packaging-26.3-py3-none-any.whl (129 kB)
  Downloading pyproject_metadata-0.12.1-py3-none-any.whl (23 kB)
  Installing collected packages: packaging, meson, pyproject-metadata, meson-python
    Looking for GraalPy patches for packaging
    Looking for GraalPy patches for meson
    Creating /tmp/pip-build-env-3gaeua69/overlay/bin
    changing mode of /tmp/pip-build-env-3gaeua69/overlay/bin/meson to 755
    Looking for GraalPy patches for pyproject_metadata
    Looking for GraalPy patches for meson_python
  Successfully installed meson-1.12.0 meson-python-0.20.0 packaging-26.3 pyproject-metadata-0.12.1
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Running command Getting requirements to build wheel
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)

  meson-python: error: Could not execute meson: Traceback (most recent call last):
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/bin/meson", line 8, in <module>
  meson-python: error:     sys.exit(main())
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 322, in main
  meson-python: error:     return run(sys.argv[1:], launcher)
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 312, in run
  meson-python: error:     validate_original_args(args)
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 248, in validate_original_args
  meson-python: error:     import mesonbuild.options
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/lib/python3.12/site-packages/mesonbuild/options.py", line 658, in <module>
  meson-python: error:     UserStringOption('prefix', 'Installation prefix', default_prefix()),
  meson-python: error:   File "/tmp/pip-build-env-3gaeua69/overlay/lib/python3.12/site-packages/mesonbuild/utils/core.py", line 62, in __new__
  meson-python: error:     return super().__new__(cls)
  meson-python: error: TypeError: object.__new__(UserStringOption) is not safe, use UserStringOption.__new__()
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /opt/hostedtoolcache/GraalPy/25.0.3/x64/bin/python /opt/hostedtoolcache/GraalPy/25.0.3/x64/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpmtyn80av
  cwd: /home/runner/work/python-gmp/python-gmp
  Preparing metadata (pyproject.toml): finished with status 'error'
error: metadata-generation-failed

Operating system

Linux

CPU architecture

x86_64

GraalPy version

25.0.3

JDK version

No response

Context configuration

No response

Steps to reproduce

Could be reproduced (by pip install .) on the development version of the python-gmp package with reverted commit, which pins meson (diofant/python-gmp@7332c05).

Expected behavior

No errors, just as for meson v1.11.2

Stack trace

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions