Hi,
On 2026-06-05 11:05:08 -0700, Jacob Champion wrote:
> Based on the conversation at [1].
>
> This caches the Perl site directory after we've installed IPC::Run.
Cool!
Worth noting that while the baseline install time isn't that slow, it does
occasionally take a good bit longer, sometimes it has to retry for quite a few
minutes to download.
> After consulting with Christoph Berg and David Wheeler on the Discord,
> I've set up the cache to key on the output of `perl -V`, so that we'll
> rebuild it after any change to Perl underneath us.
Makes sense.
> @@ -808,6 +816,8 @@ jobs:
> PG_TEST_USE_UNIX_SOCKETS: 1
> PG_REGRESS_SOCK_DIR: 'd:\pgsock'
> TAR: "c:/windows/system32/tar.exe"
> + CPAN_CACHE_DIRS: |
> + C:\Strawberry\perl\site
In 93d97349461347d952e8cebdf62f5aa84b4bd20a, I kinda had implemented such
caching for macos. There I used
PERL5LIB: ${HOME}/perl5/lib/perl5
to put the cache somewhere under our control. Any reason to not do that?
> - - name: Install dependencies
> + # Rebuild the CPAN cache whenever `perl -V` changes.
> + - name: Compute Perl version cache key
> + id: perlkey
> + shell: 'C:\msys64\usr\bin\bash.exe --login -eo pipefail "{0}"'
> + run: |
> + perl_hash=$(/c/Strawberry/perl/bin/perl -V | md5sum | cut -f1 -d '
> ')
> + echo "key=perl${perl_hash}" >> "$GITHUB_OUTPUT"
Hm. It'd be nicer if we didn't have to repeat this part between the two
tasks... Perhaps we can make it work using the small overlap between the
different shells?
Or maybe shell: bash would actually work well enough between the tasks (without
-- login it might not overwrite PATH).
Greetings,
Andres Freund