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

How to compile install mariadb without mysql-test

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • N/A
    • Compiling
    • None

    Description

      I tried to compile and install mariadb in alpine, because it was used in docker, so I wanted to take up less space after the compilation was successful.

      I used the -dcmake_build_type =MinSizeRel option to minimize the installation. But the mysql-test directory still takes up a lot of space.

      I tried using -dwith_unit_tests =OFF and -dconc_with_unit_tests =OFF to disable mysql-test installation, but they didn't work. I haven't found any other relevant options, similar to INSTALL_MYSQLTESTDIR="" in mysql.

      How can I disable mysql-test installation?

      mysql installation options is this:
      cmake . \
      -DCMAKE_BUILD_TYPE=MinSizeRel \
      -DWITH_UNIT_TESTS=OFF \
      -DCONC_WITH_UNIT_TESTS=OFF \
      -DWITH_MARIABACKUP=OFF \
      -DENABLED_LOCAL_INFILE=ON \
      -DWITHOUT_TOKUDB=1; \

      Attachments

        Activity

          yinfuyuan yinfuyuan created issue -
          mschorm Michal Schorm added a comment -

          True that, in Fedora, we use:

          -DINSTALL_MYSQLTESTDIR=share/mysql-test
          -DWITH_UNIT_TESTS=%{?with_test:ON}%{!?with_test:NO}
          

          %if %{without test}
          %if %{with embedded}
          rm %{buildroot}%{_bindir}/{mysqltest_embedded,mysql_client_test_embedded}
          rm %{buildroot}%{_mandir}/man1/{mysqltest_embedded,mysql_client_test_embedded}.1*
          %endif # embedded
          rm %{buildroot}%{_bindir}/{mysql_client_test,my_safe_process,mysqltest}
          rm %{buildroot}%{_mandir}/man1/{mysql_client_test,my_safe_process,mysqltest}.1*
          rm %{buildroot}%{_mandir}/man1/{mysql-test-run,mysql-stress-test}.pl.1*
          rm -r %{buildroot}%{_datadir}/mysql-test
          %endif # test
          

          which means, we are basically deleting them all, if we don't want them.

          So if there's some easier way, I'd like to know that too

          mschorm Michal Schorm added a comment - True that, in Fedora, we use: -DINSTALL_MYSQLTESTDIR=share /mysql-test -DWITH_UNIT_TESTS=%{?with_test:ON}%{!?with_test:NO} % if %{without test } % if %{with embedded} rm %{buildroot}%{_bindir}/{mysqltest_embedded,mysql_client_test_embedded} rm %{buildroot}%{_mandir} /man1/ {mysqltest_embedded,mysql_client_test_embedded}.1* %endif # embedded rm %{buildroot}%{_bindir}/{mysql_client_test,my_safe_process,mysqltest} rm %{buildroot}%{_mandir} /man1/ {mysql_client_test,my_safe_process,mysqltest}.1* rm %{buildroot}%{_mandir} /man1/ {mysql- test -run,mysql-stress- test }.pl.1* rm -r %{buildroot}%{_datadir} /mysql-test %endif # test which means, we are basically deleting them all, if we don't want them. So if there's some easier way, I'd like to know that too
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Affects Version/s 10.2.12 [ 22810 ]
          Environment alpine3.7
          Issue Type Bug [ 1 ] Task [ 3 ]

          Apparently we don't have it, but I think it's a reasonable request, so I'm moving it to tasks.

          elenst Elena Stepanova added a comment - Apparently we don't have it, but I think it's a reasonable request, so I'm moving it to tasks.
          wlad Vladislav Vaintroub added a comment - - edited

          yinfuyuan , did you actually try passing -DINSTALL_MYSQLTESTDIR= to cmake? It should work here as well

          wlad Vladislav Vaintroub added a comment - - edited yinfuyuan , did you actually try passing -DINSTALL_MYSQLTESTDIR= to cmake? It should work here as well
          yinfuyuan yinfuyuan added a comment -

          @Michal Schorm
          if you use mysql,you can use -DINSTALL_MYSQLTESTDIR="" to disable mysql-test installation. but mariadb don't has this option. now,I can only delete them manually.Thanks for you help.

          yinfuyuan yinfuyuan added a comment - @Michal Schorm if you use mysql,you can use -DINSTALL_MYSQLTESTDIR="" to disable mysql-test installation. but mariadb don't has this option. now,I can only delete them manually.Thanks for you help.
          yinfuyuan yinfuyuan added a comment -

          @Elena Stepanova
          Ok.Thanks for your help.

          yinfuyuan yinfuyuan added a comment - @Elena Stepanova Ok.Thanks for your help.
          wlad Vladislav Vaintroub added a comment - - edited

          yinfuyuan We do have INSTALL_MYSQLTESTDIR option , and it does work the same as in MySQL. you do not need to pass that as -DINSTALL_MYSQLTESTDIR="" . You can pass it as -DMYSQLTESTDIR=
          elenst fyi

          wlad Vladislav Vaintroub added a comment - - edited yinfuyuan We do have INSTALL_MYSQLTESTDIR option , and it does work the same as in MySQL. you do not need to pass that as -DINSTALL_MYSQLTESTDIR="" . You can pass it as -DMYSQLTESTDIR= elenst fyi

          Right, sorry for the confusion. In my comment I meant that we apparently don't have a way to avoid installing mysql-test, not that we don't have the option. I didn't know that it could work this way, happy to be wrong.

          elenst Elena Stepanova added a comment - Right, sorry for the confusion. In my comment I meant that we apparently don't have a way to avoid installing mysql-test, not that we don't have the option. I didn't know that it could work this way, happy to be wrong.
          yinfuyuan yinfuyuan added a comment -

          @Vladislav Vaintroub
          I've tried -DINSTALL_MYSQLTESTDIR="" and -DMYSQLTESTDIR= , but they don't work. The following can see my compilation details.
          https://github.com/yinfuyuan/docker-mariadb/blob/develop/services/mariadb/10.2/alpine/Dockerfile
          Is that have a problem? .Thanks for you help.

          yinfuyuan yinfuyuan added a comment - @Vladislav Vaintroub I've tried -DINSTALL_MYSQLTESTDIR="" and -DMYSQLTESTDIR= , but they don't work. The following can see my compilation details. https://github.com/yinfuyuan/docker-mariadb/blob/develop/services/mariadb/10.2/alpine/Dockerfile Is that have a problem? .Thanks for you help.
          wlad Vladislav Vaintroub added a comment - - edited

          it works for me, and should for you, too

          cmake . -DINSTALL_MYSQLTESTDIR=

          and mysql-test is not in the package
          your dockerfile das have a problem indeed, because it does not use correct option. How do I know correct option? I grep CMakeCache.txt, and I look into cmake/install_macros.cmake to see the effect of INSTALL_MYSQLTESTDIR.
          Apparently, this line https://github.com/MariaDB/server/blob/10.2/cmake/install_macros.cmake#L357 does the magic

          wlad Vladislav Vaintroub added a comment - - edited it works for me, and should for you, too cmake . -DINSTALL_MYSQLTESTDIR= and mysql-test is not in the package your dockerfile das have a problem indeed, because it does not use correct option. How do I know correct option? I grep CMakeCache.txt, and I look into cmake/install_macros.cmake to see the effect of INSTALL_MYSQLTESTDIR. Apparently, this line https://github.com/MariaDB/server/blob/10.2/cmake/install_macros.cmake#L357 does the magic
          yinfuyuan yinfuyuan added a comment -

          @Vladislav Vaintroub
          Yes.

          I know cmake ../server -LH can be display all cmake configuration options for MariaDB from
          https://mariadb.com/kb/en/library/generic-build-instructions
          but the -DINSTALL_MYSQLTESTDIR option is not available,so I didn't try it.

          Now. I used it correctly, it works well.
          Thank you very mach for you help.

          yinfuyuan yinfuyuan added a comment - @Vladislav Vaintroub Yes. I know cmake ../server -LH can be display all cmake configuration options for MariaDB from https://mariadb.com/kb/en/library/generic-build-instructions but the -DINSTALL_MYSQLTESTDIR option is not available,so I didn't try it. Now. I used it correctly, it works well. Thank you very mach for you help.

          Our documentation a little simplified

          https://cmake.org/cmake/help/v3.10/manual/cmake.1.html contains accurate description of what cmake -L[A][H] does .
          List non-advanced cached variables.

          "Non-advanced" is important part. INSTALL_XXX variables are marked as advanced.
          but you can cat or vi CMakeCache.txt to see all variables.

          wlad Vladislav Vaintroub added a comment - Our documentation a little simplified https://cmake.org/cmake/help/v3.10/manual/cmake.1.html contains accurate description of what cmake -L [A] [H] does . List non-advanced cached variables. "Non-advanced" is important part. INSTALL_XXX variables are marked as advanced. but you can cat or vi CMakeCache.txt to see all variables.
          wlad Vladislav Vaintroub made changes -
          Assignee Vladislav Vaintroub [ wlad ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s N/A [ 14700 ]
          Resolution Not a Bug [ 6 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 84917 ] MariaDB v4 [ 133438 ]

          People

            wlad Vladislav Vaintroub
            yinfuyuan yinfuyuan
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.