Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nsuxp-00018Z-Dy for pgsql-hackers@arkaria.postgresql.org; Sun, 22 May 2022 23:26:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nsuxm-0004lK-2Z for pgsql-hackers@arkaria.postgresql.org; Sun, 22 May 2022 23:26:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nsuxl-0004iW-MZ for pgsql-hackers@lists.postgresql.org; Sun, 22 May 2022 23:26:17 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nsuxd-0003zy-Ov for pgsql-hackers@postgresql.org; Sun, 22 May 2022 23:26:16 +0000 Received: by mail-qk1-x72a.google.com with SMTP id bs17so11822569qkb.0 for ; Sun, 22 May 2022 16:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=VqKAxDFqRMUI7T2H8JB+DtfcvHXMO7a/eznmKSXcaGY=; b=wjZ0Eke85lVR2qOQi2AL53PsqWPWh+/sBQQU66ZNjusRtJU+ob7O+E+q6a/Mu14gRw RItqDj+kVx/9qloP28+LAgpJ3UeLymHXUKbFNvoTFX7Y3sFvg7wCwAtW16SWLD55ZwLL a6pe5kg2l1STdUhlVqHw02ozwuIZo4RndOJh2g3sQ9x3llnggETIyliy1v50p+Pcvszb cdietFIksXI35unmkpACL/eMEo6dJFIERNa02FqEHPk76nabIg2EkJU8xkNx+/rzLsTs L8XcKVeYKlOqWthieCcVAKshH8qdH5JB3GZVnd0mgdhC/jP4TQEcFPl+dLPeB4XM3uhp gyBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=VqKAxDFqRMUI7T2H8JB+DtfcvHXMO7a/eznmKSXcaGY=; b=4YLe0R4TP64Mg8oJXm+kYBlc6161/2s6fXO7ojJ/xAHj3qQz5+hZs2qxV2dN0NkrYi Gzb4vMmL7pTS22IuWO2p30zfp+/7vuEoblAV/epZ3qhwU0c6eLxUt0ntkkm6E0kj38mj 3hx/nLYsswmouma+sC53+6k3TicIQjp3TAbLOpyO3YxFDdnf6jQiaQSW+0RO2KXYdLOP bLXGPkjyftWKfbswenWqhMnmbWO9kOCGVlnOac9CsmKX5EJIoqojJ3LhKyEzEjuwCeSc /NGfAMWZpfTk9apiLUY4vr0MQW2/dJsswOYqr1dGPStmXAn6AciX7eJsdSY4NLDbuYFy EbBg== X-Gm-Message-State: AOAM531U1cx8z00MXYJ8TJNf3dwPa6118nY/jJei/EOkubBZdtTFBjln ALv55QHrxuobC6ShqUL/uS/gkw== X-Google-Smtp-Source: ABdhPJzhwJNpF4NdIsT2xoVZudpaiah0olW2OzFnN8Z0ZLJXddLVqyeowuRXV7WLxECHK9gBEfy2Rw== X-Received: by 2002:a05:620a:410f:b0:6a3:9be6:c161 with SMTP id j15-20020a05620a410f00b006a39be6c161mr851751qko.421.1653261968063; Sun, 22 May 2022 16:26:08 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id e11-20020ac8490b000000b002f914fa980bsm3457144qtq.79.2022.05.22.16.26.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 May 2022 16:26:07 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 50494800C62; Sun, 22 May 2022 18:26:06 -0500 (CDT) Date: Sun, 22 May 2022 18:26:06 -0500 From: Justin Pryzby To: Andres Freund Cc: Tom Lane , Robert Haas , Andrew Dunstan , pgsql-hackers@postgresql.org, Thomas Munro , Melanie Plageman , Peter Eisentraut , Daniel Gustafsson Subject: ccache, MSVC, and meson Message-ID: <20220522232606.GZ19626@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.