Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124765

Improve the QT_DISABLE_DEPRECATED_UP_TO handling

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7
    • Build System
    • None
    • All

    Description

      According to the description QT_DISABLE_DEPRECATED_UP_TO can be set both when building user project or Qt it self. This produces multiple scenarios which have different consequences and some of them are not handled properly yet.

      Subjects: QtBase, QtRepoX, UserProject

      Senario 1

      Preconditions:

      QtBase is built without QT_DISABLE_DEPRECATED_UP_TO
      QtRepoX is built without QT_DISABLE_DEPRECATED_UP_TO
      UserProject is built with QT_DISABLE_DEPRECATED_UP_TO

      Outcome:

      QtBase contains the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX contains the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject is limited in its use of the deprecated API from both QtBase and QtRepoX(compilation error).

      Actual issues:

      None

      Senario 2

      Preconditions:

      QtBase is built with QT_DISABLE_DEPRECATED_UP_TO
      QtRepoX is built with QT_DISABLE_DEPRECATED_UP_TO
      UserProject is built without QT_DISABLE_DEPRECATED_UP_TO

      Outcome:

      QtBase doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject Has no information about the QT_DISABLE_DEPRECATED_UP_TO version that is used by both QtBase and QtRepoX

      Actual issues:

      Unpredictable linker error when linking UserProject, which is not really informative.

      Senario 3

      Preconditions:

      QtBase is built with QT_DISABLE_DEPRECATED_UP_TO
      QtRepoX is built without QT_DISABLE_DEPRECATED_UP_TO
      UserProject is built with QT_DISABLE_DEPRECATED_UP_TO

      Outcome:

      QtBase doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX contains the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject Has no information about the QT_DISABLE_DEPRECATED_UP_TO version that is used by both QtBase and QtRepoX. QtRepoX provides the symbols QT_DISABLE_DEPRECATED_UP_TO and formally doesn't restrict their usage, but we accept that is an application choice.

      Actual issues:

      None

      Senario 4

      Preconditions:

      QtBase is built with QT_DISABLE_DEPRECATED_UP_TO 0x1
      QtRepoX is built with QT_DISABLE_DEPRECATED_UP_TO 0x2
      UserProject is built with QT_DISABLE_DEPRECATED_UP_TO 0x1

      Outcome:

      QtBase doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject Has no information about the QT_DISABLE_DEPRECATED_UP_TO version that is used by both QtBase and QtRepoX.

      Actual issues:

      Unpredictable linker error from QtRepoX when linking UserProject, which is not really informative.

      Senario 5

      Preconditions:

      QtBase is built without QT_DISABLE_DEPRECATED_UP_TO
      QtRepoX is built with QT_DISABLE_DEPRECATED_UP_TO 0x2
      UserProject is built with QT_DISABLE_DEPRECATED_UP_TO 0x2

      Outcome:

      QtBase doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject Has no information about the QT_DISABLE_DEPRECATED_UP_TO version that is used by QtRepoX.

      Actual issues:

      Technically users might still expect that the deprecated QtBase API still work, but it's quite hard to control, when building user app.

      Senario 6

      Preconditions:

      QtBase is built without QT_DISABLE_DEPRECATED_UP_TO 0x2
      QtRepoX is built with QT_DISABLE_DEPRECATED_UP_TO 0x1
      UserProject is built with QT_DISABLE_DEPRECATED_UP_TO 0x2

      Outcome:

      QtBase doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      QtRepoX doesn't contain the deprecated symbols that depend on QT_DISABLE_DEPRECATED_UP_TO value.
      UserProject Has no information about the QT_DISABLE_DEPRECATED_UP_TO version that is used by QtRepoX.

      Actual issues:

      If QtRepoX uses the deprecated QtBase API, this will lead to linker issue when either building QtRepoX or if the linker allows leaving the unresolved symbols in libraries, this will be way more confusing linker error when linking UserProject.

      Suggestion:

      When building Qt - restrict the use of QT_DISABLE_DEPRECATED_UP_TO for QtBase(QtCore specifically) and make the definition PUBLIC, so it will be propagated to all Qt modules and user projects.

      User projects still may set QT_DISABLE_DEPRECATED_UP_TO, since it will only break the user code at compile time, if the deprecated API is used.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semlanik Alexey Edelev
            semlanik Alexey Edelev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes