Re: Mingw task for Cirrus CI

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Mingw task for Cirrus CI
Date: 2022-04-07 20:48:50
Message-ID: 541b6c1d-07c4-8760-9698-620026a3de39@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 4/7/22 13:10, Andres Freund wrote:
> Hi,
>
> On 2022-04-06 11:03:37 -0400, Andrew Dunstan wrote:
>> On 3/30/22 20:26, Andres Freund wrote:
>>> Could you try using dash to invoke configure here, and whether it makes configure faster?
>> I got weird failures re libxml/parser.h when I tried with dash. See
>> <https://cirrus-ci.com/task/5963254039052288> (It would be nice if we
>> could see config.log on failure.)
> Since dash won't help us to get the build time down sufficiently, and the
> tests don't pass without a separate build tree, I looked at what makes
> config/prep_buildtree so slow.
>
> It's largely just bad code. The slowest part are spawning one expr and mkdir
> -p for each directory. One 'cmp' for each makefile doesn't help either.
>
> The expr can be replaced with
> subdir=${item#$sourcetree}
> that's afaics posix syntax ([1]), not bash.
>
> Spawning one mkdir for each directory can be replaced by a single mkdir
> invocation with all the directories. On my linux workstation that gets the
> time for the first loop down from 1005ms to 38ms, really.
>
> That has the danger of the commandline getting too long. But since we rely on
> the final link of the backend to be done in a single command, I don't think
> it's making things worse? We could try to use xargs otherwise, iirc that's in
> posix as well.
>
> Using parameter substitution in the second loop takes it down from 775ms to
> 533ms. Not calling cmp when the file doesn't exist cuts it down to 337ms.
>
> I don't know of a way to batch the call to ln. The time with ln replaced with
> : is 151ms, fwiw.

AFAIK Msy2s 'ln -s' by default copies a non-directory rather than
actually symlinking it. If we want real symlinks, then we need
MSYS=|winsymlinks:nativestrict set. The is will fail unless the calling
user is an Administrator or has the SeCreateSymbolicLink privilege. See
|

|<https://postgr.es/m/|e05b213c-1257-84d4-f079-5c4d8c79e3ad(at)dunslane(dot)net>
for more details.

> On windows that makes prep_buildtree go from 42.4s to 5.8s for me.

That's pretty good.

I think we can get rid of the CVS pruning, it's only 15 years or so
since we've had that in the tree.

+        if test ! -d "$buildtree/$subdir"; then
+            echo "$buildtree/$subdir"
+        fi

I would probably just write that as

test -d "$buildtree/$subdir' || echo "$buildtree/$subdir"

although it's really just a matter of taste.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-04-07 20:52:26 Re: Mingw task for Cirrus CI
Previous Message Yedil Serzhan 2022-04-07 20:40:44 GSOC proposal for Improve pgarchives by Yedil