Skip to content

Commit 14dbb98

Browse files
committed
feat!: Store logs under XDG_STATE_HOME instead of XDG_CACHE_HOME
https://specifications.freedesktop.org/basedir/0.8/#variables: > The $XDG_STATE_HOME contains state data that should persist between > (application) restarts, but that is not important or portable enough > to the user that it should be stored in $XDG_DATA_HOME. It may > contain: > > • actions history (logs, history, recently used files, …) > • current state of the application that can be reused on a restart > (view, layout, open files, undo history, …)
1 parent 90f7a09 commit 14dbb98

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

cabal-install/src/Distribution/Client/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ defaultStoreDir =
829829

830830
defaultLogsDir :: IO FilePath
831831
defaultLogsDir =
832-
getDefaultDir XdgCache "logs"
832+
getDefaultDir XdgState "logs"
833833

834834
defaultReportsDir :: IO FilePath
835835
defaultReportsDir =

changelog.d/pr-12051.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
synopsis: Store logs under XDG_STATE_HOME instead of XDG_CACHE_HOME
3+
packages: [cabal-install]
4+
prs: 12051
5+
---
6+
7+
- before: logs are stored under `${XDG_CACHE_HOME:-$HOME/.cache}/cabal/logs`
8+
- after: logs are stored under `${XDG_STATE_HOME:-$HOME/.local/state}/cabal/logs`
9+
- ref: <https://specifications.freedesktop.org/basedir/0.8/#variables>

doc/cabal-commands.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ installed binaries, and so on.
743743
compiler-store-path: /home/alice/.local/state/cabal/store/ghc-9.8.2
744744
cache-home: /home/alice/.cache/cabal
745745
remote-repo-cache: /home/alice/.cache/cabal/packages
746-
logs-dir: /home/alice/.cache/cabal/logs
746+
logs-dir: /home/alice/.local/state/cabal/logs
747747
store-dir: /home/alice/.local/state/cabal/store
748748
config-file: /home/alice/.config/cabal/config
749749
installdir: /home/alice/.local/bin
@@ -767,7 +767,7 @@ Or using the json output:
767767
},
768768
"cache-home": "/home/alice/.cache/cabal",
769769
"remote-repo-cache": "/home/alice/.cache/cabal/packages",
770-
"logs-dir": "/home/alice/.cache/cabal/logs",
770+
"logs-dir": "/home/alice/.local/state/cabal/logs",
771771
"store-dir": "/home/alice/.local/state/cabal/store",
772772
"config-file": "/home/alice/.config/cabal/config",
773773
"installdir": "/home/alice/.local/bin"

doc/cabal-project-description-file.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,7 @@ Advanced global configuration options
18631863
--logs-dir=DIR
18641864
:synopsis: Directory to store build logs.
18651865

1866-
:default: ``~/.cache/cabal/logs``
1866+
:default: ``~/.local/state/cabal/logs``
18671867

18681868
:strike:`The location where build logs for packages are stored.`
18691869
Not implemented yet.
@@ -1874,7 +1874,7 @@ Advanced global configuration options
18741874
--build-summary=TEMPLATE
18751875
:synopsis: Build summaries location.
18761876

1877-
:default: ``~/.cache/cabal/logs/build.log``
1877+
:default: ``~/.local/state/cabal/logs/build.log``
18781878

18791879
:strike:`The file to save build summaries.` Not implemented yet.
18801880

0 commit comments

Comments
 (0)