mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 08:29:00 +08:00
5afd32266c
* add upstream patch * [skip actions] add the patch file * fine tune * [opencv] update portfiles to use vcpkg-get-python-packages * fix references * try another fix * add all deps * add code from tensorflow about venv * retry * fix file path * new approach * unset pythonhome * next unset * try this instead. * retry without the PYTHON_LIB_PATH stuff * try and error * next try * retry * typo fix * try updating * retry * more try and error * reorder * drop qface version * use qface 2.0.5 * bump watchdog * fix call on !windows * fine tuning * refactor function signature * update version * fix formating * version stuff * create dir before usage * fine tuning * version stuff * update and patch libilbc * formating stuff * fix version-string * version stuff * add license * version update * bump version * version stuff * version stuff Co-authored-by: Alexander Neumann <you@example.com> Co-authored-by: Stefano Sinigardi <stesinigardi@hotmail.com>
149 lines
6.7 KiB
Diff
149 lines
6.7 KiB
Diff
From 49b44d45c9eb5b5b98697f9ebb74204d45f0db38 Mon Sep 17 00:00:00 2001
|
|
From: Dominik Holland <dominik.holland@qt.io>
|
|
Date: Wed, 06 Apr 2022 15:43:23 +0200
|
|
Subject: [PATCH] ifcodegen: Add a fallback mechanism for too recent python packages
|
|
|
|
After the virtualenv is created the generator is now verified to be
|
|
working correctly. In case the generator doesn't work, an error
|
|
message is shown, which suggests to reconfigure with
|
|
|
|
-DQT_USE_MINIMAL_QFACE_PACKAGES=TRUE
|
|
|
|
The new option will install the minimum required dependencies for
|
|
qface.
|
|
|
|
Fixes: QTBUG-102348
|
|
Pick-to: 6.2 6.3
|
|
Change-Id: I59aca5848da8928e94c0d33a108735847d9260a2
|
|
---
|
|
|
|
diff --git a/src/tools/ifcodegen/CMakeLists.txt b/src/tools/ifcodegen/CMakeLists.txt
|
|
index 2d9e3a4..317d77f 100644
|
|
--- a/src/tools/ifcodegen/CMakeLists.txt
|
|
+++ b/src/tools/ifcodegen/CMakeLists.txt
|
|
@@ -22,11 +22,13 @@
|
|
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
|
|
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/Scripts/activate.bat)
|
|
set(VIRTUALENV_ACTIVATE_COMMAND ${VIRTUALENV_ACTIVATE})
|
|
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/Scripts/python.exe)
|
|
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/Scripts/qface.exe)
|
|
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.bat)
|
|
else()
|
|
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/bin/activate)
|
|
set(VIRTUALENV_ACTIVATE_COMMAND . ${VIRTUALENV_ACTIVATE})
|
|
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/bin/python)
|
|
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/bin/qface)
|
|
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.sh)
|
|
endif()
|
|
@@ -63,6 +65,15 @@
|
|
# someone is working on the qface sources
|
|
file(GLOB_RECURSE IFCODEGEN_SOURCE_FILES ${IFCODEGEN_SOURCE_DIR}/*.py)
|
|
|
|
+ # If the upstream python packages introduce a regression this option can be used to install
|
|
+ # the minimum version for all required python package and produce a working setup
|
|
+ # Those packages might be outdated and may contain security holes, but they are known to be
|
|
+ # working.
|
|
+ set(INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND)
|
|
+ if (QT_USE_MINIMAL_QFACE_PACKAGES)
|
|
+ set(INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND COMMAND pip3 install -r ${IFCODEGEN_SOURCE_DIR}/requirements_minimal.txt)
|
|
+ endif()
|
|
+
|
|
# On the CI we use the special wheel folder when available to not download all packages again on each build
|
|
set(PYTHON3_WHEEL_CACHE "$ENV{PYTHON3_WHEEL_CACHE}" CACHE PATH "Python3 wheel cache")
|
|
if (EXISTS "${PYTHON3_WHEEL_CACHE}")
|
|
@@ -74,6 +85,7 @@
|
|
|
|
add_custom_command(OUTPUT ${IFCODEGEN_BIN}
|
|
COMMAND ${VIRTUALENV_ACTIVATE_COMMAND}
|
|
+ ${INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND}
|
|
COMMAND ${PIP3_INSTALL_COMMAND}
|
|
DEPENDS ${VIRTUALENV_ACTIVATE}
|
|
${IFCODEGEN_SOURCE_DIR}/requirements.txt
|
|
@@ -82,16 +94,23 @@
|
|
)
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
|
|
- ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
|
|
COMMAND ${DEPLOY_VIRTUALENV} qtif_qface_virtualenv
|
|
COMMAND ${CMAKE_COMMAND} -E touch .stamp-deploy_virtualenv
|
|
- COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
|
|
DEPENDS ${IFCODEGEN_BIN}
|
|
)
|
|
|
|
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
|
|
+ COMMAND ${VIRTUALENV_PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/verify_generator.py
|
|
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-generator-verified
|
|
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
|
|
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
|
|
+ COMMENT "Verifying generator"
|
|
+ )
|
|
+
|
|
# main target which just relies on the stamp file to be uptodate
|
|
add_custom_target(ifcodegen ALL
|
|
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
|
|
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
|
|
)
|
|
# Create the rerun cmake stamp file here to be able to add cmake configure dependency
|
|
@@ -109,6 +128,7 @@
|
|
#####################################################################
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
|
|
${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
|
|
${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
|
|
${VIRTUALENV_PATH}
|
|
diff --git a/src/tools/ifcodegen/verify_generator.py b/src/tools/ifcodegen/verify_generator.py
|
|
new file mode 100755
|
|
index 0000000..c3f85d6
|
|
--- /dev/null
|
|
+++ b/src/tools/ifcodegen/verify_generator.py
|
|
@@ -0,0 +1,46 @@
|
|
+#!/usr/bin/env python3
|
|
+#############################################################################
|
|
+##
|
|
+## Copyright (C) 2022 The Qt Company Ltd.
|
|
+## Contact: https://www.qt.io/licensing/
|
|
+##
|
|
+## This file is part of the QtInterfaceFramework module of the Qt Toolkit.
|
|
+##
|
|
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
|
+## Commercial License Usage
|
|
+## Licensees holding valid commercial Qt licenses may use this file in
|
|
+## accordance with the commercial license agreement provided with the
|
|
+## Software or, alternatively, in accordance with the terms contained in
|
|
+## a written agreement between you and The Qt Company. For licensing terms
|
|
+## and conditions see https://www.qt.io/terms-conditions. For further
|
|
+## information use the contact form at https://www.qt.io/contact-us.
|
|
+##
|
|
+## GNU General Public License Usage
|
|
+## Alternatively, this file may be used under the terms of the GNU
|
|
+## General Public License version 3 as published by the Free Software
|
|
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
+## included in the packaging of this file. Please review the following
|
|
+## information to ensure the GNU General Public License requirements will
|
|
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
+##
|
|
+## $QT_END_LICENSE$
|
|
+##
|
|
+#############################################################################
|
|
+
|
|
+try:
|
|
+ import generate
|
|
+except Exception as e:
|
|
+ raise SystemExit("""
|
|
+ Verifying the generator failed!
|
|
+
|
|
+ This might be caused by a too recent python version or
|
|
+ too recent python packages. You can try installing older
|
|
+ python packages by running configure again with the the
|
|
+ following option:
|
|
+
|
|
+ -DQT_USE_MINIMAL_QFACE_PACKAGES=TRUE
|
|
+
|
|
+ The python error was:
|
|
+
|
|
+ {}
|
|
+ """.format(e))
|