fix(state): handle permission errors creating the state dir
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
Fixes #869
Does both things suggested in the issue:
- If the runtime dir can't be created, fall back to the home temporary directory (already the fallback on Linux when the runtime dir is under /tmp).
- If the state dir itself can't be created, raise a StateServiceError that suggests setting CRAFT_STATE_DIR.
I ran ruff, ty, codespell and the full test suite in a Linux container rather than `make lint && make test`. No new failures: the tests that fail there fail on main too.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/craft-application/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [ ] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [x] I've updated the relevant release notes.
Evaluation history
No evaluation history available.
Update history
| Date | Change |
|---|---|
| updated | |
| created |
Related issues
No embedding available for this issue yet. Run scripts/run_llm.py evaluate to enable similarity search.