Building ScyllaDB on Mageia 9

Hello there,

I hope i’m posting this in the right place.

I’m starting my journey in ScyllaDB world by trying to build it under Mageia 9 (mageia.org) for which i’m conributing.

I think i’m not close to succeed butt i’m blocked by a clang error for which i’m getting mad.

Here is what idid :

  1. Fight to identify and install dependancies.

1a) Packages that are already in mageia

I got there and i thing i forgot nothing :

$ sudo urpmi ninja \
python3-thrift \
lib64jsoncpp24  \
lib64jsoncpp-devel \
lib64abseil-cpp-devel \
lib64cares-devel \
lib64fmt-devel \
numactl \
lib64numa-devel \
ragel \
doxygen \
stow \
lld \
rust-std-static-wasm32-wasi \
antlr3-tool \
lib64thrift-devel \
lib64xxhash-devel \
antlr3-C++-devel \
rapidjson \
maven \
ant \
lib64xfs-devel \
ant-junit \
lib64deflate-devel \
lib64snappy-devel \
rapidxml-devel \
lib64zstd-devel

1b) Packages hat are not already in mageia

cargo install cxxbridge-cmd

  • Webassembly : download, build and install

  • Binaryen : download build and install

For those 3 i’ll have to package them properly but i want firt to get to the full end before redoing the path cleanly for packaging. So they are build and installed manually and locally in /usr/local/

  1. Download Scylla, configure and build.
cd /home/myself/workspace
git clone https://github.com/scylladb/scylla
cd scylla
git checkout scylla-5.4.4  
git submodule update --init --recursive
./configure.py --disable-dpdk
ninja

There it complains about difficulties to build for Debian and for RHEL (which is understandable).

Then i tried to build only release :

ninja build/release

And even only scylla binary

ninja build/release/scylla

It compiles a lot of thins but in all cases it finishes by failing on the same problem :

