lupdate never stop



  • Run lupdate after 1 hour yet it do not stop, keep running. Not sure what is happend, I run the lupdate from QtCreator following advices from stackoverflow.

    This solution works well on the example come with QtCreator("hellotr").

    My steps

    1. add TRANSLATIONS = english_to_turkish.ts in .pro
    2. Run lupdate from QtCreator

    The output show in General Messages(QtCreator)

    Starting external tool "qt_path\Qt\5.9.4\msvc2017_64\bin\translate.bat" project_path/client.pro
    
    C:\Users\yyyy\programs\Qt\3rdLibs\Qt\5.9.4\msvc2017_64\bin>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"   & lupdate.exe project_path/client.pro"
    

    After that, lupdate keep running in the background, more than 90 minutes now, this is unusual, do anyone know how to debug?Thanks

    The project size, qml + c++ codes, I believe is less than 100000 lines.


  • Moderators

    @tham said in lupdate never stop:

    After that, lupdate keep running in the background, more than 90 minutes now, this is unusual, do anyone know how to debug?Thanks

    If lupdate takes longer than a few seconds it means it hung. You can kill the process. Even for a huge project, don't wait longer than a minute.

    Debug: unfortunately it'll be some trial-and-error. Some recommendations:

    • if you have any #include in the middle of your file - move it to the beginning. lupdate has very weak parser and it's easily fooled
    • do not run lupdate on external code (third party libraries)
    • if you can, try turning lupdate off for some parts of your project to pinpoint where it is starting to hang


  • @sierdzio said in lupdate never stop:

    if you can, try turning lupdate off for some parts of your project to pinpoint where it is starting to hang

    I think the problem is caused by 3rd party libraries like boost, opencv and others, is it possible to ask lupdate ignore some include path or header files except of comment out them manually from the .pro? Thanks


  • Moderators

    @tham said in lupdate never stop:

    @sierdzio said in lupdate never stop:

    if you can, try turning lupdate off for some parts of your project to pinpoint where it is starting to hang

    I think the problem is caused by 3rd party libraries like boost, opencv and others, is it possible to ask lupdate ignore some include path or header files except of comment out them manually from the .pro? Thanks

    Try adding these paths to TR_EXCLUDE in your .pro:

    TR_EXCLUDE += $$PWD/some/dir/*
    


  • @sierdzio Tried TR_EXCLUDE, but do not work, maybe my qmake is too old(v5.9.4)?


  • Moderators

    @tham said in lupdate never stop:

    @sierdzio Tried TR_EXCLUDE, but do not work, maybe my qmake is too old(v5.9.4)?

    Hm, no, that should be OK.

    An alternative and more cumbersome solution (more a workaround, really) - try separating your third party libs into a separate .pri, keep your code in a separate .pro as well - then run lupdate on your pro so that it won't pick up external includes.

    Or, as a last resort, I think lupdate can be run on a file list instead of a .pro file - that's the most tedious way but it also gives you full control over what is parsed.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.