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

Qmake fails when trying to include Android 'asset' filenames that contain spaces

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.1
    • Fix Version/s: 5.15.2
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Platform/s:
      Android, Windows

      Description

      Something has changed between Qt 5.13.0 and 5.15.1 in terms of how qmake handles Android asset filenames containing spaces. With 5.13.0, we were able to do the following in our .pro file: 
      ASSET_DATA.path = /assets
      ASSET_DATA.files += $$quote(.\MyFiles\FileWithoutSpaces.txt)
      ASSET_DATA.files += $$quote(.\MyFiles\File With Spaces.txt)
      INSTALLS += ASSET_DATA
       
      With the first of these files, the $$quote is unnecessary, but harmless. With the second filename that includes spaces, $$quote is essential to make it work correctly.
       
      With Qt 5.15, this no longer works. Qmake fails with an error, and stops processing the file. The error is:
       
      1>C:\Qt\5.15.1\android\bin\qmake.exe -install qinstall C:\Build\MyFiles\File\ With\ Spaces.txt android-build\armeabi-v7a\Release\assets\File\ With\ Spaces.txt
      1>EXEC : error : usage: [-exe] source target
      1>make.exe: *** [Makefile:24733: install_ASSET_DATA] Error 3
       
      If I use $$shell_quote or $$system_quote in place of $$quote, then qmake continues and doesn't report an error, but any files with spaces in their names are simply skipped and ignored, and don't end up in the assets.
       
      I've also tried actual double-quotes, double-quotes escaped with backslashes, escaping the space characters with backslashes, and pretty much anything else I could think of - no dice.
       
      (I'm aware that one possible workaround for this is "Don't have spaces in your filenames". I'm looking into that option, but for historical reasons we have a lot of files containing embedded spaces, so getting rid of them all will have a lot of impacts and will require quite a bit of work. So I'd like to avoid that solution if I can.)

        Attachments

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

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            roballan Rob Allan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes