Reject relative CCACHE_BASEDIR values too

This commit is contained in:
J. Nick Koston
2026-08-26 14:13:57 -05:00
parent 26e51c23b1
commit 1d4d28832e
2 changed files with 4 additions and 7 deletions
@@ -130,6 +130,6 @@ def test_effective_ccache_basedir_prefers_user_value(tmp_path: Path) -> None:
with patch.dict(os.environ, {}, clear=True):
assert ccache.effective_ccache_basedir() == str(tmp_path.resolve())
# Degenerate values would strip substrings ccache never rewrites
for bad in ("", "/"):
for bad in ("", "/", "a/b"):
with patch.dict(os.environ, {"CCACHE_BASEDIR": bad}, clear=True):
assert ccache.effective_ccache_basedir() == str(tmp_path.resolve())