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 1o7MAE-0000rE-01 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 19:18:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7MAC-0002mn-Po for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 19:18:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7MAC-0002me-Ez for pgsql-hackers@lists.postgresql.org; Fri, 01 Jul 2022 19:18:48 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7MA9-0001PG-IT for pgsql-hackers@postgresql.org; Fri, 01 Jul 2022 19:18:47 +0000 Received: by mail-qk1-x735.google.com with SMTP id b24so2535975qkn.4 for ; Fri, 01 Jul 2022 12:18:45 -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 :in-reply-to:user-agent; bh=txnC2Zzgw/Vy5kOwnXMuoC5oPy5lijC+Mj1V+fKk3rI=; b=UFonW8wpJpMAdDGPDleQ0tLlWjchm/x3mmzhUBxuatCKfS8VpMFBYssky+8PycxvEw XTEdBICTiEThB+681MjUXyurDtKX5qbv3hM0X/DhJhuvtF9WbTHx0JP+emcEj3u3YTPR M0yUSBarSgV+L8MHWaImErlZ/t16nfvpmisawczCjeiBUY0KFVgKgfuSeNSiFu8reYw4 eSs+Hbqt6UAf8Ajs+5Zmiy+W6ucZ4+DeWHfhSMrqaDYYRl/qmjK/5ZOKhBFOm4YCvVgY 5DASKuWkNOlcAETpVJo0OsFUAi7gDYhDmnOu9toqOUV6c5k9LIkLd5qMxd7zZQ1TOhO2 2SMg== 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:in-reply-to:user-agent; bh=txnC2Zzgw/Vy5kOwnXMuoC5oPy5lijC+Mj1V+fKk3rI=; b=1UJsEkShhCjgg8HYIULGXGz9BDE8/RDO4KH/2uIhpdN2o/a99Qtk8F4tsBWxIl/l12 VAdJDluxmp3JdHbRlQKd1TqD6LUd977lT9/11lRIUYJ+x8Be0IEgfIcETohzOwjtu/Ha JD0k7hsRJ8YF/f7qgOnqdVZzPdXmbhrSocsHADF5gmyC/dbJCcdK/XWyUtMFgENOfrj8 841/wXkM01M8Dw279YUDlRFWSQtGnqFNgFUsexkqgxu1i81WxnQ8X1B/N/2FUcrUlVp5 7/nX8igSzagkt7a2q9iYc6cvfO3xcQtoCu1eOzMIeGCOeQC63MNN8mT9JPjVlR2ZGHkL PBoA== X-Gm-Message-State: AJIora99MtpLYRg+ok8JFf35DZwBGlIbTSI36ig+Woxl1qrun0IVHXkl Benniyd5rm4ZDg1+WlZ8jX28tw== X-Google-Smtp-Source: AGRyM1sI/XSAVTGQZ+Bk0VpWcZdvA3w+ym91HVDauYYPfMeQOL5VRlctF5Tps4DWF9ihaD9RbV6Ylg== X-Received: by 2002:a05:620a:13a3:b0:6af:a58:c139 with SMTP id m3-20020a05620a13a300b006af0a58c139mr12080023qki.751.1656703123220; Fri, 01 Jul 2022 12:18:43 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id h15-20020a05620a400f00b006af147d4876sm16513058qko.30.2022.07.01.12.18.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2022 12:18:42 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 8EDC1801493; Fri, 1 Jul 2022 14:18:41 -0500 (CDT) Date: Fri, 1 Jul 2022 14:18:41 -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: Re: ccache, MSVC, and meson Message-ID: <20220701191841.GH13040@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="CblX+4bnyfN0pR09" Content-Disposition: inline In-Reply-To: <20220524203039.xyqjggtytsyizsbl@alap3.anarazel.de> 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 --CblX+4bnyfN0pR09 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 24, 2022 at 01:30:39PM -0700, Andres Freund wrote: > On 2022-05-24 14:52:02 -0500, Justin Pryzby wrote: > > > The spurious message should be fixed, of course. I suspect you dont need a > > > wrapper, you can just set CC='ccache cl.exe' or similar? Afaics it's not > > > meaningful to do 'CC=ccache.exe' alone, because then it'll interpret arguments > > > as ccache options, rather than compiler options. > > > > if meson didn't crash CC=ccache.exe might have worked, because I had set > > CCACHE_COMPILER. > > Did you report the issue? Should be simple enough to fix. > > I seriously doubt it's a good idea to use CCACHE_COMPILER - there's no way > meson (or autoconf or ..) can rely on the results of compiler tests that way, > since CCACHE_COMPILER can change at any time. This updated patch doesn't use CCACHE_COMPILER. cache misses are several times slower (12 minute build time vs 2:30 with ninja, without ccache), so it's possible that can be *slower* if the hit ratio is inadequate. ninja on cirrus builds 3x faster with ccache, but msbuild is only ~2x faster, so I recommend using it only with ninja. There's still warts requires using "plain" with /Z7 /MDd. --CblX+4bnyfN0pR09 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-cirrus-windows-ccache.patch" From 1c3823095eb9300fd0aae1fb569a3cc09b1346cc Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 22 May 2022 11:55:02 -0500 Subject: [PATCH] cirrus/windows: ccache https://community.chocolatey.org/packages/ccache https://www.postgresql.org/message-id/flat/20220522232606.GZ19626%40telsasoft.com 20220321001747.5o2zfoeqxvbjmdid@alap3.anarazel.de 20211012083721.hvixq4pnh2pixr3j%40alap3.anarazel.de CA%2BhUKGLs6ENKL4w1o%2B1RpcS4VLyLXSUMWRYJVaiLBOJtarW25g%40mail.gmail.com https://cirrus-ci.com/task/5456827583299584 https://cirrus-ci.com/task/6019777536720896 ci-os-only: xindows, windows-meson-ninja, xindows-meson-msbuild --- .cirrus.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index bf20f85f8ce..ed9e86557d7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -814,6 +814,9 @@ windows_template: &windows_template # currently have a tool for that... CIRRUS_ESCAPING_PROCESSES: 1 + CCACHE_DIR: $CIRRUS_WORKING_DIR/.ccache + CCACHE_LOGFILE: ccache.log + only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*' windows_container: @@ -828,12 +831,14 @@ windows_template: &windows_template set setup_additional_packages_script: | - REM choco install -y --no-progress ... - + choco install -y --no-progress ccache --version 4.6.1 + cp c:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.6.1-windows-x86_64\ccache.exe \BuildTools\VC\Auxiliary\Build + cp c:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.6.1-windows-x86_64\ccache.exe \ProgramData\chocolatey\bin\cl.exe task: <<: *windows_template name: Windows - Server 2019, VS 2019 - Homegrown + only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows-mkvcbuild' configure_script: # copy errors out when using forward slashes @@ -901,14 +906,22 @@ task: - mkdir subprojects - meson wrap install lz4 - meson wrap install zlib - - meson setup --buildtype debug --backend ninja -Dcassert=true -Db_pch=true -Dssl=openssl -Dlz4=enabled -Dzlib=enabled -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=c:/windows/system32/tar.exe build + - set CC=ccache.exe cl.exe + - meson setup --buildtype plain --backend ninja -Dcassert=true -Db_pch=false -Dssl=openssl -Dlz4=enabled -Dzlib=enabled -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=c:/windows/system32/tar.exe -Dc_args="/Z7 /MDd" build + + ccache_cache: + folder: $CCACHE_DIR build_script: + - ccache.exe --zero-stats - vcvarsall x64 - ninja -C build + - ccache.exe --show-stats + + always: + upload_caches: ccache check_world_script: - - vcvarsall x64 - meson test --no-rebuild -C build on_failure: @@ -934,14 +947,21 @@ task: - mkdir subprojects - meson wrap install lz4 - meson wrap install zlib - - meson setup --buildtype debug --backend vs -Dcassert=true -Db_pch=true -Dssl=openssl -Dlz4=enabled -Dzlib=enabled -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=c:/windows/system32/tar.exe build + - meson setup --buildtype plain --backend vs -Dcassert=true -Db_pch=false -Dssl=openssl -Dlz4=enabled -Dzlib=enabled -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=c:/windows/system32/tar.exe -Dc_args=/Z7 build + + ccache_cache: + folder: $CCACHE_DIR build_script: + - ccache.exe --zero-stats - vcvarsall x64 - - msbuild /p:UseMultiToolTask=true %MSBFLAGS% build\postgresql.sln + - msbuild /p:UseMultiToolTask=true /p:CLToolPath=c:\ProgramData\chocolatey\bin %MSBFLAGS% build\postgresql.sln + - ccache.exe --show-stats + + always: + upload_caches: ccache check_world_script: - - vcvarsall x64 - meson test --no-rebuild -C build always: -- 2.17.1 --CblX+4bnyfN0pR09--