caching ~/.cabal with github actions on windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

caching ~/.cabal with github actions on windows

Ben Franksen
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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

Oleg Grenrus
cabal-install doesn't use ~/.cabal on Windows.

See
https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory.html#v:getAppUserDataDirectory

- 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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

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 }}`.

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.html#v:getAppUserDataDirectory

- 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.

_______________________________________________
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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

Ben Franksen
In reply to this post by Oleg Grenrus
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.html#v:getAppUserDataDirectory

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

_______________________________________________
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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

Ben Franksen
In reply to this post by Orestis Melkonian
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

_______________________________________________
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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

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.
Reply | Threaded
Open this post in threaded view
|

Re: caching ~/.cabal with github actions on windows

Ben Franksen
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.
>


_______________________________________________
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.