Re: MinGW ccache snafu on CI

From: Andres Freund <andres(at)anarazel(dot)de>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MinGW ccache snafu on CI
Date: 2026-07-07 17:37:03
Message-ID: s3x4xcr3jroaoy6orbsrxnudlaew3pwafskwtxxq6olvdydolv@m7t63a35jphl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-07-04 16:44:47 +1200, Thomas Munro wrote:
> As previously reported[1] (also discussed on Discord a few times), the
> MinGW CI job is capable of getting confused like this:
>
> Cache restored from key: ccache:windows-mingw:thread-work:28559723796:1
>
> # check for "D:/a/postgres/postgres/build/tmp_install/usr/local/pgsql/bin/vacuumdb"
> failed: incorrect version: found "vacuumdb (PostgreSQL) 19beta1",
> expected "vacuumdb (PostgreSQL) 20devel"
>
> Apparently ccache failed to recompile stuff that it should have, and
> produced a stale .o from an earlier build in the same repo/branch.
> While "19beta1" and "20devel" have the same length, I doubt that a
> mere few hundred monkeys with typewriters have found multiple hash
> collisions...
>
> One observation is that the MinGW job is using precompiled headers
> (-Db_pch=true). I wonder if we might be using the wrong switches[2],
> but I don't claim to understand that stuff...
>
> So is the MSVC job, but I don't recall hearing of any problems there.
>
> [1] https://www.postgresql.org/message-id/flat/E1vOJwR-001XFf-0r%40gemulon.postgresql.org
> [2] https://ccache.dev/manual/4.1.html#_precompiled_headers

There's another thread about this:
https://www.postgresql.org/message-id/CAN55FZ0tqR6Xz%3DiVFLc1BBoLOEHU775ARhcGYwggHA3XLA%3DoQg%40mail.gmail.com

As suggested there, I think we need to add -fpch-deps for gcc, until either
ccache is fixed or meson adds it automatically.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-07-07 17:46:24 Re: Bug: mdunlinkfiletag unlinks mainfork seg.0 instead of indicated fork+segment
Previous Message Andres Freund 2026-07-07 17:35:34 Re: ci: namespace ccache by PostgreSQL major version