Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to read configuration - possible regression of #740 #808

Closed
higaski opened this issue Apr 17, 2024 · 12 comments
Closed

Fail to read configuration - possible regression of #740 #808

higaski opened this issue Apr 17, 2024 · 12 comments
Assignees
Labels
Bug Something isn't working Linux Linux version
Milestone

Comments

@higaski
Copy link

higaski commented Apr 17, 2024

Passing the qmake executable of the latest version of the mingw-w64-qt6-base 6.7.0-1 package to CQtDeployer 1.6.2351 results in an error.

Warning: Wrong output from the qmake process. /usr/x86_64-w64-mingw32/lib/qt6/bin/qmake6
Verbose log: Raw output:
Verbose log: Parsed Qt configuration: 
Qt Inforamtion: 
Platform: 
Major version: 0
Binaries dir: 
Libraries dir: 
Libexecs dir: 
Plugins dir: 
QMLs dir: 
Translations dir: 
Resources dir: 

Warning: Failed to execute the qmake process! Trying to initialize Qt directories from path: /usr/x86_64-w64-mingw32/lib/qt6
Verbose log: initialize qt dirs for. /usr/x86_64-w64-mingw32/lib/qt6
Verbose log: get qt lib failed!
Error: Failed to initialize Qt directories
Error: Deploy failed!
Error: The CQtDeployer fail to read configuration.

This might be a possible regression of #740?

When querying the mingw version of qmake directly I can't see anything which looks odd?

╰─λ /usr/x86_64-w64-mingw32/lib/qt6/bin/qmake6 -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr/x86_64-w64-mingw32
QT_INSTALL_ARCHDATA:/usr/x86_64-w64-mingw32/lib/qt6
QT_INSTALL_DATA:/usr/x86_64-w64-mingw32/share/qt6
QT_INSTALL_DOCS:/usr/x86_64-w64-mingw32/share/doc/qt6
QT_INSTALL_HEADERS:/usr/x86_64-w64-mingw32/include/qt6
QT_INSTALL_LIBS:/usr/x86_64-w64-mingw32/lib
QT_INSTALL_LIBEXECS:/usr/x86_64-w64-mingw32/lib/qt6/bin
QT_INSTALL_BINS:/usr/x86_64-w64-mingw32/lib/qt6/bin
QT_INSTALL_TESTS:/usr/x86_64-w64-mingw32/tests
QT_INSTALL_PLUGINS:/usr/x86_64-w64-mingw32/lib/qt6/plugins
QT_INSTALL_QML:/usr/x86_64-w64-mingw32/lib/qt6/qml
QT_INSTALL_TRANSLATIONS:/usr/x86_64-w64-mingw32/share/qt6/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:/usr/x86_64-w64-mingw32/share/doc/qt6/examples
QT_INSTALL_DEMOS:/usr/x86_64-w64-mingw32/share/doc/qt6/examples
QT_HOST_PREFIX:/usr
QT_HOST_DATA:/usr/x86_64-w64-mingw32/lib/qt6
QT_HOST_BINS:/usr/lib/qt6/bin
QT_HOST_LIBEXECS:/usr/lib/qt6
QT_HOST_LIBS:/usr/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:win32-g++
QMAKE_VERSION:3.1
QT_VERSION:6.7.0

Querying my hosts Qt6 qmake looks almost identical

╰─λ qmake6 -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr
QT_INSTALL_ARCHDATA:/usr/lib/qt6
QT_INSTALL_DATA:/usr/share/qt6
QT_INSTALL_DOCS:/usr/share/doc/qt6
QT_INSTALL_HEADERS:/usr/include/qt6
QT_INSTALL_LIBS:/usr/lib
QT_INSTALL_LIBEXECS:/usr/lib/qt6
QT_INSTALL_BINS:/usr/lib/qt6/bin
QT_INSTALL_TESTS:/usr/tests
QT_INSTALL_PLUGINS:/usr/lib/qt6/plugins
QT_INSTALL_QML:/usr/lib/qt6/qml
QT_INSTALL_TRANSLATIONS:/usr/share/qt6/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:/usr/share/doc/qt6/examples
QT_INSTALL_DEMOS:/usr/share/doc/qt6/examples
QT_HOST_PREFIX:/usr
QT_HOST_DATA:/usr/lib/qt6
QT_HOST_BINS:/usr/lib/qt6/bin
QT_HOST_LIBEXECS:/usr/lib/qt6
QT_HOST_LIBS:/usr/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:6.7.0

Do you have any ideas what might cause this issue? Permissions for qmake look ok.

@EndrII EndrII self-assigned this Apr 17, 2024
@EndrII
Copy link
Member

EndrII commented Apr 17, 2024

I found a bug in the code.
it's not work for you because your qt located in specify folder x86_64-w64-mingw32
but at now cqtdeployer supports only

"x86_64-linux-gnu";
 "aarch64-linux-gnu";
"x86_32-linux-gnu";
 "arm-linux-gnu";

