8000 BUG: meson.build runs gitversion.py with the wrong Python interpreter · Issue #24514 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
BUG: meson.build runs gitversion.py with the wrong Python interpreter #24514
Closed
@mkoeppe

Description

@mkoeppe

Describe the issue:

meson.build expects that python in the PATH is a working Python 3; that's not a good assumption.

Given that meson is run via meson_python, the Python in sys.executable should be used instead of leaving it to external circumstances. Note in particular that venvs created by python -m venv have python3 executables but not python executables.

This is on numpy 1.26.0b1 with #24503 as a patch.

I see this on ubuntu-focal, where there's no /usr/bin/python. https://github.com/mkoeppe/sage/actions/runs/5954216252/job/16159923132#step:8:2353

[numpy-1.26.0b1]     The Meson build system
  [numpy-1.26.0b1]     Version: 1.2.99
  [numpy-1.26.0b1]     Source dir: /sage/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/numpy-1.26.0b1/src
  [numpy-1.26.0b1]     Build dir: /sage/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/numpy-1.26.0b1/src/.mesonpy-q4xlebps/build
  [numpy-1.26.0b1]     Build type: native build
  [numpy-1.26.0b1]   
  [numpy-1.26.0b1]     ../../meson.build:4:11: ERROR: Program or command 'python' not found or not executable
  [numpy-1.26.0b1]   

I also see this on ubuntu-xenial-toolchain-gcc_9, where /usr/bin/python is an unusable Python 2. https://github.com/mkoeppe/sage/actions/runs/5954216252/job/16159922994#step:11:1438

  The Meson build system
  Version: 1.2.99
  Source dir: /sage/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/numpy-1.26.0b1/src
  Build dir: /sage/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/numpy-1.26.0b1/src/.mesonpy-1mht6y46/build
  Build type: native build

  ../../meson.build:4:11: ERROR: Command `/usr/bin/python numpy/_build_utils/gitversion.py` failed with status 1.

Reproduce the code example:

$ pip install .

Error message:

../../meson.build:4:11: ERROR: Program or command 'python' not found or not executable

Runtime information:

N/A

Context for the issue:

sagemath/sage#36123

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0