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

Building translation qm fails on windows target

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.5.3
    • Build System
    • None
    • Windows11 + Dockers + MSYS2
      CMake 3.27.7
    • Windows

      I am using build system as Windows host with msys2.

      The build system was working fine with QT 6.2.4 and when switched to QT 6.5.3 the build started failing:

      make[3]: Entering directory 'C:/build/my-application/build'
      [  1%] Generating qml_de.qm
      .qt/bin/qt_setup_tool_path.bat C:/QT/6.5.3/mingw_64/bin/lrelease.exe -idbased C:/build/my-application/qml/assets/translations/qml_de.ts -qm C:/build/my-application/build/qml_de.qm
      '.qt' is not recognized as an internal or external command,
      operable program or batch file.
      make[3]: *** [CMakeFiles/MyApp_lrelease.dir/build.make:80: qml_de.qm] Error 1
      

      Tracking down the change, it to me that the issue was caused by commit to qttools.git:

      commit b5a285f4c51eb1cede244251d8e010537f2b9a36
      Author: Alexandru Croitor <alexandru.croitor@qt.io>
      Date:   Wed Sep 14 11:26:16 2022 +0200
      
          CMake: Use new _qt_internal_get_tool_wrapper_script_path
          
          Pick-to: 6.4
          Change-Id: Ib1e239b905670852d907f6b9cd088e512c2cbca1
          Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
          Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
      

      Particular:

      --- a/src/linguist/Qt6LinguistToolsMacros.cmake
      +++ b/src/linguist/Qt6LinguistToolsMacros.cmake
      @@ -167,8 +167,11 @@ set(lupdate_sources \"${sources}\")
       set(lupdate_translations \"${ts_files}\")
       ")
       
      -    _qt_internal_wrap_tool_command(lupdate_command SET
      -        $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::lupdate>)
      +    _qt_internal_get_tool_wrapper_script_path(tool_wrapper)
      +    set(lupdate_command
      +        COMMAND
      +            "${tool_wrapper}"
      +            $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::lupdate>)
      

      The tool_wrapper here is absolute path - and as such it would work. But at some point it gets converted to relative - and it stops working. At file
      <build folder>/CMakeFiles/MyApp_lrelease.dir/build.make the commands are relative:

      qml_de.qm: C:/QT/6.5.3/mingw_64/bin/lrelease.exe
      qml_de.qm: C:/mnt/myapp/qml/assets/translations/qml_de.ts
              @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=C:/mntmyapp/myapp>        
              .qt/bin/qt_setup_tool_path.bat C:/QT/6.5.3/mingw_64/bin/lrelease.exe -idbased C:/mnt/myapp>
      
      

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

            qtbuildsystem Qt Build System Team
            salmenrinnep Pauli Salmenrinne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes