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

Fix qt incorrectly detecting an android build on non-android targets. #27619

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

BillyONeal
Copy link
Member

Probably introduced in #27421 , shows up as a baseline issue in #27598

@BillyONeal BillyONeal added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Nov 2, 2022
@BillyONeal
Copy link
Member Author

/cc @m-kuhn @Neumann-A

Comment on lines +108 to +110
if(VCPKG_TARGET_IS_ANDROID)
list(APPEND _qarg_OPTIONS "-DANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}")
endif()
Copy link
Contributor

@Neumann-A Neumann-A Nov 3, 2022

Choose a reason for hiding this comment

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

Are you sure this is the issue?

The error reads:

CMake Error at cmake/QtBuildInformation.cmake:472 (message):
  Feature "opengles2": Forcing to "ON" breaks its condition:

      NOT WIN32 AND NOT WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND

  Condition values dump:

      WIN32 = ""
      WATCHOS = "0"
      QT_FEATURE_opengl_desktop = "OFF"
      GLESv2_FOUND = "FALSE"

So I see "-DFEATURE_opengles2=ON" in combination with GLESv2_FOUND = "FALSE" more as a problem. Can it be that angle was installed before qtbase which then failed the compile check (since it incorrectly picks up GLESv2 from angle )? Seems like a problem #26693 would have solve ;)

I am more concerned about the errors in https://dev.azure.com/vcpkg/public/_build/results?buildId=80379&view=results where it seems like required dependencies are not restored.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am more concerned about the errors in https://dev.azure.com/vcpkg/public/_build/results?buildId=80379&view=results where it seems like required dependencies are not restored.

Or maybe it is just reinstalling angle after qtbase has been correctly build and then failing the check. So could be the same issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I am not sure this is the actual problem. I just saw that the first line of output is:

-- Android build detected, checking configuration defaults...

and I assumed that may make different stuff happen vis a vis that OpenGL stuff because portfile.cmake does not think it's an Android build, but qt thinks it is.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am more concerned about the errors in https://dev.azure.com/vcpkg/public/_build/results?buildId=80379&view=results where it seems like required dependencies are not restored.

The first build failure there is:

Building qtshadertools[core]:x64-linux...
-- Using cached qtshadertools-everywhere-src-6.3.2.tar.xz.
-- Extracting source /mnt/vcpkg-ci/downloads/qtshadertools-everywhere-src-6.3.2.tar.xz
-- Using source at /mnt/vcpkg-ci/buildtrees/qtshadertools/src/here-src-6-681300ef4b.clean
-- Configuring x64-linux
CMake Warning at /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:310 (message):
  The following variables are not used in CMakeLists.txt:

      ANDROID_SDK_ROOT
      INSTALL_MKSPECSDIR
      QT_BUILD_BENCHMARKS
      QT_BUILD_EXAMPLES
      QT_BUILD_TESTS
      QT_MKSPECS_DIR
      QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS

  Please recheck them and remove the unnecessary options from the
  `vcpkg_cmake_configure` call.

  If these options should still be passed for whatever reason, please use the
  `MAYBE_UNUSED_VARIABLES` argument.
Call Stack (most recent call first):
  /mnt/vcpkg-ci/installed/x64-linux/share/qtbase/qt_install_submodule.cmake:112 (vcpkg_cmake_configure)
  /mnt/vcpkg-ci/installed/x64-linux/share/qtbase/qt_install_submodule.cmake:298 (qt_cmake_configure)
  ports/qtshadertools/portfile.cmake:8 (qt_install_submodule)
  scripts/ports.cmake:147 (include)


-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:131 (message):
    Command failed: /mnt/vcpkg-ci/downloads/tools/cmake-3.24.0-linux/cmake-3.24.0-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j33
    Working Directory: /mnt/vcpkg-ci/buildtrees/qtshadertools/x64-linux-dbg
    See logs for more information:
      /mnt/vcpkg-ci/buildtrees/qtshadertools/install-x64-linux-dbg-err.log

Call Stack (most recent call first):
  /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  /mnt/vcpkg-ci/installed/x64-linux/share/qtbase/qt_install_submodule.cmake:305 (vcpkg_cmake_install)
  ports/qtshadertools/portfile.cmake:8 (qt_install_submodule)
  scripts/ports.cmake:147 (include)


error: building qtshadertools:x64-linux failed with: BUILD_FAILED

Where install-x64-linux-dbg-err.log says:

ninja: error: unknown target 'install'

and I have no idea what could cause that.

Copy link
Contributor

Choose a reason for hiding this comment

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

wrong log. You need to check the configure log. There it tells you that the target Qt6::Gui was not found probably because find_package(GLESv2) silently failed. Due to how upstream CI works configure is not allowed to fail if a module is not available. (so all find_package calls are missing the REQUIRED keyword even for internal deps.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I am fine with this change but I don't think it will solve the underlying problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, in that case I'll merge this and watch for the problem still being present...

@BillyONeal BillyONeal merged commit 11afcc7 into microsoft:master Nov 3, 2022
@BillyONeal BillyONeal deleted the android-qtbase branch November 4, 2022 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants