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

[qt5-base] Fix hardcoded absolute paths in DLLs #3280

Merged
merged 2 commits into from
Sep 20, 2018

Conversation

claudiofantacci
Copy link
Contributor

This PR changes the configuration parameters for the qt5-base port in order to fix #3248.

In order for the DLL to have the proper hardcoded absolute paths in the DLL, the deployment path, i.e. CURRENT_INSTALLED_DIR, must be passed at configure time instead of the intermediate vcpkg installation path, i.e. CURRENT_PACKAGES_DIR.

A thoroughful discussion can be found, and is still in progress, in #3248.

Fixes #3248

@claudiofantacci
Copy link
Contributor Author

Ping for the present issue.
Please also have a look at issue #3248 that reports a discussion about Qt and vcpkg.

@claudiofantacci
Copy link
Contributor Author

Apologise for this new ping, my colleagues and I are just wondering whether this PR will be ever merged or not, just to take proper actions internally since issue #3248 is relevant for us.

@MikeGitb
Copy link
Contributor

Isn't CURRENT_PACKAGES_DIR the directory where cmake gets the data from when I use -DCMAKE_TOOLCHAIN_FILE=VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake ?

Would that still work?

@claudiofantacci
Copy link
Contributor Author

Hi @MikeGitb, CMake looks for libraries in CURRENT_INSTALLED_DIR (i.e. <VCPKG folder>/installed/<arch>-windows folder) by using vcpkg toolchain.

This is the main problem when using Qt libraries as they have hardcoded paths into the DLL that are set to CURRENT_PACKAGES_DIR and not CURRENT_INSTALLED_DIR, as you can see from the patch I propose in this PR.

@claudiofantacci
Copy link
Contributor Author

This PR has been ignored for over 4 months now, and I would just like to understand the point of view of the maintainers about consuming Qt in a project outside the vcpkg build tree.
As of now, I have problem using it without shipping a qt.conf file.
Thanks!

@ras0219-msft ras0219-msft merged commit 90e627c into microsoft:master Sep 20, 2018
@ras0219-msft
Copy link
Contributor

Thanks for the PR and sorry for such a long merge delay!

@huangqinjin
Copy link
Contributor

There's no ${CURRENT_INSTALLED_DIR}/debug/qml installed . qmldir in debug mode should also point to ${CURRENT_INSTALLED_DIR}/qml.

@claudiofantacci
Copy link
Contributor Author

There's no ${CURRENT_INSTALLED_DIR}/debug/qml installed . qmldir in debug mode should also point to ${CURRENT_INSTALLED_DIR}/qml.

Hi @huangqinjin, thanks for pointing out this issue.
debug/qml was already present in the portfile and I left it unultered.
I can double check this as soon as I get back to office and submit a fix asap.

@tronical
Copy link
Contributor

This PR has been ignored for over 4 months now, and I would just like to understand the point of view of the maintainers about consuming Qt in a project outside the vcpkg build tree.
As of now, I have problem using it without shipping a qt.conf file.

Given that the paths presented at configure time are coded straight into Qt5Core.dll, I think you have only two options for a truly relocatable application binary:

  1. Install qt.conf next to the application, see http://doc.qt.io/qt-5/qt-conf.html
  2. Use windeployqt with a target path, that will patch Qt5Core.dll (binary wise) and change the prefix in there. Then use the Qt Install Framework to create an installer, which may also patch the binary at installation time on the user site.

I kind of prefer the first option, but both are valid depending on the use-case.

ras0219-msft pushed a commit that referenced this pull request Oct 22, 2018
* fix da qt5

* fix qt config duplication

* [qt5-base] Use vcpkg_extract_source_archive_ex
[sqlite3] Enable SQLITE_ENABLE_COLUMN_METADATA

* [qt5-*] Update sub-portfiles

* qt5-base WIP

* [qt5] Fix Could not find qmlcachegen.exe

* [qt5-activeqt] Fix SHA512

* [qt5-base] Fix static builds

* [qt5-base] Bump control version

* [qt5-base] Restore removal of qmake dependencies

* [qt5-base] Partially revert #3280

* [qt5-base][vcpkg_build_qmake] Fix Qt5Bootstrap.lib issues
@claudiofantacci
Copy link
Contributor Author

Thanks @tronical, we actually use the second solution here 😄

The change that I proposed in this PR was to address a problem located only in vcpkg were you could not remove the Qt build folder because the hardcoded path were pointing to the build folder and not the installation folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not delete Qt buildtrees and packages folders! Qt no longer works.
5 participants