Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
You have a mechanism to build rpms for different distributions.
MySQL also builds rpms for mysql distributions.
When building rpms a src rpm is built. This in theory has enough information in it to allow for the binary rpms to be rebuilt. Yes, you can potentially do this from the github repo, but if you want reproducible builds or you want to modify / patch an existing rpm, you may want to build it as close to the way the original rpm was built, but not have direct access to the upstream packaging infrastructure.
Examples of this I have seen are: building patched versions of MySQL so that new custom plugins are built against "as close as possible" the original binaries rpms that the rest of the server is running on.
So I have a repo I have used for tracking and verifying that rpms can be built for MySQL rpms. See: https://github.com/sjmudd/mysql-rpm-builder
I have seen in the past that src rpms produced by Oracle did not have the complete information to do a rebuild of the binaries which is what the "rpm promise" is supposed to provide.
Trying this with MariaDB 12.2 / against Oracle Linux 10 I see a couple of issues:
1. In the generated `BuildRequires:` section you miss `rpm-build` but also `g++` packages.
2. When trying to rebuild with these changes applied I find that the build process fails.
...
|
[ 76%] Building C object sql/CMakeFiles/sql.dir/socketpair.c.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/opt_hints_parser.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/opt_hints.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/sql_type_row.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/sql_type_composite.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/item_composite.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/threadpool_generic.cc.o |
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/threadpool_common.cc.o |
In function ‘bool trans_xa_get_backup_lock(THD*, MDL_request*)’,
|
inlined from ‘bool trans_xa_commit(THD*)’ at /home/rpmbuild/rpmbuild/BUILD/MariaDB-12.2.2/mariadb-12.2.2/sql/xa.cc:671:35: |
/home/rpmbuild/rpmbuild/BUILD/MariaDB-12.2.2/mariadb-12.2.2/sql/xa.cc:537:26: warning: storing the address of local variable ‘mdl_request’ in ‘*thd.THD::backup_commit_lock’ [-Wdangling-pointer=] |
537 | thd->backup_commit_lock= mdl_request; |
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
|
/home/rpmbuild/rpmbuild/BUILD/MariaDB-12.2.2/mariadb-12.2.2/sql/xa.cc: In function ‘bool trans_xa_commit(THD*)’: |
/home/rpmbuild/rpmbuild/BUILD/MariaDB-12.2.2/mariadb-12.2.2/sql/xa.cc:662:19: note: ‘mdl_request’ declared here |
662 | MDL_request mdl_request; |
| ^~~~~~~~~~~
|
/home/rpmbuild/rpmbuild/BUILD/MariaDB-12.2.2/mariadb-12.2.2/sql/xa.cc:625:27: note: ‘thd’ declared here |
625 | bool trans_xa_commit(THD *thd) |
| ~~~~~^~~
|
[ 76%] Linking CXX static library libsql.a |
[ 76%] Built target sql |
[ 76%] Linking CXX static library libsql_embedded.a |
[ 76%] Built target sql_embedded |
make: *** [Makefile:166: all] Error 2 |
error: Bad exit status from /var/tmp/rpm-tmp.Zl1sxB (%build)
|
|
|
RPM build errors:
|
Bad exit status from /var/tmp/rpm-tmp.Zl1sxB (%build)
|
This looks wrong.
I'll update the repo I'm using so you can see the build process. I may be missing something but the error looks like a compiler error.
Note: I've seen this sort of thing happen with Oracle's MySQL builds as often the compiler may have been different to the default compiler and it was not always obvious which compiler should be present. I suspect that maybe the build server/instance/container may have packages installed in your CI environment which don't match a clean/empty setup.
My rpm rebuilder tries to build everything from a base container image of the OS that's being built on, explicitly installing all additional packages that are needed, and thus ensuring that the `BuildRequires:` entries are complete.
I'll upload the log file of the setup of the OS from a base oraclelinux:10 container and the subsequent failed build attempt of the rpms from that setup.
Any feedback would be most helpful.