Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33636

CentOS 7 MariaDB 10.5 build jobs failing "Invalid capability: cap "%caps(cap_ipc_lock=pe"

    XMLWordPrintable

Details

    Description

      Example failure: https://salsa.debian.org/robinnewhouse/mariadb-server-mirror/-/jobs/5392265

      CentOS 7 builds for MariaDB 10.5 are failing due to a bug in the generated RPM spec file.

      MDEV-33301 introduced a change to add cap_ipc_lock=pe capability to mariadbd.

      However, the %caps directive for CPACK_RPM_server_USER_FILELIST does not function as expected. The generated RPM spec contains:

      ...
      %config(noreplace) "/etc/logrotate.d/mysql"
      %caps(cap "%caps(cap_ipc_lock=pe) %{_sbindir}/mysqld"
      %attr(700,mysql,-) "/usr/lib64/mysql/plugin/auth_pam_tool_dir"
      ...
      

      Thus when packaging the server RPM, the following error is thrown:

      error: Invalid capability: cap "%caps(cap_ipc_lock=pe
          Invalid capability: cap "%caps(cap_ipc_lock=pe`
      

      It seems like older versions of cmake/rpm (have not pin-pointed which version contain this bug) do not handle the "_" character correctly for the %caps directive.

      Most likely, for older versions of the build system, we would need to set the file capability during post installation similar to how it's currenlty done for debian.
       
      cmake version: 2.8.12.2-2
      rpm version: 4.11.3-48

      Steps to Reproduce

      docker run --interactive --tty -v ${PWD}:/mariadb -w /mariadb centos:7 bash
       
      yum-builddep -y mariadb-server
       
      yum install -y yum-utils rpm-build gcc gcc-c++ bison libxml2-devel libevent-devel openssl-devel pcre2-devel
       
      mkdir builddir; cd builddir
       
      cmake -DRPM=mariadbbuild -DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF ..
       
      make package -j 2
      


      For reference, CentOS 8 builds succeed

      The generated RPM spec correctly contains:

      ...
      %config(noreplace) "/etc/logrotate.d/mysql"
      %caps(cap_ipc_lock=pe) "%{_sbindir}/mysqld"
      %attr(700,%{mysqld_user},-) "/usr/lib64/mysql/plugin/auth_pam_tool_dir"
      ...
      

      cmake version: 3.26.5-2
      rpm version: 4.14.3-31

      Attachments

        Activity

          People

            danblack Daniel Black
            tonychen Tony Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.