From c80fa728bd847885e175a3f4e2b8490cd0bb90fc Mon Sep 17 00:00:00 2001 From: hllqkb Date: Thu, 7 May 2026 21:30:52 +0800 Subject: [PATCH] fix(installer): set UV_NO_CONFIG=1 to avoid permission denied under sudo -u When the installer is run via , uv resolves config file paths against the process owner's (root) home directory rather than the effective user's, causing a Permission denied error when trying to read /root/uv.toml. Setting UV_NO_CONFIG=1 prevents uv from discovering any config files (uv.toml, pyproject.toml) during installation, which is the correct behavior for a bootstrap script that manages its own environment. Fixes #21269 --- scripts/install.sh | 4 ++++ setup-hermes.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index ab305544bd..d452a26490 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -28,6 +28,10 @@ if [ -n "${PYTHONHOME:-}" ]; then unset PYTHONHOME fi +# Prevent uv from discovering config files (uv.toml, pyproject.toml) from the +# wrong user's home directory when running under sudo -u . See #21269. +export UV_NO_CONFIG=1 + # Colors RED='\033[0;31m' GREEN='\033[0;32m' diff --git a/setup-hermes.sh b/setup-hermes.sh index 5d0f2928ab..4d83f94ffb 100755 --- a/setup-hermes.sh +++ b/setup-hermes.sh @@ -29,6 +29,10 @@ NC='\033[0m' SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" +# Prevent uv from discovering config files (uv.toml, pyproject.toml) from the +# wrong user's home directory when running under sudo -u . See #21269. +export UV_NO_CONFIG=1 + PYTHON_VERSION="3.11" is_termux() {