indygreg / indygreg/PyOxidizer

"pyoxidizer run" seems to fail if there are spaces in the build path (Windows)

Open
#391 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

Completely rewriting this issue because the original problem was dumb (just didn't have Rust installed -- though there were two issues there: the installer didn't put pyoxidizer on user or system path, and after I did that manually, it wasn't clear that the lack of Rust was the problem).

After fixing the above, I discovered that it still wouldn't build, with the relevant output at the bottom of this message. I moved the project to another folder with no spaces in the path and it worked great. Seems like it needs some quotes somewhere?

> building with Rust 1.51.0
> error: failed to run `rustc` to learn about target-specific information
>
> Caused by:
> process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -LC:\Users\myusername\example dir name\example name\repo\test-suite\pyapp\.\build\python_distributions\python.ebf4acc5dff2\python\install --target x86_64-pc-windows-msvc --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
> --- stderr
> error: multiple input filenames provided (first two filenames are `-` and `dir`)
>
> error[PYOXIDIZER_PYTHON_EXECUTABLE]: adding PythonExecutable to FileManifest
>
> Caused by:
> 0: building Python executable
> 1: building executable with Rust project
> 2: command ["C:\\Users\\myusername\\.cargo\\bin\\cargo.EXE", "build", "--target", "x86_64-pc-windows-msvc", "--target-dir", "C:\\Users\\myusername\\AppData\\Local\\Temp\\pyoxidizerjEnDAe\\build\\target", "--bin", "pyapp", "--no-default-features", "--features", "build-mode-prebuilt-artifacts cpython-link-default"] exited with code 101
> --> .\pyoxidizer.bzl:270:5
> |
> 270 | files.add_python_resource(".", exe)
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to_file_manifest()
>
>
> error: adding PythonExecutable to FileManifest
>
> Caused by:
> 0: building Python executable
> 1: building executable with Rust project
> 2: command ["C:\\Users\\myusername\\.cargo\\bin\\cargo.EXE", "build", "--target", "x86_64-pc-windows-msvc", "--target-dir", "C:\\Users\\myusername\\AppData\\Local\\Temp\\pyoxidizerjEnDAe\\build\\target", "--bin", "pyapp", "--no-default-features", "--features", "build-mode-prebuilt-artifacts cpython-link-default"] exited with code 101

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Windows failure using a project path containing spaces and inspect the command reported by `pyoxidizer run`, especially the `rustc` invocation and the reference to `.\pyoxidizer.bzl:270`. Trace how that command is assembled, then verify that the build completes successfully from a spaced path without splitting path arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.