Error compiling percona-server from source

Good evening,

I’m currently trying to compile percona-server 8.0 from source using this documentation lines: https://www.percona.com/doc/percona-server/8.0/installation.html#compile-from-source
I’ve cloned the whole project, initialized all git submodules and run the following commands:

cmake . \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/tmp/boost \
-DFORCE_INSOURCE_BUILD=1 \ 
-DWITHOUT_ROCKSDB=1 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_CONFIG=mysql_release \
-DFEATURE_SET=community

make 

make install

I also made sure to have CMake and these dependency installed on an ubuntu machine:

curl \
git \
gcc \
g++ \
make \
bison \
ccache \
libssl-dev \
libncurses5-dev \
libreadline-dev \
libcurl4-openssl-dev \
procps \
zlib1g-dev \
libldap2-dev \
pkg-config \
libtirpc-dev \

Configuring the build using CMake works completely fine, but unfortunately, the build fails at step 2 running make with the following output:

#14 96.31 [  4%] Built target strings_objlib
#14 96.31 [  5%] Linking CXX static library ../archive_output_directory/libmysys.a
#14 96.38 [  5%] Built target mysys
#14 96.39 [  5%] Linking CXX static library ../archive_output_directory/libstrings.a
#14 96.47 [  5%] Built target strings
#14 96.48 [  5%] Building CXX object utilities/CMakeFiles/comp_err.dir/comp_err.cc.o
#14 97.42 [  5%] Linking CXX executable ../runtime_output_directory/comp_err
#14 97.51 [  5%] Built target comp_err
#14 97.52 [  5%] Generating ../include/mysqld_error.h, ../include/mysqld_ername.h, ../include/mysqld_errmsg.h, ../share/english/errmsg.sys
#14 97.52 Wrong input file format. Stop!
#14 97.52 Line:
#14 97.52
#14 97.52 Failed to parse input file /opt/percona-server/share/messages_to_clients.txt
#14 97.52 make[2]: *** [utilities/CMakeFiles/GenError.dir/build.make:80: include/mysqld_error.h] Error 1
#14 97.52 make[1]: *** [CMakeFiles/Makefile2:10647: utilities/CMakeFiles/GenError.dir/all] Error 2
#14 97.52 make: *** [Makefile:166: all] Error 2

The debug print by the way doesn’t show any additional information for this error.
This error does not make any sense to me, and asking the Internet doesn’t help, so I decided to ask you guys to help me.

Many thanks in advance,
Benjamin

Hi @bkuen ,

This error means that parsing the error message files under share has failed. Most likely you edited share/messages_to_clients.txt or share/messages_to_error_log.txt.

By looking at your error you have an extra line somewhere in the file /opt/percona-server/share/messages_to_clients.txt :

#14 97.52 Wrong input file format. Stop!
#14 97.52 Line:
#14 97.52
#14 97.52 Failed to parse input file /opt/percona-server/share/messages_to_clients.txt

Can you please show the diffs you are doing at those files?

git diff share/

Thanks in advance.

1 Like

hi @bkuen
You can also try to build using our build script which we use for prepare releases.

1 Like

Hey @Marcelo_Altmann,
thanks for your help. I followed your advice to check the file difference. Because I wanted to make sure that everything is clean, I did a git hard reset.
Unfortunately, this doesn’t change anything. The same error occurs again.

Maybe it helps if I explain to you my overall goal: I want to create a storage engine and want to build a docker image with the engine installed. Is there any easy way to get this thing done without building the whole thing from source?

Maybe the Dockerfile content helps as well:
FROM ubuntu

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin

ENV CMAKE_VERSION 3.20.0

# Install required dependencies
RUN apt update -y && \
    apt install -y \
    tzdata \
    curl \
    git \
    gcc \
    g++ \
    make \
    bison \
    ccache \
    libssl-dev \
    libncurses5-dev \
    libreadline-dev \
    libcurl4-openssl-dev \
    procps \
    zlib1g-dev \
    libldap2-dev \
    pkg-config \
    libtirpc-dev \
    && rm -rf /var/lib/apt/lists/*

# Install and configure cmake
RUN mkdir /tmp/cmake && \
    cd /tmp/cmake && \
    curl -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz | tar zxf - && \
    cd cmake-${CMAKE_VERSION} && \
    ./configure && \
    make -j4 && \
    make install && \
    rm -rf /tmp/cmake

WORKDIR /opt/percona-server
ADD percona-server /opt/percona-server

# Copy storage engine source into percona-server/storage
COPY src /opt/percona-server/storage/gcsv
COPY scripts /opt/percona-server/scripts

# Configure build
RUN cmake . \
    -DDOWNLOAD_BOOST=1 \
    -DWITH_BOOST=/tmp/boost \
    -DFORCE_INSOURCE_BUILD=1 \ 
    -DWITHOUT_ROCKSDB=1 \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DBUILD_CONFIG=mysql_release \
    -DFEATURE_SET=community

# Compile using make
RUN make 
# Install percona-server on the system
RUN make install

I really appreciate your help, thanks :slight_smile:

1 Like

Hey @Evgeniy_Patlan,

thanks for your answer as well. Does the build script supports the integration of your own storage engine?

Best regards,
Benjamin

1 Like

Hi @bkuen
For build using build script you can use your own repo on github or you can take our source tarball, unpack it, add your storage engine and again create source tarball tarball.
Once it is done you can use your tarball to create binary tarball or packages.

1 Like

Hi @Evgeniy_Patlan,
okay, I will try that later. Many thanks to you!

1 Like