Re: clang prefix for centos7

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Devrim Gündüz <devrim(at)gunduz(dot)org>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-pkg-yum <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Re: clang prefix for centos7
Date: 2020-03-06 04:52:54
Message-ID: CAMsr+YHokx0rWLV561z3=gAi6CM4YJekgCLkqmDwQSTEjVYhuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

> The OS-default clang version is not sufficient enough to build PostgreSQL.

This is a packaging bug in the PGDG yum CentOS 7 packages. I reported
it earlier; see
https://www.postgresql.org/message-id/CAMsr+YGzuPv3qSBp3LCrc9SnYi=iHfijdjERNNufh75+YM-92g@mail.gmail.com
.

The centos7 postgresql11-devel package is broken. I'll reply with a
followup mail with details so I don't upset the automailmod
but in short installing the devel package gets you an unusable build
env due to missing dependencies.

It's seemingly broken for all Pg versions really due to not declaring
a dependency on clang. It's just worse for centos 7 because you can't
simply install the required clang. I originally tested adding explicit
dependences on SCL's llvm toolset and clang, but that proved painful
for other reasons. Especially since the steps to enable the SCL llvm
toolset repo differ for CentOS 7 vs RHEL 7.

So instead I propose that:

* For CentOS 7, patch pgxs.mk to detect a missing clang and not add
the bytecode dependency rules;
* For OSes > CentOS 7 where we don't need to use SCL to get a suitable
llvm, add a Requires: for the appropriate clang to the devel package,
matching the BuildRequires specified by the source package.

A patch for pgxs.mk is attached. I suggest adding it as a rpmbuild
patch when building for centos 7.

IMO the whole mess really a PGXS / build system issue where we bake
the tool and compiler paths into our Makefile.global and pgxs.mk. But
that's not simple to fix, since we have no guarantee that other tools
found elsewhere will be compatible and produce correct code. I've seen
a similar problem appear when the VM/container that built the postgres
packages themselves used ccache, but ccache was not present on the
machine that then installed the -devel package. At least that's easy
to work around and defend against though.

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

Attachment Content-Type Size
RM13825-llvm-toolset.patch text/x-patch 963 bytes

In response to

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Craig Ringer 2020-03-06 04:55:11 Re: clang prefix for centos7
Previous Message Dave Cramer 2020-03-05 22:31:34 Re: RHEL 7: problem with gdal 2.3 postgresql 9.6/10 and postgis 2.4 -