question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Meson build unconditionally probes for pythran, despite SCIPY_USE_PYTHRAN=0

See original GitHub issue

Describe your issue.

Originally reported downstream in Gentoo at https://bugs.gentoo.org/878361.

It appears that scipy’s Meson build will unconditionally search for pythran, even with export SCIPY_USE_PYTHRAN=0.

In meson.build, we have:

cython = find_program('cython')
pythran = find_program('pythran')

Note that find_program’s ‘required’ option defaults to on (https://mesonbuild.com/Reference-manual_functions.html#find_program).

Reproducing Code Example

-

Error message

[...]
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 12.2.1 "GNU Fortran (Gentoo Hardened 12.2.1_p20221029 p1) 12.2.1 20221029")
Fortran linker for the host machine: gfortran ld.bfd 2.39
Compiler for Fortran supports arguments -Wno-conversion: YES
Program cython found: YES (/usr/sbin/cython)
Program pythran found: NO

../../meson.build:72:0: ERROR: Program 'pythran' not found or not executable

A full log can be found at /var/tmp/portage/dev-python/scipy-1.9.3/work/scipy-1.9.3/.mesonpy-lo4vu62u/build/meson-logs/meson-log.txt
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.8/gpep517", line 4, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/gpep517/__main__.py", line 322, in main
    return func(args)
  File "/usr/lib/python3.8/site-packages/gpep517/__main__.py", line 122, in build_wheel
    print(build_wheel_impl(args, args.wheel_dir), file=out)
  File "/usr/lib/python3.8/site-packages/gpep517/__main__.py", line 105, in build_wheel_impl
    wheel_name = backend.build_wheel(str(wheel_dir), args.config_json)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 986, in build_wheel
    with _project(config_settings) as project:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 948, in _project
    with Project.with_temp_working_dir(
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 777, in with_temp_working_dir
    yield cls(source_dir, tmpdir, build_dir)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 682, in __init__
    self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 713, in _configure
    self._meson(
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 696, in _meson
    return self._proc('meson', *args)
  File "/usr/lib/python3.8/site-packages/mesonpy/__init__.py", line 691, in _proc
    subprocess.check_call(list(args))
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=/var/tmp/portage/dev-python/scipy-1.9.3/work/scipy-1.9.3/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=/usr', '/var/tmp/portage/dev-python/scipy-1.9.3/work/scipy-1.9.3', '/var/tmp/portage/dev-python/scipy-1.9.3/work/scipy-1.9.3/.mesonpy-lo4vu62u/build']' returned non-zero exit status 1.
 * ERROR: dev-python/scipy-1.9.3::gentoo failed (compile phase):
 *   Wheel build failed

SciPy/NumPy/Python version information

1.9.3

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rgommerscommented, Nov 6, 2022

I’ve added a backport label to the PR, just in case we do need to do another bugfix release.

1reaction
eli-schwartzcommented, Nov 6, 2022

From #17263

  • no real intention to do 1.9.4 but prep just in case
  • current plan is to send the email proposing 1.10 schedule to mailing list on Nov. 9th, similar to last November cycle
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build Meson Documentation · Issue #9873 - GitHub
Describe the bug I can't compile the meson documentation, though I ... To Reproduce The meson.build file is unchanged from the github clone....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found