From bda1f25e8ebc5ffa990171cd1be0111f2e183d86 Mon Sep 17 00:00:00 2001 From: Shyamnath Premnadh Date: Wed, 22 Nov 2023 14:54:41 +0100 Subject: Deployment: Relative path bug fix - The qml files are identified and stored as relative path and line under consideration tries to do a 'relative_to()' on an absolute path which causes the error ValueError: {qml_file} is not in the subpath of 'project_path' OR one path is relative and the other is absolute. The error only appears on the first run of pyside6-deploy with a project that does not have a .pyproject file. For the subsequent runs, absolute path are used because the path is fetched from the deploy config file. - This patch fixes this error by using absolute path for each qml_file Pick-to: 6.5 Task-number: PYSIDE-1612 Change-Id: Ib54edded404bd1be87ab5f22f61e2d30416b7dae Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit b0de21cea7f01db97a46d72d8edcb7944aaa4387) Reviewed-by: Qt Cherry-pick Bot --- sources/pyside-tools/deploy_lib/nuitka_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/pyside-tools/deploy_lib/nuitka_helper.py b/sources/pyside-tools/deploy_lib/nuitka_helper.py index 69521bfbb..ae3d2ff94 100644 --- a/sources/pyside-tools/deploy_lib/nuitka_helper.py +++ b/sources/pyside-tools/deploy_lib/nuitka_helper.py @@ -28,8 +28,9 @@ class Nuitka: # --include-data-files=ABSOLUTE_PATH_TO_FILE=RELATIVE_PATH_TO ROOT # for each file. This will preserve the directory structure of QML resources. qml_args.extend( - [f"--include-data-files={qml_file}=./{qml_file.relative_to(source_file.parent)}" - for qml_file in qml_files] + [f"--include-data-files={qml_file.resolve()}=" + f"./{qml_file.resolve().relative_to(source_file.parent)}" + for qml_file in qml_files] ) if excluded_qml_plugins: -- cgit v1.2.3