Title: Bug: PATH environment variable overwritten during script execution, breaking standard OS commands
Bug Description
When executing a user-defined script (e.g., ppm run my_script), ppmm overwrites the PATH environment variable for the child process instead of prepending the virtual environment path to it.
Because the existing system PATH is destroyed, standard OS commands like git, make, echo, or gcc become unavailable and fail to execute if they are included in a script within project.toml.
Location
- src/project_managers.rs inside
RunScript::run_script (line 399) and BuildProject::build_project (line 642).
Technical Details
Currently, Command::env is used to completely replace the PATH environment variable for the child process:
cmd.env("PATH", get_venv_bin_dir(venv_root));
Proposed Solution
The script execution logic should retrieve the current PATH, and prepend the virtual environment's bin directory to it.
rust
let current_path = std::env::var("PATH").unwrap_or_default();
let separator = if cfg!(target_os = "windows") { ";" } else { ":" };
let new_path = format!("{}{}{}", get_venv_bin_dir(venv_root), separator, current_path);
cmd.env("PATH", new_path);
Title:
Bug: PATH environment variable overwritten during script execution, breaking standard OS commandsBug Description
When executing a user-defined script (e.g.,
ppm run my_script),ppmmoverwrites thePATHenvironment variable for the child process instead of prepending the virtual environment path to it.Because the existing system
PATHis destroyed, standard OS commands like git,make,echo, orgccbecome unavailable and fail to execute if they are included in a script withinproject.toml.Location
RunScript::run_script(line 399) andBuildProject::build_project(line 642).Technical Details
Currently,
Command::envis used to completely replace thePATHenvironment variable for the child process: