From ccea542280a341f6e78941cea5846f725a5d51fd Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Tue, 4 Oct 2022 14:40:13 +0200 Subject: [PATCH 1/5] Add spdlog to binaries list. Add warning for missing binary Update pattern matching for binaries glob in bin paths. It will now match .so.X files that it would not before. CURA-9711 --- conandata.yml | 5 +++++ conanfile.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index daceec0349..aca3d52105 100644 --- a/conandata.yml +++ b/conandata.yml @@ -87,6 +87,11 @@ src: "bin" dst: "." binary: "CuraEngine" + spdlog: + package: "spdlog" + src: "lib" + dst: "." + binary: "libspdlog" hiddenimports: - "pySavitar" - "pyArcus" diff --git a/conanfile.py b/conanfile.py index c032d6d83f..4334db0a9e 100644 --- a/conanfile.py +++ b/conanfile.py @@ -208,8 +208,10 @@ class CuraConan(ConanFile): else: continue if not src_path.exists(): + self.output.warning(f"Source path for binary {binary['binary']} does not exist") continue - for bin in src_path.glob(binary["binary"] + ".*[exe|dll|so|dylib]"): + + for bin in src_path.glob(binary["binary"] + "*[.exe|.dll|.so|.dylib|.so.]*"): binaries.append((str(bin), binary["dst"])) for bin in src_path.glob(binary["binary"]): binaries.append((str(bin), binary["dst"])) From 1287dffe22ddf27ba0304c8f1a1f5fedb320395b Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Tue, 4 Oct 2022 15:45:37 +0200 Subject: [PATCH 2/5] Add fmt binaries to list. CURA-9711 --- conandata.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conandata.yml b/conandata.yml index aca3d52105..e3dc2eb1c8 100644 --- a/conandata.yml +++ b/conandata.yml @@ -92,6 +92,11 @@ src: "lib" dst: "." binary: "libspdlog" + fmt: + package: "fmt" + src: "lib" + dst: "." + binary: "libfmt" hiddenimports: - "pySavitar" - "pyArcus" From ca90ac7787587db9e90a15584854ea54bcbc45d8 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Wed, 5 Oct 2022 10:47:34 +0200 Subject: [PATCH 3/5] Fix adding all shared libs managed by Conan to pyinstaller Closes #13422 Contributes to CURA-9711 --- conandata.yml | 11 ----------- conanfile.py | 15 +++++++++------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/conandata.yml b/conandata.yml index 377224053c..0da3e8bc1d 100644 --- a/conandata.yml +++ b/conandata.yml @@ -220,7 +220,6 @@ Windows: "./icons/Cura.ico" Macos: "./icons/cura.icns" Linux: "./icons/cura-128.png" - "5.2.0-beta.1": requirements: - "pyarcus/5.2.0-beta.1" @@ -298,16 +297,6 @@ src: "bin" dst: "." binary: "CuraEngine" - spdlog: - package: "spdlog" - src: "lib" - dst: "." - binary: "libspdlog" - fmt: - package: "fmt" - src: "lib" - dst: "." - binary: "libfmt" hiddenimports: - "pySavitar" - "pyArcus" diff --git a/conanfile.py b/conanfile.py index 4334db0a9e..f5c9fcd65f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -216,14 +216,17 @@ class CuraConan(ConanFile): for bin in src_path.glob(binary["binary"]): binaries.append((str(bin), binary["dst"])) - for _, dependency in self.dependencies.items(): - for bin_paths in dependency.cpp_info.bindirs: - binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dll")]) - binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dylib")]) - binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.so")]) + # Make sure all Conan dependencies which are shared are added to the binary list for pyinstaller + for _, dependency in self.dependencies.host.items(): + if hasattr(dependency.options, "shared") and dependency.options.shared: + for bin_paths in dependency.cpp_info.bindirs: + binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*")]) + for lib_paths in dependency.cpp_info.libdirs: + binaries.extend([(f"{p}", ".") for p in Path(lib_paths).glob("**/*")]) # Copy dynamic libs from lib path - binaries.extend([(f"{p}", ".") for p in Path(self._base_dir.joinpath("lib")).glob("**/*.dylib")]) + binaries.extend([(f"{p}", ".") for p in Path(self._base_dir.joinpath("lib")).glob("**/*.dylib*")]) + binaries.extend([(f"{p}", ".") for p in Path(self._base_dir.joinpath("lib")).glob("**/*.so*")]) # Collect all dll's from PyQt6 and place them in the root binaries.extend([(f"{p}", ".") for p in Path(self._site_packages, "PyQt6", "Qt6").glob("**/*.dll")]) From ad65ffa76c1197ef81bc9d8df9332400b0639868 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Wed, 5 Oct 2022 10:56:53 +0200 Subject: [PATCH 4/5] Fix check if option exist Contributes to CURA-9711 --- conanfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index f5c9fcd65f..47ca0354e3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,7 +7,7 @@ from conan import ConanFile from conan.tools.files import copy, rmdir, save from conan.tools.env import VirtualRunEnv, Environment from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException required_conan_version = ">=1.50.0" @@ -218,7 +218,11 @@ class CuraConan(ConanFile): # Make sure all Conan dependencies which are shared are added to the binary list for pyinstaller for _, dependency in self.dependencies.host.items(): - if hasattr(dependency.options, "shared") and dependency.options.shared: + try: + is_shared = dependency.options.shared + except ConanException: + is_shared = False + if is_shared: for bin_paths in dependency.cpp_info.bindirs: binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*")]) for lib_paths in dependency.cpp_info.libdirs: From e2cf889f7feaa4e93ce04171e917ee0ec28047e7 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Wed, 5 Oct 2022 11:08:53 +0200 Subject: [PATCH 5/5] Don't check for shared Contributes to CURA-9711 --- conanfile.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/conanfile.py b/conanfile.py index 47ca0354e3..a932f0a232 100644 --- a/conanfile.py +++ b/conanfile.py @@ -218,15 +218,10 @@ class CuraConan(ConanFile): # Make sure all Conan dependencies which are shared are added to the binary list for pyinstaller for _, dependency in self.dependencies.host.items(): - try: - is_shared = dependency.options.shared - except ConanException: - is_shared = False - if is_shared: - for bin_paths in dependency.cpp_info.bindirs: - binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*")]) - for lib_paths in dependency.cpp_info.libdirs: - binaries.extend([(f"{p}", ".") for p in Path(lib_paths).glob("**/*")]) + for bin_paths in dependency.cpp_info.bindirs: + binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*")]) + for lib_paths in dependency.cpp_info.libdirs: + binaries.extend([(f"{p}", ".") for p in Path(lib_paths).glob("**/*")]) # Copy dynamic libs from lib path binaries.extend([(f"{p}", ".") for p in Path(self._base_dir.joinpath("lib")).glob("**/*.dylib*")])