Skip to content

bufr: use f2py build directory outside /tmp - #6211

Open
mathomp4 wants to merge 2 commits into
spack:developfrom
mathomp4:bufr-tmpdir
Open

bufr: use f2py build directory outside /tmp#6211
mathomp4 wants to merge 2 commits into
spack:developfrom
mathomp4:bufr-tmpdir

Conversation

@mathomp4

@mathomp4 mathomp4 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

With +python and Python 3.12 or newer, NumPy f2py uses Meson to build BUFR's Python extension. By default, f2py creates its build directory with Python's temporary-directory mechanism. On systems where /tmp is mounted noexec, Meson then cannot execute its compiler sanity-check program.

meson.build:1:0: ERROR: Could not invoke sanity check executable:
[Errno 13] Permission denied:
'/tmp/.../meson-private/sanity_check_for_fortran.exe'

Pass f2py's --build-dir option from BUFR's CMake custom command, placing the temporary Meson project under CMake's binary directory instead of /tmp.

The change is limited to bufr+python ^python@3.12:, matching the f2py versions that use Meson.

Testing

Successfully built on Linux:

bufr@12.3.0+python ^python@3.13 %gcc@15.2.0

Before this change, f2py invoked Meson from /tmp and failed on its Fortran sanity check. With this change, BUFR builds successfully.

AI assistance disclosure

GPT-5.6 assisted with identifying the f2py/Meson failure and drafting the package change. The change was reviewed and tested by the submitter.

@spackbot-triage spackbot-triage Bot added the update-package Modifications to packages in the repository label Aug 24, 2026
@mathomp4

Copy link
Copy Markdown
Contributor Author

Note to @climbfuji: This was found in my test builds of my spack-stack testing. Fun with noexec!

@mathomp4
mathomp4 marked this pull request as draft August 24, 2026 18:35
@mathomp4

Copy link
Copy Markdown
Contributor Author

Converting to draft. Something isn't quite right. Still seeing a bufr build failure...though I thought it worked? Weird...

@mathomp4 mathomp4 changed the title bufr: use stage tmpdir for f2py Meson build bufr: use f2py build directory outside /tmp Aug 24, 2026
@mathomp4
mathomp4 marked this pull request as ready for review August 24, 2026 19:33
@mathomp4

Copy link
Copy Markdown
Contributor Author

Okay. Should be good to go. I really hate f2py sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

update-package Modifications to packages in the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant