caching ~/.cabal with github actions on windows

I can't get this to work. It works perfectly fine on Linux and MacOS but on Windows cabal always re-builds all the dependencies. The cache post-action on Windows tells me that the cache hasn't changed, which means cabal actually re-created the ~/.cabal directory exactly as it was in the cache! Is this a known bug in cabal on Windows? Does anyone have a work-around? Cheers Ben

cabal-install doesn't use ~/.cabal on Windows. See https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory.... - Oleg On 13.11.2020 12.43, Ben Franksen wrote:
I can't get this to work. It works perfectly fine on Linux and MacOS but on Windows cabal always re-builds all the dependencies. The cache post-action on Windows tells me that the cache hasn't changed, which means cabal actually re-created the ~/.cabal directory exactly as it was in the cache!
Is this a known bug in cabal on Windows?
Does anyone have a work-around?
Cheers Ben
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Note that if you use the setup-haskell action (https://github.com/actions/setup-haskell), you can get the directory from its outputs, i.e. `${{ steps.setup-haskell-cabal.outputs.cabal-store }}`. Cheers, --OM On 11/13/20 12:54 PM, Oleg Grenrus wrote:
cabal-install doesn't use ~/.cabal on Windows.
See https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory....
- Oleg
On 13.11.2020 12.43, Ben Franksen wrote:
I can't get this to work. It works perfectly fine on Linux and MacOS but on Windows cabal always re-builds all the dependencies. The cache post-action on Windows tells me that the cache hasn't changed, which means cabal actually re-created the ~/.cabal directory exactly as it was in the cache!
Is this a known bug in cabal on Windows?
Does anyone have a work-around?
Cheers Ben
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Am 13.11.20 um 12:13 schrieb Orestis Melkonian:
Note that if you use the setup-haskell action (https://github.com/actions/setup-haskell), you can get the directory from its outputs, i.e. `${{ steps.setup-haskell-cabal.outputs.cabal-store }}`.
Thanks, I'll try that. Cheers Ben

Am 13.11.20 um 12:35 schrieb Ben Franksen:
Am 13.11.20 um 12:13 schrieb Orestis Melkonian:
Note that if you use the setup-haskell action (https://github.com/actions/setup-haskell), you can get the directory from its outputs, i.e. `${{ steps.setup-haskell-cabal.outputs.cabal-store }}`.
Thanks, I'll try that.
It hasn't completed but looks pretty good. In fact the cabal store path gets shown as path: C:\sr I would never have guessed that path, nor did I see it in the cabal docs. (BTW, the "setup-haskell-cabal" in your reply is the id: that you have given your setup-haskell step; it took me a while to figure that out since I am pretty new to github actions). Thanks again Ben

Caching works now and re-running the job gets it down to 2 minutes (from 15 for the first run). Awful! Thanks! Cheers Ben Am 13.11.20 um 13:12 schrieb Ben Franksen:
Am 13.11.20 um 12:35 schrieb Ben Franksen:
Am 13.11.20 um 12:13 schrieb Orestis Melkonian:
Note that if you use the setup-haskell action (https://github.com/actions/setup-haskell), you can get the directory from its outputs, i.e. `${{ steps.setup-haskell-cabal.outputs.cabal-store }}`.
Thanks, I'll try that.
It hasn't completed but looks pretty good. In fact the cabal store path gets shown as
path: C:\sr
I would never have guessed that path, nor did I see it in the cabal docs.
(BTW, the "setup-haskell-cabal" in your reply is the id: that you have given your setup-haskell step; it took me a while to figure that out since I am pretty new to github actions).
Thanks again Ben
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Am 13.11.20 um 11:54 schrieb Oleg Grenrus:
cabal-install doesn't use ~/.cabal on Windows.
See https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory....
Thanks. I already suspected that was causing the problem, so I tried to set CABAL_DIR to a fixed location (and cache that instead): env: CABAL_DIR: ${{ github.workspace }}/dot-cabal Again, this works fine on Linux and MacOS but not on Windows. Cheers Ben
participants (3)
-
Ben Franksen
-
Oleg Grenrus
-
Orestis Melkonian