-
Notifications
You must be signed in to change notification settings - Fork 20
Description
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.2and smake backend - Subpackage examples:
- Python:
src/point-transformer(example) - C++ (smake):
packages/cpp_math(from the “Multiple Packages in Workspace” tutorial)
- Python:
This also reproduces when following the “Multiple Packages in Workspace” tutorial if the workspace directory includes spaces.
Reproduction
- Place the project in a directory containing a space, e.g.
/path/to/dir with spaces/project. - For a Python subpackage, use a
pixi.tomllike:
[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 = "*"- Run:
pixi build -b build- 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_DIRor 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 installand 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.