Currently for RHEL8-like systems RPMs are built with the explicit -DWITH_JEMALLOC=no option.
It was added to the buildbot config by this commit
Technically it is true, jemalloc is not provided by default repos on RHEL8 and alike, although it can be fetched from the EPEL repo. However, it is not important for this ticket.
Thus the packages are built without jemalloc dependency.
But the spec file in the resulting source rpm doesn't have this option, it contains the cmake command as
So, when we build from srpm on RHEL8-s, there is no jemalloc in BuildRequires, and it doesn't attempt to install jemalloc along with its dependencies, regardless whether we enable EPEL or not; but when it comes to compiling, it fails because TokuDB wants jemalloc and cannot find it.
It can be circumvented by installing jemalloc[-devel] from EPEL manually before building from srpm. But then, the srpm test in buildbot fails at the end, because it compares requirements of the rebuilt packages with the original ones and finds the extra jemalloc in the new ones.
I don't suppose there is any point in installing jemalloc now on build machines and getting rid of WITH_JEMALLOC=NO, it would only add an extra dependency to old maintenance versions without any gain. So, the choice is between suppressing the test failure above, or making srpms inherit build options from the original build. Patching the test is easy, but building from srpms the same way as the original packages were built (if possible and unless it contradicts some normal practices) sounds like a more valid approach.