[PR #3285] [CLOSED] [Other] Honor STRATA_INSTALL_DIR when locating gguf-py #4545

Closed
opened 2026-11-07 15:37:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3285
Author: @hulkbig
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: fix/gguf-install-dir-3269


📝 Commits (1)

  • 4abf1da Honor STRATA_INSTALL_DIR when locating gguf-py

📊 Changes

2 files changed (+100 additions, -3 deletions)

View changed files

📝 tools/_paths.py (+6 -3)
➕ tools/test_paths.py (+94 -0)

📄 Description

Problem and result

When STRATA_INSTALL_DIR points to an existing Control installation, standalone tools still fail to find its third_party/llama.cpp/gguf-py directory unless STRATA_GGUF_PY is also set. Control-mode setup writes that dependency beneath its install home, but _paths.py only checks the explicit GGUF override, source tree and development tree.

The helper now checks the configured install directory. An isolated reproduction using empty temporary directories goes from the reported missing-gguf-py SystemExit to returning the installed path.

Refs #3269. This implements the report's suggestion to check $STRATA_INSTALL_DIR/third_party/llama.cpp/gguf-py.

Approach

Keep STRATA_GGUF_PY first, then check STRATA_INSTALL_DIR, followed by the existing source/development fallbacks. A candidate still needs a gguf directory. With STRATA_INSTALL_DIR unset or empty, the existing lookup order is unchanged.

The new stdlib-only tests load _paths.py directly and use temporary directory trees and process-local environment patches. They require no gguf package or model files.

Validation

Linux x86_64, Python 3.12.14. Base: e88ee39d1d6be6e3364183af3b39b62a7ed6f211. Tested candidate tree: 20c39f7e709d092363fb5918e70695ab1b5b8eac.

Passed:

  • python3 -I -S -B tools/test_paths.py -v: 10/10 on the candidate.
  • python3 -I -S -B -m unittest discover -s tools -p test_paths.py -v: 10/10 on the candidate.
  • git diff --cached --check: clean.

Failed:

  • The identical test file alongside the unmodified base helper, run with python3 -I -S -B tools/test_paths.py -v: 7 passed, 1 assertion failure and 2 SystemExit errors. All three failures concern the configured install directory: finding it alone, selecting it before source/development copies, and falling back to it from an absent explicit GGUF path.
  • No failures on the candidate.

Not run:

  • iq_pack.py, setup, actual gguf imports, model conversion, packaged-Control integration or the full repository suite.
  • Windows/macOS execution and backend builds. No backend code changed.

Limits

STRATA_INSTALL_DIR must be set. This does not automatically discover a default per-user installation when the variable is absent, so it does not claim to fix every unpacked-package case in #3269. Setup already supplies STRATA_GGUF_PY to its preparation subprocesses; this change concerns standalone discovery.

AI-assisted implementation and test preparation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3285 **Author:** [@hulkbig](https://github.com/hulkbig) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/gguf-install-dir-3269` --- ### 📝 Commits (1) - [`4abf1da`](https://github.com/Niko1221/Strata/commit/4abf1da63ae26df75b91af015b26feb880b6f09a) Honor STRATA_INSTALL_DIR when locating gguf-py ### 📊 Changes **2 files changed** (+100 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tools/_paths.py` (+6 -3) ➕ `tools/test_paths.py` (+94 -0) </details> ### 📄 Description ## Problem and result When `STRATA_INSTALL_DIR` points to an existing Control installation, standalone tools still fail to find its `third_party/llama.cpp/gguf-py` directory unless `STRATA_GGUF_PY` is also set. Control-mode setup writes that dependency beneath its install home, but `_paths.py` only checks the explicit GGUF override, source tree and development tree. The helper now checks the configured install directory. An isolated reproduction using empty temporary directories goes from the reported missing-gguf-py `SystemExit` to returning the installed path. ## Related discussion Refs #3269. This implements the report's suggestion to check `$STRATA_INSTALL_DIR/third_party/llama.cpp/gguf-py`. ## Approach Keep `STRATA_GGUF_PY` first, then check `STRATA_INSTALL_DIR`, followed by the existing source/development fallbacks. A candidate still needs a `gguf` directory. With `STRATA_INSTALL_DIR` unset or empty, the existing lookup order is unchanged. The new stdlib-only tests load `_paths.py` directly and use temporary directory trees and process-local environment patches. They require no gguf package or model files. ## Validation Linux x86_64, Python 3.12.14. Base: `e88ee39d1d6be6e3364183af3b39b62a7ed6f211`. Tested candidate tree: `20c39f7e709d092363fb5918e70695ab1b5b8eac`. **Passed:** - `python3 -I -S -B tools/test_paths.py -v`: 10/10 on the candidate. - `python3 -I -S -B -m unittest discover -s tools -p test_paths.py -v`: 10/10 on the candidate. - `git diff --cached --check`: clean. **Failed:** - The identical test file alongside the unmodified base helper, run with `python3 -I -S -B tools/test_paths.py -v`: 7 passed, 1 assertion failure and 2 `SystemExit` errors. All three failures concern the configured install directory: finding it alone, selecting it before source/development copies, and falling back to it from an absent explicit GGUF path. - No failures on the candidate. **Not run:** - `iq_pack.py`, setup, actual gguf imports, model conversion, packaged-Control integration or the full repository suite. - Windows/macOS execution and backend builds. No backend code changed. ## Limits `STRATA_INSTALL_DIR` must be set. This does not automatically discover a default per-user installation when the variable is absent, so it does not claim to fix every unpacked-package case in #3269. Setup already supplies `STRATA_GGUF_PY` to its preparation subprocesses; this change concerns standalone discovery. AI-assisted implementation and test preparation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:37:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4545
No description provided.