From 0e30387451a0e4996c06b8b2fba685ce3da2b850 Mon Sep 17 00:00:00 2001 From: Bei Qiao <183096904+Joe-Nor@users.noreply.github.com> Date: Thu, 30 Jul 2026 02:11:05 +0800 Subject: [PATCH 1/2] Fix Ubuntu test prerequisites --- .github/workflows/test.yml | 1 + scripts/julia-daemon.sh | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index daac0f90d..91534d51b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" + - uses: astral-sh/setup-uv@v5 - run: pip install pytest pytest-cov numpy scipy matplotlib - run: make test diff --git a/scripts/julia-daemon.sh b/scripts/julia-daemon.sh index 252c66527..38bc2f705 100755 --- a/scripts/julia-daemon.sh +++ b/scripts/julia-daemon.sh @@ -82,13 +82,20 @@ runner_path() { runner=$(cd "$(dirname "$0")" && pwd)/$(basename "$0") } -install_shim() { +validate_shim_path() { runner_path - shim_path="${1:-$HOME/.local/bin/julia}" - case "$shim_path" in /*) ;; *) shim_path="$PWD/$shim_path";; esac - if [ -e "$shim_path" ] && [ "$shim_path" -ef "$runner" ]; then + validated_shim_path="${1:-$HOME/.local/bin/julia}" + case "$validated_shim_path" in + /*) ;; + *) validated_shim_path="$PWD/$validated_shim_path";; + esac + if [ -e "$validated_shim_path" ] && [ "$validated_shim_path" -ef "$runner" ]; then fail "refusing to replace the daemon runner itself" fi +} + +install_shim() { + shim_path="$1" resolve_real_julia if [ -e "$shim_path" ]; then first_line=$(IFS= read -r line <"$shim_path" && printf '%s' "$line") @@ -388,8 +395,9 @@ case "$cmd" in ;; install-shim) [ $# -le 1 ] || fail "install-shim accepts at most one path" + validate_shim_path "${1:-}" install_daemonmode - install_shim "${1:-}" + install_shim "$validated_shim_path" ;; alias) [ $# -eq 0 ] || fail "alias takes no arguments" From 1e8bb9b8b6eca59ce12abe9d3c7b9ea94e4ea326 Mon Sep 17 00:00:00 2001 From: Huanhai Zhou Date: Thu, 6 Aug 2026 14:47:38 +0800 Subject: [PATCH 2/2] Apply suggestion from @hz-xiaxz Co-authored-by: LeoXia <114814844+hz-xiaxz@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91534d51b..5c2a24afc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" - - uses: astral-sh/setup-uv@v5 + - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - run: pip install pytest pytest-cov numpy scipy matplotlib - run: make test