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 Qt5 linux build and be a bit less flaky in CI #9260

Merged
merged 48 commits into from
Jan 6, 2020

Conversation

Neumann-A
Copy link
Contributor

No description provided.

@Neumann-A
Copy link
Contributor Author

There was also an issue with linkage of expat. Have to find the port linking to it

@Neumann-A
Copy link
Contributor Author

Neumann-A commented Dec 11, 2019

will add the following fixes described here as soon as i have time:
#8912 (comment) (not solveable requires information about dependent libraries features within vcpkg)
#8912 (comment)

@JackBoosY
Copy link
Contributor

/azp run

@Neumann-A
Copy link
Contributor Author

Neumann-A commented Dec 12, 2019

So I included every fix I know of in this PR.

ah ok #9299 still needs fixing

@janholt
Copy link
Contributor

janholt commented Dec 12, 2019

Seems there are two problems with Qt that worth to note.

On x64-linux Debug and Release installations are not merged.
Qt5CoreConfig.cmake on x64-linux only has

    _populate_Core_target_properties(RELEASE "libQt5Core.a" "" )

while on x64-windows there is

    _populate_Core_target_properties(RELEASE "Qt5Core.dll" "Qt5Core.lib" )

    if (EXISTS
        "${_qt5Core_install_prefix}/debug/bin/Qt5Cored.dll"
      AND EXISTS
        "${_qt5Core_install_prefix}/debug/lib/Qt5Cored.lib" )
        _populate_Core_target_properties(DEBUG "Qt5Cored.dll" "Qt5Cored.lib" )
    endif()

And the major one: there is no "direct" way to link static Qt from cmake (no targets for plugins and additional libraries(Qt5ThemeSupport), dependencies(external, internal) not declared). So x64-linux does not work out-of-the-box.
Here is the work on this topic: https://bugreports.qt.io/browse/QTBUG-38913

@Neumann-A
Copy link
Contributor Author

I'll adress #9296 and #9299 next

@Neumann-A
Copy link
Contributor Author

next issue: _populate_Core_plugin_properties only populates release properties

@Neumann-A
Copy link
Contributor Author

hmm seems like fixcmake.py is not 100% doing what it should be

    dllpattern = re.compile("_install_prefix}/bin/Qt5.*d+(.dll|.so)")
    libpattern = re.compile("_install_prefix}/lib/Qt5.*d+(.lib|.a)")
    exepattern = re.compile("_install_prefix}/bin/[a-z]+(.exe|)")
    toolexepattern = re.compile("_install_prefix}/tools/qt5/bin/[a-z]+(.exe|)")
    tooldllpattern = re.compile("_install_prefix}/tools/qt5/bin/Qt5.*d+(.dll|.so)")

@Neumann-A
Copy link
Contributor Author

@janholt: Your issue should be solved now

@JackBoosY
Copy link
Contributor

If you have completed this fix, please let me know.

Thanks.

@Neumann-A
Copy link
Contributor Author

Also VTK should build on linux. The error is:

CMake Error at Rendering/OpenGL2/CMakeLists.txt:154 (message):
  X11_Xt_LIB could not be found.  Required for VTK X lib.

so the CI machine is missing some required system library

@JackBoosY
Copy link
Contributor

Also VTK should build on linux. The error is:

CMake Error at Rendering/OpenGL2/CMakeLists.txt:154 (message):
  X11_Xt_LIB could not be found.  Required for VTK X lib.

so the CI machine is missing some required system library

Confirmed.

scripts/ci.baseline.txt Outdated Show resolved Hide resolved
@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Dec 16, 2019
@zweistein-frm2
Copy link

Hello,
I lost track on wether the qt5 linux (or WSL) build is working now? Which branch should I use? Please could you give a simple link as I am not so literate in advanced git. Thank you

@Neumann-A
Copy link
Contributor Author

@zweistein-frm2: If you cannot wait until this is merged into master:

git clone https://github.com/microsoft/vcpkg.git
git remote add Neumann-A https://github.com/Neumann-A/vcpkg.git
git fetch Neumann-A
git merge Neumann-A/fix_qt_linux

@zweistein-frm2
Copy link

OK, almost there, takes 6-12 h to compile on linux and goes through
But when I want to install something else (vcpkg install boost for example) then I get
Error: database corrupted. Package qt5:x64-linux is installed but dependency qt5-purchasing:x64-linux is not. Seems that vcpkg installation is busted!

@zweistein-frm2
Copy link

Seems that the database corruptions occurred only on a Windows and WSL install. On a real Ubuntu 18.04 there are no problems

@zweistein-frm2
Copy link

Maybe related: The windows vcpkg and the WSL vcpkg directories point to the same folder. Should be fine? as the triplets are in seperate folders

@Neumann-A
Copy link
Contributor Author

Error: database corrupted. Package qt5:x64-linux is installed but dependency qt5-purchasing:x64-linux is not. Seems that vcpkg installation is busted!

Yep the reason is:

Maybe related: The windows vcpkg and the WSL vcpkg directories point to the same folder. Should be fine?

No its not fine. vcpkg is not designed to be run in parallel into the same installed folder. This typically corrupts the database located in the folder installed/vcpkg

find_library(${_lib}_LIBRARY_RELEASE NAMES ${_lib} PATH_SUFFIXES plugins/platforms)
set_property(TARGET ${_target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\$<\$<NOT:\$<CONFIG:DEBUG>>:${${_lib}_LIBRARY_RELEASE}>\$<\$<CONFIG:DEBUG>:${${_lib}_LIBRARY_DEBUG}>)
#The fact that we are within this file means we are using the VCPKG toolchain. Has such we only need to search in VCPKG paths!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ras0219-msft
Copy link
Contributor

No its not fine. vcpkg is not designed to be run in parallel into the same installed folder.

You're 100% correct, but just to be very verbose about it:

  1. Running multiple vcpkg processes operating on the same instance at the same time is not allowed.
  2. Sharing one instance between Windows and WSL is allowed (as long as you don't modify it from both at the same time).

So it's ok to open a windows prompt, run vcpkg install xyz, wait for it to finish, then open wsl and run the same command. It's not ok to launch CMD and WSL prompts and run vcpkg install xyz in both to see which finishes first.

@ras0219-msft
Copy link
Contributor

/azp run

@JackBoosY
Copy link
Contributor

/azp run

@dan-shaw dan-shaw merged commit f8165f7 into microsoft:master Jan 6, 2020
@Neumann-A Neumann-A deleted the fix_qt_linux branch January 31, 2020 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants