Skip to content

pixi-build: Generated scripts break when workspace path contains spaces (python 0.3.2 and cmake backends) #358

@lllangWV

Description

@lllangWV

Description

When building subpackages from source, the build fails if the repository path contains spaces. In both the Python and smake backends, generated scripts reference path variables (e.g., $SRC_DIR) and arguments without quoting, so shells split paths at the first space.

  • What I’m doing: Building subpackages from source using pixi build
  • Backends: pixi-build-python==0.3.2 and smake backend
  • Subpackage examples:
    • Python: src/point-transformer (example)
    • C++ (smake): packages/cpp_math (from the “Multiple Packages in Workspace” tutorial)

This also reproduces when following the “Multiple Packages in Workspace” tutorial if the workspace directory includes spaces.

Reproduction

  1. Place the project in a directory containing a space, e.g. /path/to/dir with spaces/project.
  2. For a Python subpackage, use a pixi.toml like:
[package]
name = "point_transformer"
version = "0.1.0"

[package.build]
backend = { name = "pixi-build-python", version = "==0.3.2" }
source = { path = "src" }

[package.host-dependencies]
setuptools = "*"
setuptools-scm = "*"
pytorch-gpu = "*"
cuda-version = "*"
  1. Run:
pixi build -b build
  1. For smake, reproduce similarly by building a C++ subpackage (e.g., packages/cpp_math) from the tutorial in a workspace path with spaces.

Expected behavior

Build completes successfully even when the workspace path contains spaces.

Actual behavior (sanitized excerpt)

Python backend:

Installing build environment
Installing host environment

Running build script
$SRC_DIR/conda_build.sh: line 8: /path/to/dir: No such file or directory
error Script failed with status 127
error Script execution failed.

Work directory: "/path/to/dir with spaces/project/.pixi/build/work/<pkg>/work"

Inside the generated conda_build.sh, the pip install invocation also embeds an unquoted path with spaces:

$PYTHON -m pip install --ignore-installed -vv --no-deps --no-build-isolation /path/to/dir with spaces/project/src/

smake backend:

  • Fails similarly with “No such file or directory” when invoking generated scripts that reference $SRC_DIR or other path arguments without quotes.

Analysis

Path variables and arguments in generated scripts for both backends are not quoted. Shell word-splitting breaks paths at spaces, causing failures.

Environment

  • OS: Ubuntu 24.04.3 LTS
  • Shell: /usr/bin/bash
  • Backends: pixi-build-python==0.3.2, smake backend

Workaround

Build from a path without spaces (move or symlink the repo to a space-free location).

Suggested fix

  • Quote all path variables and arguments in generated scripts and wrappers for both backends, e.g. "$SRC_DIR" and "$SRC_DIR/conda_build.sh".
  • Ensure pip install and any smake-invoked paths are quoted, e.g.:
    "$PYTHON" -m pip install --ignore-installed -vv --no-deps --no-build-isolation "/path/to/dir with spaces/project/src/"

Happy to provide a minimal repo demonstrating both failures if useful.

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