Skip to content

Build failure when Python interpreter directory has whitespaces #2750

@mkniewallner

Description

@mkniewallner

The build fails if the Python interpreter is located in a directory that has whitespaces. This is for instance the case for some Python versions installed through uv, which used to place them under ~/Library/Application Support/uv/python/ on macOS.

To reproduce on macOS with a Python interpreter installed through uv, from the directory containing uWSGI project:

$ uv python install 3.14
Installed Python 3.14.3 in 1.35s
 + cpython-3.14.3-macos-aarch64-none (python3.14)

$ uv build --wheel
...
running bdist_wheel
running build
running build_py
copying uwsgidecorators.py -> build/lib
installing to build/bdist.macosx-11.0-arm64/wheel
running install
clang: error: no such file or directory: 'Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14'
clang: error: no such file or directory: 'Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14'
clang: error: no such file or directory: 'Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14'
clang: error: no such file or directory: 'Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14'
  × Failed to build `<REDACTED>/uwsgi`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)
      hint: This usually indicates a problem with the package or the build environment.

The issue seems to be that paths set to the compiler flags are not quoted, so they end up being split, leading to having ~/Library/Application and Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14 instead of ~/Library/Application Support/uv/python/cpython-3.14.3-macos-aarch64-none/include/python3.14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions