Skip to content

Commit 037b96c

Browse files
RazvanLiviuVarzarucvicentiu
authored andcommitted
MDBF-935 - recompile libncurses.a, rm duplicate galera
We have lbtinfo.so.6 as an extra dependency for mariadb client. This is because not all functions are found in libncurses.a during configure and CMAKE will fallback to using the ones found in libtinfo shared library. In this task ncurses.sh was modified to recompile the library, statically, with embedded libtinfo. Details on the approach is documented in the script itself. The second issue this patch solves is removing the duplicate libgalera_smm.so that is packaged by CPACK, previously configured by CMAKE with -DEXTRA_FILES The galera library is the latest found in ci.mariadb.org, but we should further discuss the process of including galera into binary tarballs. So far, in old-bb, the binary tarball's were re-packaged and galera was included during every release.
1 parent 788f811 commit 037b96c

File tree

3 files changed

+76
-5
lines changed

3 files changed

+76
-5
lines changed

ci_build_images/bintar.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ RUN ./libzstd.sh
8282
RUN ./gnutls.sh
8383

8484
FROM buildeps AS bintar
85-
COPY --from=staticlibs /scripts/local/lib /scripts/local/lib
85+
COPY --from=staticlibs /scripts/local /scripts/local
8686
COPY --from=staticlibs /root/gnutlsa.tar.bz2 /scripts/
8787

8888
WORKDIR /scripts

ci_build_images/scripts/ncurses.sh

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,80 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2086
3+
# shellcheck disable=SC2098
4+
# shellcheck disable=SC2097
5+
# shellcheck disable=SC2046
26

37
set -e
48

9+
### TODO Healthy approach. Doesn't work.
10+
11+
#------------------------------------------------------------------------------
12+
# This is basically following the SPEC file steps through Install
13+
# One cannot disable --with-shared because the SPEC file assumes shared is enabled
14+
# and it will fail if not.
15+
# Although we rsync the static libraries / headers from BUILDROOT
16+
# and ${CURSES_INCLUDE_PATH} is OK i.e. CURSES_INCLUDE_PATH:/scripts/local/include
17+
# I still cannot find several functions in libncurses.a
18+
19+
#-- Found Curses: /scripts/local/lib/libcurses.a
20+
#-- Looking for tputs in /scripts/local/lib/libcurses.a
21+
#-- Looking for tputs in /scripts/local/lib/libcurses.a - not found
22+
#-- Looking for tputs in tinfo
23+
#-- Looking for tputs in tinfo - found
24+
#-- Looking for setupterm in tinfo
25+
#-- Looking for setupterm in tinfo - found
26+
#-- Looking for vidattr in tinfo
27+
#-- Looking for vidattr in tinfo - not found
28+
#-- Looking for include files curses.h, term.h
29+
#-- Looking for include files curses.h, term.h - found
30+
31+
# So I suppose there's something in the spec file that I'm not aware of
32+
# This is what I've tried
33+
34+
#yumdownloader --source ncurses-devel
35+
#yum-builddep -y ncurses-*.src.rpm
36+
#rpm -ivh ncurses-*.src.rpm
37+
## Make functions available in libncurses.a
38+
#sed -i '/--with-terminfo-dirs/d' $HOME/rpmbuild/SPECS/ncurses.spec
39+
#sed -i '/--with-termlib=tinfo/d' $HOME/rpmbuild/SPECS/ncurses.spec
40+
#sed -i '/--disable-wattr-macros/d' $HOME/rpmbuild/SPECS/ncurses.spec
41+
## Build the package
42+
#rpmbuild -bi $HOME/rpmbuild/SPECS/ncurses.spec
43+
## Remove unwanted files
44+
#rm -rf $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/lib
45+
#rm -rf $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/src
46+
#rm -rf $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/usr
47+
## lib64 dir is the one we want but without .so files
48+
#mv $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/lib64 $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/lib
49+
#rsync -av --exclude='*.so.*' $HOME/rpmbuild/BUILDROOT/ncurses-*/usr/* /scripts/local
50+
## Further cleanup
51+
#rm -rf $HOME/rpmbuild
52+
#rm -f /scripts/ncurses-*.src.rpm
53+
54+
#------------------------------------------------------------------------------
55+
56+
57+
# Second approach. Current.
58+
# In this approach we only prepare the source dir with applied patches
59+
# by using rpmbuild -bp
60+
61+
# Then we manually configure it, with /scripts/local/ as the target,
62+
# This way we bypass the rest of the steps in the SPEC file
63+
# This is why we need to manually symlink the include/ncurses headers to ../
64+
# The above operation was managed by packaging, so that CMAKE
65+
# can find the headers in ${CURSES_INCLUDE_PATH} i.e. /scripts/local/include
66+
567
yumdownloader --source ncurses-devel
668
yum-builddep -y ncurses-*.src.rpm
7-
rpmbuild --recompile ncurses-*.src.rpm
8-
mv -v ~/rpmbuild/BUILDROOT/ncurses-*/usr/lib64/*.a local/lib
9-
rm -rf ~/rpmbuild ncurses-*.src.rpm
69+
rpm -ivh ncurses-*.src.rpm
70+
rpmbuild -bp $HOME/rpmbuild/SPECS/ncurses.spec
71+
cd $HOME/rpmbuild/BUILD/ncurses-*/
72+
73+
CFLAGS="-fpic -fPIC" CXXFLAGS=${CFLAGS} ./configure --without-manpages --without-tests --without-progs --prefix=/scripts/local/
74+
make -j"$(nproc)" install
75+
mv /scripts/local/include/ncurses/* /scripts/local/include/
76+
# Snippet from spec file %INSTALL
77+
for l in /scripts/local/include/*.h; do
78+
ln -s ../$(basename $l) /scripts/local/include/ncurses
79+
done
80+
cd /scripts/local/lib && ln -s libncurses.a libcurses.a

master-docker-nonstandard/master.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ c["builders"].append(
16781678
nextBuild=nextBuild,
16791679
canStartBuild=canStartBuild,
16801680
locks=getLocks,
1681-
properties={"additional_args": '-DEXTRA_FILES="${WSREP_PROVIDER}=lib;${WSREP_PROVIDER}=lib/galera;"'},
1681+
properties={"additional_args": '-DEXTRA_FILES="${WSREP_PROVIDER}=lib;"'},
16821682
factory=f_bintar,
16831683
)
16841684
)

0 commit comments

Comments
 (0)