ninja build/release/scylla
[1/422] NINJA build/release/seastar/libseastar.a
ninja: Entering directory `build/release/seastar'
[1/46] Building CXX object CMakeFiles/seastar.dir/src/core/thread_pool.cc.o
[2/46] Building CXX object CMakeFiles/seastar.dir/src/core/fsnotify.cc.o
[3/46] Building CXX object CMakeFiles/seastar.dir/src/core/alien.cc.o
[4/46] Building CXX object CMakeFiles/seastar.dir/src/core/fair_queue.cc.o
[5/46] Building CXX object CMakeFiles/seastar.dir/src/core/app-template.cc.o
[6/46] Building CXX object CMakeFiles/seastar.dir/src/core/exception_hacks.cc.o
[7/46] Building CXX object CMakeFiles/seastar.dir/src/core/future.cc.o
[8/46] Building CXX object CMakeFiles/seastar.dir/src/core/fstream.cc.o
[9/46] Building CXX object CMakeFiles/seastar.dir/src/core/future-util.cc.o
[10/46] Building CXX object CMakeFiles/seastar.dir/src/core/reactor_backend.cc.o
[11/46] Building CXX object CMakeFiles/seastar.dir/src/core/file.cc.o
[12/46] Building CXX object CMakeFiles/seastar.dir/src/core/thread.cc.o
[13/46] Building CXX object CMakeFiles/seastar.dir/src/net/arp.cc.o
[14/46] Building CXX object CMakeFiles/seastar.dir/src/http/file_handler.cc.o
[15/46] Building CXX object CMakeFiles/seastar.dir/src/core/metrics.cc.o
[16/46] Building CXX object CMakeFiles/seastar.dir/src/http/reply.cc.o
[17/46] Building CXX object CMakeFiles/seastar.dir/src/core/resource.cc.o
[18/46] Building CXX object CMakeFiles/seastar.dir/src/core/io_queue.cc.o
[19/46] Building CXX object CMakeFiles/seastar.dir/src/net/dpdk.cc.o
[20/46] Building CXX object CMakeFiles/seastar.dir/src/net/dhcp.cc.o
[21/46] Building CXX object CMakeFiles/seastar.dir/src/net/ip_checksum.cc.o
[22/46] Building CXX object CMakeFiles/seastar.dir/src/http/client.cc.o
[23/46] Building CXX object CMakeFiles/seastar.dir/src/core/prometheus.cc.o
[24/46] Building CXX object CMakeFiles/seastar.dir/src/net/inet_address.cc.o
[25/46] Building CXX object CMakeFiles/seastar.dir/src/net/proxy.cc.o
[26/46] Building CXX object CMakeFiles/seastar.dir/src/net/ip.cc.o
[27/46] Building CXX object CMakeFiles/seastar.dir/src/http/httpd.cc.o
[28/46] Building CXX object CMakeFiles/seastar.dir/src/net/dns.cc.o
[29/46] Building CXX object CMakeFiles/seastar.dir/src/net/native-stack.cc.o
[30/46] Building CXX object CMakeFiles/seastar.dir/src/net/socket_address.cc.o
[31/46] Building CXX object CMakeFiles/seastar.dir/src/net/net.cc.o
[32/46] Building CXX object CMakeFiles/seastar.dir/src/net/tcp.cc.o
[33/46] Building CXX object CMakeFiles/seastar.dir/src/rpc/lz4_compressor.cc.o
[34/46] Building CXX object CMakeFiles/seastar.dir/src/net/udp.cc.o
[35/46] Building CXX object CMakeFiles/seastar.dir/src/net/posix-stack.cc.o
[36/46] Building CXX object CMakeFiles/seastar.dir/src/net/virtio.cc.o
[37/46] Building CXX object CMakeFiles/seastar.dir/src/rpc/lz4_fragmented_compressor.cc.o
[38/46] Building CXX object CMakeFiles/seastar.dir/src/util/process.cc.o
[39/46] Building CXX object CMakeFiles/seastar.dir/src/util/file.cc.o
[40/46] Building CXX object CMakeFiles/seastar.dir/src/util/backtrace.cc.o
[41/46] Building CXX object CMakeFiles/seastar.dir/src/net/tls.cc.o
[42/46] Building CXX object CMakeFiles/seastar.dir/src/core/reactor.cc.o
[43/46] Building CXX object CMakeFiles/seastar.dir/src/websocket/server.cc.o
[44/46] Building CXX object CMakeFiles/seastar.dir/src/util/log.cc.o
[45/46] Building CXX object CMakeFiles/seastar.dir/src/rpc/rpc.cc.o
[46/46] Linking CXX static library libseastar.a
[29/422] CXX build/release/compaction/task_manager_module.o
FAILED: build/release/compaction/task_manager_module.o 
clang++ -MD -MT build/release/compaction/task_manager_module.o -MF build/release/compaction/task_manager_module.o.d -I/home/myself/workspace/scylla/seastar/include -I/home/myself/workspace/scylla/build/release/seastar/gen/include -U_FORTIFY_SOURCE -Werror=unused-result -DSEASTAR_API_LEVEL=7 -DSEASTAR_SSTRING -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_LOGGER_TYPE_STDOUT -DFMT_SHARED -DSEASTAR_BROKEN_SOURCE_LOCATION -I/usr/include/p11-kit-1 -I/usr/include/libxml2 -Wl,--gc-sections  -ffile-prefix-map=/home/myself/workspace/scylla=. -march=westmere -ffunction-sections -fdata-sections  -O3 -mllvm -inline-threshold=2500 -fno-slp-vectorize -DSCYLLA_BUILD_MODE=release -g -gz -iquote. -iquote build/release/gen --std=gnu++20  -ffile-prefix-map=/home/myself/workspace/scylla=. -march=westmere  -DBOOST_TEST_DYN_LINK   -DNOMINMAX -DNOMINMAX -fvisibility=hidden -Wall -Werror -Wimplicit-fallthrough -Wno-mismatched-tags -Wno-c++11-narrowing -Wno-overloaded-virtual -Wno-unused-command-line-argument -Wno-unsupported-friend -Wno-implicit-int-float-conversion -Wno-psabi -Wno-narrowing -Wno-error=deprecated-declarations -DXXH_PRIVATE_API -DSEASTAR_TESTING_MAIN -DFMT_DEPRECATED_OSTREAM  -c -o build/release/compaction/task_manager_module.o compaction/task_manager_module.cc
In file included from compaction/task_manager_module.cc:9:
In file included from /usr/include/boost/range/algorithm/min_element.hpp:13:
In file included from /usr/include/boost/concept_check.hpp:22:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/iterator:66:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/streambuf_iterator.h:35:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/streambuf:41:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/ios_base.h:41:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/locale_classes.h:40:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/string:53:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/basic_string.h:39:
In file included from /usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/ext/alloc_traits.h:34:
/usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/alloc_traits.h:518:4: error: no matching function for call to 'construct_at'
          std::construct_at(__p, std::forward<_Args>(__args)...);
          ^~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/vector.tcc:117:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<table_info>>::construct<table_info, const seastar::basic_sstring<char, unsigned int, 15, true> &, const utils::tagged_uuid<table_id_tag> &>' requested here
            _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
                           ^
compaction/task_manager_module.cc:353:37: note: in instantiation of function template specialization 'std::vector<table_info>::emplace_back<const seastar::basic_sstring<char, unsigned int, 15, true> &, const utils::tagged_uuid<table_id_tag> &>' requested here
        tables_by_keyspace[ks_name].emplace_back(table_name, table_id);
                                    ^
/usr/bin/../lib/gcc/x86_64-mageia-linux/12/../../../../include/c++/12/bits/stl_construct.h:94:5: note: candidate template ignored: substitution failure [with _Tp = table_info, _Args = <const seastar::basic_sstring<char, unsigned int, 15, true> &, const utils::tagged_uuid<table_id_tag> &>]: no matching constructor for initialization of 'table_info'
    construct_at(_Tp* __location, _Args&&... __args)
    ^
1 error generated.
[38/422] CXX build/release/message/messaging_service.o

This “no matching function for call to ‘construct_at’” error drives me crazy.

My version of clang is this one :

clang --version
clang version 15.0.6 (Mageia 15.0.6-5.mga9)
Target: x86_64-mageia-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

And my verison of ninja is this one :

ninja --version
1.11.1

If you could have a look and tell me if i missed something obvious or advice me about how to pass this step that would be really cool.

Maât

(post fixed, typo)

Clang 16 is able to compile this code.
I checked and indeed table_info is a simple POD without a constructor. Maybe there was something in C++20 to generate constructors for such PODs (although I couldn’t find anything with a quick search).

That said, we have a frozen toolchain (a docker image) in tools/toolchain/dbuild, which is the officially supported way to build scylla binaries. The resulting packages can be installed on any distro. So maybe the best course of action is:

$ ./tools/toolchain/dbuild ./configure.py --mode=release
$ ninja dist-unified-release

This will get you a tarball, with all the binaries and an install.sh script, which installs it. You can wrap this with packaging automation, or you can use the DEB/RPM packages if those work for you (ninja dist-release).

Hello, thanks for having taken the time to give a look. :heart:

If i conclude that my clang 15 is too old am i correct ?

For the build process the rule in Mageia is the same as for Debian : packages need to be build on mageia systems with mageia tools and libraries.

So if i want mageia users to be able to do a “urpmi scylladb” to install from official mageia mirrors and use it i cannot consider dbuild way, it would never work on the distribution build system

If i get over this blocking point, i would then have to work on a way to build also rpms for Mageia and make a pull request to submit it to Scylla community.

Bests, Maât