ccache, MSVC, and meson - Mailing list pgsql-hackers

From Justin Pryzby
Subject ccache, MSVC, and meson
Date
Msg-id 20220522232606.GZ19626@telsasoft.com
Whole thread Raw
Responses Re: ccache, MSVC, and meson
Re: ccache, MSVC, and meson
List pgsql-hackers
forking: <20220307191054.n5enrlf6kdn7zc42@alap3.anarazel.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.



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: 15beta1 test failure on mips in isolation/expected/stats
Next
From: Michael Paquier
Date:
Subject: Re: docs: mention "pg_read_all_stats" in "track_activities" description