From: Andy Bailey <bailey@akamai.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name
Date: Fri, 15 Jul 2022 11:13:57 -0500
Message-ID: <20220715161357.rezc6eohze3ebaya@akamai.com> (raw)
Hi All,
Recently I was debugging an issue in which builds of postgresql
succeeded on a developer's workstation, but failed in our company's
build system.
After some investigation, I found that the value of pkglibdir (as used
by src/Makefile.global and various other places) was different even
though the ./configure invocations were identical. Eventually, I found
that Makefile.global was the culprit, with some sections like:
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
override pkglibdir := $(pkglibdir)/postgresql
endif
endif
On the developer's workstation, the sources had been unpacked in a
directory, e.g. (the structure is a quirk convention of an internal
tool)
$HOME/src/postgresql13-13.7/source
On the production build system, the path used was:
/build/source
The --prefix used is a subdirectory of the source directory (in this
context we're only building the source to get the static libpq and
headers, which we use to build another piece of software).
On the developer's workstation, the string "postgres" is part of the
path, and thus pkglibdir does not get "postgresql" appended via an
override (nor any of the other variables). But on the build system,
both tests pass, and the override with appended "postgresql" do occur.
I'm assuming that the intention of findstring postgres was to tidy up
values like pkglibdir when libdir is e.g. /usr/lib/postgres/, which
makes sense, but not when "postgres" appears in libdir for some other
reason.
We're able to patch around this, but I thought it might be worth
reporting. I considered devising a patch but haven't yet thought of a
good strategy, and I suspect it might be trick to avoid breaking other
users who may (even unwittingly) rely on this quirk. I would be
delighted to accept any suggestions however.
Thanks!
.andy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: bailey@akamai.com
Subject: Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name
In-Reply-To: <20220715161357.rezc6eohze3ebaya@akamai.com>
References: <20220715161357.rezc6eohze3ebaya@akamai.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox