-
Notifications
You must be signed in to change notification settings - Fork 54
Output cabal-store
: Use XDG directory structure for cabal 3.10?
#210
Comments
Caching failure due to this problem in the wild:
|
Workaround: steps:
- uses: actions/checkout@v3
- name: Switch off XDG directories for cabal (Linux)
if: ${{ runner.os == 'Linux' }}
run: |
mkdir -p ~/.cabal
# The presence of ~/.cabal switches cabal 3.10 to not use the XDG layout.
- uses: haskell/actions/setup@v2 |
I believe setting |
@athas wrote:
Thanks! @Mikolaj @ulysses4ever If I integrate |
We set the `store-dir` (`outputs.cabal-store`) explicitly in the cabal configuration file because cabal 3.10 has some context-dependent default for it: If `~/.cabal` is not present, it uses the new XDG layout, otherwise not.
Please go ahead. When we want to switch to XDG, we'll find a way around, e.g., we'd empty the env variable. |
This option was meant to be disruptive. (In the hindsight, haskell/cabal#8577 perhaps had a good idea for managing some of the disruption.) In the interest of damage management, I'd say, forcing the old way in the CI sounds fine. Maybe a more principled solution would be to make another action parameter for whether or not to do what you suggest (and by default indeed do that). Although, not many users would be interested in such partner, perhaps, and it's a code that you need to maintain... All in all, it's your call. Erroring on the safe side is perhaps preferable. |
Well, I'm afraid if the action explicitly set it, we won't be able to do anything. Except, as I do in haskell/cabal#8840, opt out of cabal update in the action altogether. |
…213) We set the `store-dir` (`outputs.cabal-store`) explicitly in the cabal configuration file because cabal 3.10 has some context-dependent default for it: If `~/.cabal` is not present, it uses the new XDG layout, otherwise the legacy layout. Update: Also need to create `~/.cabal` to avoid XDG fallback, so we create `~/.cabal/bin`. Likely this makes the "set `store-dir`" patch obsolete, but we keep it for uniformity (it anyway happens on Windows, now on all platforms). CI update: Make sure we test Linux + cabal-3.10 with `cabal-update` to catch problems with confusion about the directory layout (XDG or not). Closes #210.
For now, I settled for the workaround that creates Released as |
The GitHub action now uses `$XDG_STATE_HOME/cabal`, which is why our cache wasn't working. See haskell/actions#210
…10 XDG (haskell#213) We set the `store-dir` (`outputs.cabal-store`) explicitly in the cabal configuration file because cabal 3.10 has some context-dependent default for it: If `~/.cabal` is not present, it uses the new XDG layout, otherwise the legacy layout. Update: Also need to create `~/.cabal` to avoid XDG fallback, so we create `~/.cabal/bin`. Likely this makes the "set `store-dir`" patch obsolete, but we keep it for uniformity (it anyway happens on Windows, now on all platforms). CI update: Make sure we test Linux + cabal-3.10 with `cabal-update` to catch problems with confusion about the directory layout (XDG or not). Closes haskell#210.
Newly released
cabal 3.10.1.0
uses the XDG directory structure unless a~/.cabal
is already present.From https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.1.0.md#significant-changes:
We likely need to adapt the
cabal-store
output to respect this change or make sure stuff lands in./~cabal
as it used to be:actions/setup/src/setup-haskell.ts
Lines 61 to 67 in 86bd3ed
Upstream issue:
The text was updated successfully, but these errors were encountered: