From ece6cebc0351e443b134cf8798f7da5d1b5acbc0 Mon Sep 17 00:00:00 2001 From: Dividesbyzer0 <54127744+zoomdbz@users.noreply.github.com> Date: Mon, 15 Jun 2026 02:03:55 -0400 Subject: [PATCH] fix(cookbook): create bin dir before llama-server link Ensure ~/bin exists before the llama.cpp accelerated build script creates the llama-server link. --- routes/cookbook_helpers.py | 1 + tests/test_cookbook_helpers.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/routes/cookbook_helpers.py b/routes/cookbook_helpers.py index c2f93cb77..e54d6560b 100644 --- a/routes/cookbook_helpers.py +++ b/routes/cookbook_helpers.py @@ -742,6 +742,7 @@ def _append_llama_cpp_linux_accel_build_lines(runner_lines: list[str]) -> None: runner_lines.append(' done') # rm -rf build so a prior poisoned CMakeCache.txt (e.g. from a failed CUDA # or HIP attempt) doesn't cause the next configure to reuse stale settings. + runner_lines.append(' mkdir -p ~/bin') runner_lines.append(' cd ~/llama.cpp && rm -rf build') runner_lines.append(' if command -v hipconfig &>/dev/null || [ -d /opt/rocm ] || [ -n "$ROCM_PATH" ] || [ -n "$HIP_PATH" ]; then') runner_lines.append(' if command -v hipconfig &>/dev/null; then') diff --git a/tests/test_cookbook_helpers.py b/tests/test_cookbook_helpers.py index 779b48e3c..696b610df 100644 --- a/tests/test_cookbook_helpers.py +++ b/tests/test_cookbook_helpers.py @@ -588,6 +588,8 @@ def test_llama_cpp_linux_bootstrap_prefers_rocm_before_cuda(): _append_llama_cpp_linux_accel_build_lines(runner_lines) script = "\n".join(runner_lines) + assert "mkdir -p ~/bin" in script + assert script.index("mkdir -p ~/bin") < script.index("cd ~/llama.cpp && rm -rf build") assert 'command -v hipconfig &>/dev/null || [ -d /opt/rocm ] || [ -n "$ROCM_PATH" ] || [ -n "$HIP_PATH" ]' in script assert 'cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_HIP=ON' in script assert 'cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON' in script