ccache, MSVC, and meson

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: ccache, MSVC, and meson
Date: 2022-05-22 23:26:06
Message-ID: 20220522232606.GZ19626@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

forking: <20220307191054(dot)n5enrlf6kdn7zc42(at)alap3(dot)anarazel(dot)de>

An update.

ccache 4.6.1 was released which allows compiling postgres
I submitted a request to update the package in chocolatey.

But with the existing build system, it's no faster anyway, I guess due to poor
use of parallelism.
https://cirrus-ci.com/task/5972008205811712

Currently, meson doesn't (automatically) use ccache with MSVC - see
mesonbuild/environment.py.

And CC=ccache gives an error - I suppose it should not try to pop ccache off the
compiler list if the list has only one element.

|[21:44:49.791] File "C:\python\lib\site-packages\mesonbuild\compilers\detect.py", line 375, in _detect_c_or_cpp_compiler
|[21:44:49.791] compiler_name = os.path.basename(compiler[0])
|[21:44:49.791] IndexError: list index out of range
|...
|[21:44:49.791] meson.build:1:0: ERROR: Unhandled python exception
|[21:44:49.791]
|[21:44:49.791] This is a Meson bug and should be reported!

But it can be convinced to use ccache by renaming the executable to "pgccache".
Which builds in 46sec: https://cirrus-ci.com/task/4862234995195904
This requires ccache 4.6, released in Feburary and already in choco.
Note that ccache supports neither /Zi debugging nor precompiled headers.
I'm not sure, but -Dc_args=/Z7 may do what's wanted here.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-05-22 23:53:24 Re: docs: mention "pg_read_all_stats" in "track_activities" description
Previous Message Andres Freund 2022-05-22 22:29:30 Re: 15beta1 test failure on mips in isolation/expected/stats