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 1ntaZg-0000kV-ET for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2022 19:52:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntaZf-0000Er-6B for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2022 19:52:11 +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 1ntaZe-0000Eb-Q5 for pgsql-hackers@lists.postgresql.org; Tue, 24 May 2022 19:52:10 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntaZb-0003Zr-D6 for pgsql-hackers@postgresql.org; Tue, 24 May 2022 19:52:10 +0000 Received: by mail-qt1-x82a.google.com with SMTP id hh4so15516166qtb.10 for ; Tue, 24 May 2022 12:52:06 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jY2gkq3TJgnLb4gTwTU9+x3Q2Iyq7DxAiDNF/yzt9b0=; b=uHB6DHD4Zg2wD5mRXsODQfDszpkM9TQC9Y5jxIrlSz9nbRagbBjx5QJNhJnsET605J InyBowm6UUseu9EeRj57dGbZZWvFn6ENhiLt8qtrL+PFOvuZ2L9NpRf2Vnf7EuJl9hRy vHtM61Y9cVTDB3LjR7+MTYogrd7STC1U6KcbYKAwbYYaWcKPKdBfMKLioqUw0l5TGMsN HOKZ+R2VANng0v0TS+Dt4JDn9a1pMKiafY91EJ+bYSduQi+kVK+mrK1cqwYoZpBU6LCM 6yFhTP3+fvRJ5A1njmF13FhBepoW5tLPqTkhS6N5d1Io2j1loCjVlc6V2f8GhBeYAqhT ItDA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jY2gkq3TJgnLb4gTwTU9+x3Q2Iyq7DxAiDNF/yzt9b0=; b=GiLBB/FYkP969gU1KpQHOCbfGm2Atc1Z9PczNfPCTyShhKbQQpx23gaYbfK35moQey w37vosjwl42HxoHuijjRWqOSMtHt55vWl/Ui9v5BQyq3FSeW/4cdQoEHmG7unQOPAQP6 wdD3qfjecIcupcUoABSY3BZX5SyerXjr1ZCn/zyumH9DR58LRs1Kc9z47QGR7kupL/uS v5sjdKSqkh4TJxLQpOG4ExJPmztEZyy5AMMmWqED9lJIR4HJcKuXsk2tkqxiOgEMtNbR Z9jocaFswueXINZ31le0CuY/L5uWP8aJoXN6o0FYdzdKKagi8gUFenp7nLhqaS48C+YK 7Zgw== X-Gm-Message-State: AOAM533QhDpsFTMPUWM5x93amFaKG5jwtnaxjC26LgDxmidpNkPE+w/G okLDZnN5fOgS76iu/gFLQO6Wig== X-Google-Smtp-Source: ABdhPJy2ghyaTSIzDP5rfhSGDQBwUqWiYFwOBo/bMoHceJ0+LAd5w+ahImgXy+VNRnlAIE5IUu6sjQ== X-Received: by 2002:a05:622a:87:b0:2f9:26a8:fb94 with SMTP id o7-20020a05622a008700b002f926a8fb94mr14856125qtw.144.1653421924494; Tue, 24 May 2022 12:52:04 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id c10-20020a05620a200a00b006a33f89bb00sm69220qka.81.2022.05.24.12.52.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2022 12:52:03 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A88ED8007F5; Tue, 24 May 2022 14:52:02 -0500 (CDT) Date: Tue, 24 May 2022 14:52:02 -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: <20220524195202.GK19626@telsasoft.com> References: <20220522232606.GZ19626@telsasoft.com> <20220524193059.n432rlzezckxr6x2@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220524193059.n432rlzezckxr6x2@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 On Tue, May 24, 2022 at 12:30:59PM -0700, Andres Freund wrote: > Hi, > > On 2022-05-22 18:26:06 -0500, Justin Pryzby wrote: > > 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 > > No, because it never uses caching, because the way we set the output director > causes ccache to never cache. I think you're referring to the trailing backslash in the MSVC project file, meaning "write to a filename under this directory": src/tools/msvc/MSBuildProject.pm: .\\$cfgname\\$self->{name}\\ ccache was fixed to handle that in 4.6, and could be worked around before that by adding "%(Filename).obj". https://github.com/ccache/ccache/issues/1018 In any case, it really is caching, but without any positive effect: [17:02:01.555] Hits: 1398 / 1398 (100.0 %) [17:02:01.555] Direct: 1398 / 1398 (100.0 %) [17:02:01.555] Preprocessed: 0 / 0 [17:02:01.555] Misses: 0 [17:02:01.555] Direct: 0 [17:02:01.555] Preprocessed: 0 [17:02:01.555] Primary storage: [17:02:01.555] Hits: 2796 / 2796 (100.0 %) [17:02:01.555] Misses: 0 > > 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. > > [...] > > > 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. > > 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. As I recall, CC='ccache cl.exe' didn't work because it didn't attempt to do any argument splitting. The copy of ccache.exe is necessary because otherwise ccache "skips" over any leading "ccache[.exe]" components while searching for the real compiler. This is the only way I've gotten it to work (but feel free to comment at: https://github.com/ccache/ccache/issues/1039) -- Justin