Skip to content

[Bug]: install.sh fails on macOS due to unquoted spaces in Python path (uv) #10009

@PStarH

Description

@PStarH

Bug Description

The install.sh script exits prematurely on macOS when the Python interpreter path detected by uv contains spaces (e.g., ~/Library/Application Support/uv/...).

Because the script uses set -e and fails to quote the $PYTHON_PATH variable during execution, the shell attempts to split the path at the space, treating Library/Application as a non-existent command. This causes the script to crash silently without providing a helpful error message to the user, making it appear as if the installer simply hung.

Image

Steps to Reproduce

  1. Ensure uv is installed and managing Python 3.11 in its default macOS location (~/Library/Application Support/uv/...).

  2. Run the installation script: bash install.sh.

  3. The installation halts immediately after printing → Checking Python 3.11....

Expected Behavior

The script exits silently after the "Checking Python 3.11..." step.
Running with bash -x reveals the following error:
++ Library/Application Support/uv/python/cpython-3.11.9-macos-aarch64-none/bin/python3 --version
install.sh: line 252: Library/Application: No such file or directory

Actual Behavior

The script exits silently after the "Checking Python 3.11..." step because of an unhandled path parsing error.
Full debug output (running bash -x install.sh):

++ Library/Application Support/uv/python/cpython-3.11.9-macos-aarch64-none/bin/python3 --version
install.sh: Library/Application: No such file or directory

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

I am unable to run hermes debug share or hermes update because the installation process fails at the setup phase. I have provided the bash -x execution trace in this report to pinpoint the failure.

Operating System

MacOS Sonoma 14.6

Python Version

Python 3.11.9 (via uv)

Hermes Version

N/A (Installation failed)

Additional Logs / Traceback (optional)

The bash -x trace confirms the path parsing error:
+ uv python find 3.11
++ uv python find 3.11
+ PYTHON_PATH='Library/Application Support/uv/python/cpython-3.11.9-macos-aarch64-none/bin/python3'
++ Library/Application Support/uv/python/cpython-3.11.9-macos-aarch64-none/bin/python3 --version
install.sh: line [X]: Library/Application: No such file or directory

Root Cause Analysis (optional)

The issue is caused by unquoted variable expansion in the check_python function (around line 252+). When $PYTHON_PATH contains a space, the shell splits the path at the space. In a strict environment (specifically when set -e is enabled, as in this script), the shell attempts to execute Library/Application as a standalone command. Since this file does not exist, the shell returns a non-zero exit code, triggering set -e and causing the entire installation script to abort silently.

Proposed Fix (optional)

Wrap all instances of variable expansions, specifically $PYTHON_PATH, in double quotes to handle paths with spaces correctly.
Example change:
PYTHON_FOUND_VERSION="$($PYTHON_PATH --version)"

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions