← Back to team overview

maria-developers team mailing list archive

Re: 030c299f76f: MDEV-17591 Create MariaDB named commands/symlinks

 

Hi Serg,

On Tue, Jun 11, 2019 at 10:47 PM Sergei Golubchik <serg@xxxxxxxxxxx> wrote:

> > timestamp: 2019-06-09 07:33:41 +0000
> > message:
> >
> > MDEV-17591 Create MariaDB named commands/symlinks
> >
> > diff --git a/cmake/symlinks.cmake b/cmake/symlinks.cmake
> > new file mode 100644
> > index 00000000000..da38d2c28d5
> > --- /dev/null
> > +++ b/cmake/symlinks.cmake
> > @@ -0,0 +1,8 @@
> > +# Add MariaDB symlinks
> > +MACRO(CREATE_MARIADB_SYMLINK binaryname symlinkname)
> > +  IF (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${binaryname} AND NOT WIN32)
> > +    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E
> create_symlink ${binaryname} ${CMAKE_CURRENT_BINARY_DIR}/${symlinkname})"
> COMPONENT symlinks)
> > +    install(CODE "message(\"-- Created symlink: ${symlinkname} ->
> ${binaryname}\")" COMPONENT symlinks)
> > +    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${symlinkname}
> DESTINATION ${INSTALL_BINDIR} COMPONENT symlinks)
> > +  ENDIF()
> > +ENDMACRO(CREATE_MARIADB_SYMLINK)
>
> Hmm, that's very weird.
>
> 1. you test whether a binary exists _at configure time_ but the binary
>    is only created during the build. So, the test is always false,
>    unless you re-run cmake after the build, which is not a normal build
>    procedure.
>

Yes, that was a wrong IF. I re-ran cmake while testing and that's why it
worked.


> 2. you create a symlink _at install time_ but in a
>    CMAKE_CURRENT_BINARY_DIR. This is strange decision.
>    Normally, build step creates files in CMAKE_CURRENT_BINARY_DIR,
>    and install step creates files in INSTALL_BINDIR.
> Basically, to fix that you should either create symlinks as a new build
> target that dependents on binaries being created first. And then install
> these symlinks normally. Or create symlinks during install time directly
> at the correct install location, not in the binary dir.
>

I've changed this to create the symlinks directly after the binaries are
created.


> > diff --git a/debian/mariadb-client-10.4.links
> b/debian/mariadb-client-10.4.links
> > index 4a504969246..b93d2d7f8fd 100644
> > --- a/debian/mariadb-client-10.4.links
> > +++ b/debian/mariadb-client-10.4.links
> > @@ -1,6 +1,44 @@
> > +usr/bin/mysql_find_rows usr/bin/mariadb-find-rows
> > +usr/bin/mysql_fix_extensions usr/bin/mariadb-fix-extenstions
> > +usr/bin/mysql_plugin usr/bin/mariadb-plugin
>
> Why there's a separate rpm with symlinks, but no separate deb with
> symlinks (they're direcly in the client deb) ?
>
> Why would you want different approaches for deb and rpm?
>

Because cmake isn't used for producing the debs. Debian packaging has the
.links files for symlinks.


>
> > +usr/bin/mysqld_multi usr/bin/mariadb-multi
> > +usr/bin/mysqld_safe usr/bin/mariadb-safe
> > +usr/bin/mysqld_safe_helper usr/bin/mariadb-safe-helper
>
> Also you seem to symlink a lot more files in deb than in rpm or in tar.gz.
>

That's synced now. Created a list in cmake to keep track of it all.

A new commit with the changes is here:
https://github.com/MariaDB/server/commit/e35fb718eae80ddd563122c71369bc4c935c0bbe

Rasmus

References