Re: BUG #15525: Build failures when compiling Postgres with Make parallelization - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15525: Build failures when compiling Postgres with Make parallelization
Date
Msg-id 31602.1543363896@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15525: Build failures when compiling Postgres with Makeparallelization  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15525: Build failures when compiling Postgres with Make parallelization  (Jack Kelly <jack@jackkelly.name>)
List pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> There have been multiple reports to the Nix package manager that compiling
> PostgreSQL on macOS with Make's -j option have resulted in build failures.
> As far as we know, this has only happened on macOS.

This isn't too helpful if you don't mention which macOS version nor what
sort of hardware exactly.  Most PG developers use parallel builds
routinely, so we know that it's not broken in general.

For me, trying 9.6 branch on macOS Mojave (10.14.1) on a 2018 6-core MBP,
"make -j" is unusable because the OS fails to support an indefinite number
of processes: lots of commands fall over with messages like
    clang: error: unable to execute command: posix_spawn failed: Resource temporarily unavailable
This is not a Postgres bug; maybe you could make a case that it's
make's fault, but I'm not sure.  It looks like a lot of the fork
failures happen outside of make's view.

However, if I use a more reasonable parallelism level like -j8,
or even as high as -j25, it goes through fine.  It doesn't look
like there's any net reduction in build time above around -j10,
so I'm not very excited about seeing whether it would fall over
at some level short of what breaks the OS.

Having said that, we did do a round of patches in the v11 development
cycle that addressed some parallel-make hazards.  A lot of said hazards
were new in v11 :-(, but I think that some of them were pre-existing
problems.  So you might find that PG 11 is more resistant to whatever
is going on here.

BTW, are you using the Apple-supplied make, or some other version?
In the past we've had to fight with parallelism bugs in old gmake
versions ...

            regards, tom lane


pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: BUG #15525: Build failures when compiling Postgres with Make parallelization
Next
From: Thomas Munro
Date:
Subject: Re: BUG #15520: PAM authentication + domain socket -> DNS query forsymbolic hostname [local]