Skip to content

Commit a249c26

Browse files
committed
chore(deps): upgrade pkg-config on CentOS-7 to avoid bug
There's a [bug] w/ CentOS-7's version of `pkg-config` that can cause invocations to take a reeeeeaaaaly long time to complete. We discovered this when upgrading to grpc-1.38.1 and had to [rollback] the upgrade. The fix to `pkg-config` was rolled out about 8 years ago in `pkg-config` 0.28. This PR upgrades the pkg-config we use on CentOS-7 to the latest as of this writing. After this, I think we should be able to upgrade grpc again. [bug]: https://bugs.freedesktop.org/show_bug.cgi?id=54716 [rollback]: #6840
1 parent f6e4b11 commit a249c26

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

ci/cloudbuild/dockerfiles/demo-centos-7.Dockerfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ RUN yum install -y centos-release-scl yum-utils
2828
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
2929
RUN yum makecache && \
3030
yum install -y automake ccache cmake3 curl-devel devtoolset-7 gcc gcc-c++ \
31-
git libtool make openssl-devel patch pkgconfig re2-devel tar wget \
32-
which zlib-devel
31+
git libtool make openssl-devel patch re2-devel tar wget which zlib-devel
3332
RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest
3433
# ```
3534

@@ -53,6 +52,22 @@ ENV LD_LIBRARY_PATH /opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/roo
5352
# scl enable devtoolset-7 bash
5453
# ```
5554

55+
# CentOS-7 ships with `pkg-config` 0.27.1, which has a
56+
# [bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make
57+
# invocations take extremely long to complete. If you plan to use `pkg-config`
58+
# with any of the installed artifacts, you'll want to upgrade it to something
59+
# newer. If not, `yum install pkgconfig` should work instead.
60+
61+
# ```bash
62+
WORKDIR /var/tmp/build/pkg-config-cpp
63+
RUN curl -sSL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz | \
64+
tar -xzf - --strip-components=1 && \
65+
./configure --with-internal-glib && \
66+
make -j ${NCPU:-4} && \
67+
make install && \
68+
ldconfig
69+
# ```
70+
5671
# The following steps will install libraries and tools in `/usr/local`. By
5772
# default CentOS-7 does not search for shared libraries in these directories,
5873
# there are multiple ways to solve this problem, the following steps are one
@@ -61,7 +76,7 @@ ENV LD_LIBRARY_PATH /opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/roo
6176
# ```bash
6277
RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \
6378
tee /etc/ld.so.conf.d/usrlocal.conf
64-
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
79+
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig
6580
ENV PATH=/usr/local/bin:${PATH}
6681
# ```
6782

doc/packaging.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,7 @@ sudo yum install -y centos-release-scl yum-utils
13781378
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
13791379
sudo yum makecache && \
13801380
sudo yum install -y automake ccache cmake3 curl-devel devtoolset-7 gcc gcc-c++ \
1381-
git libtool make openssl-devel patch pkgconfig re2-devel tar wget \
1382-
which zlib-devel
1381+
git libtool make openssl-devel patch re2-devel tar wget which zlib-devel
13831382
sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake && sudo ln -sf /usr/bin/ctest3 /usr/bin/ctest
13841383
```
13851384

@@ -1390,6 +1389,22 @@ by `devtoolset-7`.
13901389
scl enable devtoolset-7 bash
13911390
```
13921391

1392+
CentOS-7 ships with `pkg-config` 0.27.1, which has a
1393+
[bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make
1394+
invocations take extremely long to complete. If you plan to use `pkg-config`
1395+
with any of the installed artifacts, you'll want to upgrade it to something
1396+
newer. If not, `sudo yum install pkgconfig` should work instead.
1397+
1398+
```bash
1399+
mkdir -p $HOME/Downloads/pkg-config-cpp && cd $HOME/Downloads/pkg-config-cpp
1400+
curl -sSL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz | \
1401+
tar -xzf - --strip-components=1 && \
1402+
./configure --with-internal-glib && \
1403+
make -j ${NCPU:-4} && \
1404+
sudo make install && \
1405+
sudo ldconfig
1406+
```
1407+
13931408
The following steps will install libraries and tools in `/usr/local`. By
13941409
default CentOS-7 does not search for shared libraries in these directories,
13951410
there are multiple ways to solve this problem, the following steps are one
@@ -1398,7 +1413,7 @@ solution:
13981413
```bash
13991414
(echo "/usr/local/lib" ; echo "/usr/local/lib64") | \
14001415
sudo tee /etc/ld.so.conf.d/usrlocal.conf
1401-
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
1416+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig
14021417
export PATH=/usr/local/bin:${PATH}
14031418
```
14041419

0 commit comments

Comments
 (0)