Missing -devel dependency in CentOS 7 LLVM support

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Missing -devel dependency in CentOS 7 LLVM support
Дата
Msg-id CAMsr+YGzuPv3qSBp3LCrc9SnYi=iHfijdjERNNufh75+YM-92g@mail.gmail.com
обсуждение исходный текст
Список pgsql-pkg-yum
Hi folks

TLDR: postgresql11-devel and postgresql12-devel need to have the
following added:

%if 0%{llvm}
%if 0%{?rhel} && 0%{?rhel} == 7
Requires: llvm5.0-devel >= 5.0 llvm-toolset-7-clang >= 4.0.1
%endif
%endif

Why?

The PGDG rpms for CentOS 7 require LLVM from EPEL and SCL. The
packages used have a nonstandard path per the specfile:

%if %llvm
%if 0%{?rhel} && 0%{?rhel} == 7
        CLANG=/opt/rh/llvm-toolset-7/root/usr/bin/clang
LLVM_CONFIG=%{_libdir}/llvm5.0/bin/llvm-config --with-llvm \
%else
        --with-llvm \
%endif
%endif

This path gets baked into Pg's Makefile.global where it's used by PGXS
so PGXS will invoke clang as /opt/rh/llvm-toolset-7/root/usr/bin/clang
.

But if the user installs postgresql-devel they won't get the required
tools so they'll get build errors like

+ make USE_PGXS=1 -s -j12
make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found
make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found

I suggest the following change to make it more maintainable. First,
where the BuildRequires are defined, change the

%if 0%{?rhel} && 0%{?rhel} == 7
BuildRequires:  llvm5.0-devel >= 5.0 llvm-toolset-7-clang >= 4.0.1
%endif

to

%if 0%{?rhel} && 0%{?rhel} == 7
%global rhel7_llvm_toolset llvm5.0-devel >= 5.0 llvm-toolset-7-clang >= 4.0.1
BuildRequires:  %{rhel7_llvm_toolset}
%endif


then in the %package devel section add


%if 0%{llvm}
%if 0%{?rhel} && 0%{?rhel} == 7
Requires: %{rhel7_llvm_toolset}
%endif
%endif


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



В списке pgsql-pkg-yum по дате отправления:

Предыдущее
От: cwlists
Дата:
Сообщение: Re: postgresql94 packages in PostgreSQL 12 EL6 and EL8
Следующее
От: "Adam Middleton"
Дата:
Сообщение: Southern California 2020 Linux Expo Emails