system folders. I will fix it and add support, a custom platform.

@EndrII EndrII added Bug Something isn't working Linux Linux version labels Apr 17, 2024
@EndrII EndrII added this to the v1.6 milestone Apr 17, 2024
@EndrII
Copy link
Member

EndrII commented Apr 17, 2024

About the qmake6 -query it's not work for snap applications. So cqtdeployer try to initialize qt by default templates.

@higaski
Copy link
Author

higaski commented Apr 17, 2024

Hm, I don't understand?
I'm not using snap applications?

@EndrII
Copy link
Member

EndrII commented Apr 17, 2024

Hm, I don't understand? I'm not using snap applications?

No, it looks as bug, I will fix it. But for now you can try to use deb (if it's possible to you (libc version equal Ubuntu 22.04 required)) version of cqtdeployer - its may solve your issue.

@EndrII
Copy link
Member

EndrII commented Apr 21, 2024

@higaski I take this issue to work, but still not understand why the started QProcess of qmake6 returns empty result string of the qt configuration

Warning: Wrong output from the qmake process. /usr/x86_64-w64-mingw32/lib/qt6/bin/qmake6
Verbose log: Raw output:
Verbose log: Parsed Qt configuration: 
Qt Inforamtion: 
Platform: 
Major version: 0
Binaries dir: 
Libraries dir: 
Libexecs dir: 
Plugins dir: 
QMLs dir: 
Translations dir: 
Resources dir: 

The CQtDeployer have the same system environment as your console (where you run qmake6)? Probably it's a different environment and cqtdeployer receive different (wrong) result from qmake6

Now I see you use the classic version of cqtdeployer (not snap) so the QProcess should work correctly, but this doesn't happen.

@higaski
Copy link
Author

higaski commented Apr 22, 2024

It should be the same environment. I'm invoking CQtDeployer through a custom CMake command. I can also reproduce the issue by simply launching CQtDeployer from my shell.

The mingw-w64-qt6-base version of qmake6 is actually a bash script which runs the native version of qmake6 together with a qtconf file argument:

#!/bin/sh

# The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`

/usr/lib/qt6/bin/qmake6 -qtconf "$script_dir_path/target_qt.conf" $*

Any chance something goes wrong here?

/edit
Maybe you can work around any such issues by introducing a qtconf parameter which can be passed to CQtDeployer? Then there would be no need to go through this bash magic stuff.

@EndrII
Copy link
Member

EndrII commented Apr 22, 2024

It should be the same environment. I'm invoking CQtDeployer through a custom CMake command. I can also reproduce the issue by simply launching CQtDeployer from my shell.

The mingw-w64-qt6-base version of qmake6 is actually a bash script which runs the native version of qmake6 together with a qtconf file argument:

#!/bin/sh

# The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`

/usr/lib/qt6/bin/qmake6 -qtconf "$script_dir_path/target_qt.conf" $*

Any chance something goes wrong here?

/edit Maybe you can work around any such issues by introducing a qtconf parameter which can be passed to CQtDeployer? Then there would be no need to go through this bash magic stuff.

Yes, sounds good, I will try to add supports for qtconf. And we will check your issue again.
It may be done in this week.

If you need this fix immediately, you can boost our Patreon (CQtDeployer Personal support).

@higaski
Copy link
Author

higaski commented Apr 22, 2024

Hm, very strange. I've just built CQtDeployer from source and passed the same arguments and that worked (invoking the CQtDeployer executable directly, not through the script).

Looks like this has rather something todo with the launch script of CQtDeployer itself?

@EndrII
Copy link
Member

EndrII commented Apr 22, 2024

Hm, very strange. I've just built CQtDeployer from source and passed the same arguments and that worked (invoking the CQtDeployer executable directly, not through the script).

Looks like this has rather something todo with the launch script of CQtDeployer itself?

Hm, looks as trouble in the QProcess behavior between different builds in qt.
The CQtDeployer built with official qt pre-buildet binaries, but for arch binaries it may be different behavior because the QProcess class works with low level system invokes.

Can you run make deploy for built cqtdeployer tool, and run your own cqtdeployer distribution using launch script? To test my theory.

I think your own built cqtdeploy will be works correctly with launch script and without.

@higaski
Copy link
Author

higaski commented Apr 22, 2024

You're correct yes, the version I've compiled myself works with the launch script as well.
God this is confusing... 😆

@EndrII
Copy link
Member

EndrII commented Apr 22, 2024

You're correct yes, the version I've compiled myself works with the launch script as well. God this is confusing... 😆

It is fine for classes as QProcess. Therefore, I will try to add support new option for work with target_qt.conf. It may solve similar issues in the future.

@EndrII
Copy link
Member

EndrII commented May 30, 2024

@higaski i closed this issue and moved qtconf option to separately task.,

@EndrII EndrII closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Linux Linux version
Projects
None yet
Development

No branches or pull requests

2 participants