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

[PATCH] scripts: Do not prepend the prefix to absolute paths

Details

    • 10.1.10

    Description

      The INSTALL_* variables can be absolute or relative to the prefix path. The current code only handles the case where they are relative. With the patch, the old behaviour is used as long as they are relative, but it fixes the case when they are absolute.

      This is important for Exherbo since we have to use absolute paths because of our file system layout. Exherbo has /usr/share for arch-independent files and /usr/$ARCH/

      {bin,include,lib,libexec}

      for arch-dependent files, so that files for multiple architectures can be installed in parallel.

      Attachments

        Issue Links

          Activity

            serg, please review patch for this bug. Note that it doesn't completely fix original issue, since we have special handling for STANDALONE in mysql_install_db. I don't like changing that, instead I'd suggest to create separate layout for Exherbo.

            We may clean-up these *dir variables and use INSTALL_*DIRABS instead.

            I'm not sure how this should work with DESTDIR trick, so I kept original behavior.

            In my first patch I modified INSTALL_*DIR to store absolute path. This confused TGZ generator.

            svoj Sergey Vojtovich added a comment - serg , please review patch for this bug. Note that it doesn't completely fix original issue, since we have special handling for STANDALONE in mysql_install_db. I don't like changing that, instead I'd suggest to create separate layout for Exherbo. We may clean-up these *dir variables and use INSTALL_*DIRABS instead. I'm not sure how this should work with DESTDIR trick, so I kept original behavior. In my first patch I modified INSTALL_*DIR to store absolute path. This confused TGZ generator.

            In my first patch I modified INSTALL_*DIR to store absolute path. This confused TGZ generator.

            Could you elaborate on that, please?

            serg Sergei Golubchik added a comment - In my first patch I modified INSTALL_*DIR to store absolute path. This confused TGZ generator. Could you elaborate on that, please?

            make package failed to perform installation, since it attempted to install to /usr/local (or whatever) instead of $TMPDIR/usr/local

            svoj Sergey Vojtovich added a comment - make package failed to perform installation, since it attempted to install to /usr/local (or whatever) instead of $TMPDIR/usr/local
            serg Sergei Golubchik added a comment - - edited

            I think this is ok for make package to fail, and, may be, even the desired behavior — bintar packages don't support absolute paths, so one should not be able to set INSTALL_*DIR to absolute paths.

            I would've preferred cmake not to accept absolute paths in the first place when CPACK_GENERATOR is TGZ, but this would prohibit a very valid cmake . && make install use case.

            serg Sergei Golubchik added a comment - - edited I think this is ok for make package to fail, and, may be, even the desired behavior — bintar packages don't support absolute paths, so one should not be able to set INSTALL_*DIR to absolute paths. I would've preferred cmake not to accept absolute paths in the first place when CPACK_GENERATOR is TGZ, but this would prohibit a very valid cmake . && make install use case.

            Although I'd use a macro like this:

            MACRO(SET_PATH VAR VAL)
              IF(IS_ABSOLUTE ${VAL})
                SET(${VAR} ${VAL})
              ELSE()
                SET(${VAR} ${prefix}/${VAL})
              ENDIF()
            ENDMACRO(SET_PATH)

            serg Sergei Golubchik added a comment - Although I'd use a macro like this: MACRO(SET_PATH VAR VAL) IF(IS_ABSOLUTE ${VAL}) SET(${VAR} ${VAL}) ELSE() SET(${VAR} ${prefix}/${VAL}) ENDIF() ENDMACRO(SET_PATH)

            serg, could you clarify outcome of your review?

            As for the macro - I don't mind, though I don't understand practical benefit.
            Macro name should be changed at least.

            svoj Sergey Vojtovich added a comment - serg , could you clarify outcome of your review? As for the macro - I don't mind, though I don't understand practical benefit. Macro name should be changed at least.

            Macro — to avoid duplicating the logic IF (IS_ABSOLUTE) use-as-is ELSE() prepend-prefix ENDIF().

            Anyway, the outcome is — don't try to make TGZ (or ZIP, fwiw) generator to work with absolute path names. So the logic of the contributed patch is fine.

            serg Sergei Golubchik added a comment - Macro — to avoid duplicating the logic IF (IS_ABSOLUTE) use-as-is ELSE() prepend-prefix ENDIF() . Anyway, the outcome is — don't try to make TGZ (or ZIP, fwiw) generator to work with absolute path names. So the logic of the contributed patch is fine.

            serg, but there is no duplication in my patch. Also in the committed patch I don't try to feed absolute paths to TGZ generator, absolute paths are only used to substitute variables in scripts.

            Compared to original contribution my patch also fixes this issue in:
            cmake/cpack_rpm.cmake
            CMakeLists.txt
            support-files

            svoj Sergey Vojtovich added a comment - serg , but there is no duplication in my patch. Also in the committed patch I don't try to feed absolute paths to TGZ generator, absolute paths are only used to substitute variables in scripts. Compared to original contribution my patch also fixes this issue in: cmake/cpack_rpm.cmake CMakeLists.txt support-files

            People

              svoj Sergey Vojtovich
              svoj Sergey Vojtovich
              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.