Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

setup: every finish mark is written with a warning on a read-only folder (#570)

Niko12213c6456a2e623
diff --git a/setup.py b/setup.py
index 657f88892..7143732f6 100644
--- a/setup.py
+++ b/setup.py
@@ -317,7 +317,12 @@ def done(path: Path) -> bool:
def mark(path: Path, text=""):
- path.with_name(path.name + ".done").write_text(text or time.strftime("%Y-%m-%d %H:%M"), encoding="utf-8")
+ """Write the finish mark. A folder that cannot be written (--gguf-dir on a read-only share, #570) only costs the
+ mark: setup says so and goes on (the step is repeated on the next run), it does not stop."""
+ try:
+ path.with_name(path.name + ".done").write_text(text or time.strftime("%Y-%m-%d %H:%M"), encoding="utf-8")
+ except OSError as e:
+ warn(f"the finish mark of {path.name} cannot be written ({e}): the next run does this step again")
# ------------------------------------------------------------------------------------------------ the PC
diff --git a/tools/test_setup_choices.py b/tools/test_setup_choices.py
index f7eb3a8e2..f7e16f4e0 100644
--- a/tools/test_setup_choices.py
+++ b/tools/test_setup_choices.py
@@ -176,6 +176,14 @@ class ReadOnlyGgufDir(unittest.TestCase):
self.assertIn("is whole but its finish mark cannot be written", out)
+ def test_mark_itself_never_stops_on_a_read_only_folder(self):
+ """#570: every finish mark (the SHA-256 result of a verified shard too), not only the one for a whole shard."""
+ with tempfile.TemporaryDirectory() as tmp, mock.patch.object(Path, "write_text",
+ side_effect=PermissionError(13, "read-only")):
+ setup.mark(Path(tmp) / "x.gguf", "sha256 abc") # no exception
+ self.assertFalse(setup.done(Path(tmp) / "x.gguf"))
+
+
class ExperimentalSm60(unittest.TestCase):
"""#295: Pascal (6.x) and Volta (7.0) only with STRATA_EXPERIMENTAL_SM60=1, built with -DSTRATA_EXPERIMENTAL_SM60=ON
and a CUDA 12.x toolkit; nothing changes without the variable."""