From b80345f5f61a3288989cd0050de532a3ebf7846f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 12 Feb 2024 12:52:15 +0100 Subject: [PATCH 01/11] Use Conan v2 Contribute to CURA-11622 --- .github/workflows/conan-package.yml | 41 ++++++++++++++++++++++++----- conanfile.py | 23 ++++++++-------- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 8953cba..64528da 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -8,41 +8,68 @@ on: - 'CMakelists.txt' - '.github/workflows/conan-package.yml' - '.github/workflows/requirements*.txt' + branches: + - main + - 'CURA-*' + - 'PP-*' + - 'NP-*' + - '[0-9].[0-9]*' + - '[0-9].[0-9][0-9]*' jobs: +# FIXME: Use main once merged conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-11622_conan_v2 with: project_name: curaengine_grpc_definitions +# FIXME: Use main once merged conan-package-export: needs: [ conan-recipe-version ] - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} secrets: inherit +# FIXME: Use main once merged conan-package-create-macos: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} secrets: inherit +# FIXME: Use main once merged conan-package-create-windows: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} secrets: inherit +# FIXME: Use main once merged conan-package-create-linux: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - secrets: inherit + secrets: inherit \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 3edb87b..55aa190 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,5 +1,6 @@ -# Copyright (c) 2023 UltiMaker +# Copyright (c) 2024 UltiMaker # curaengine_grpc_definitions is released under the terms of the MIT + import os from pathlib import Path @@ -10,9 +11,9 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, update_conandata from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc -from conan.tools.scm import Version +from conan.tools.scm import Version, Git -required_conan_version = ">=1.58.0 <2.0.0" +required_conan_version = ">=1.58.0" class CuraEngine_gRPC_DefinitionsConan(ConanFile): @@ -39,6 +40,10 @@ def set_version(self): if not self.version: self.version = self.conan_data["version"] + def export(self): + git = Git(self) + update_conandata(self, {"version": self.version, "commit": git.get_commit()}) + @property def _min_cppstd(self): return 20 @@ -53,9 +58,6 @@ def _compilers_minimum_version(self): "visual_studio": "17", } - def export(self): - update_conandata(self, {"version": self.version}) - def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) copy(self, "*.proto", self.recipe_folder, self.export_sources_folder) @@ -96,10 +98,10 @@ def layout(self): def requirements(self): self.requires("protobuf/3.21.12", transitive_headers = True) - self.requires("boost/1.82.0") - self.requires("asio-grpc/2.6.0") - self.requires("grpc/1.50.1", transitive_headers = True) - self.requires("openssl/3.2.0") + self.requires("boost/1.83.0") + self.requires("asio-grpc/2.9.2") + self.requires("grpc/1.54.3", transitive_headers = True) + self.requires("openssl/3.2.1") def validate(self): # validate the minimum cpp standard supported. For C++ projects only @@ -119,7 +121,6 @@ def build_requirements(self): self.tool_requires("protobuf/3.21.9") def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) if is_msvc(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) From 4cc927229c66d6bb05a016038e8e1cc5dd7506a1 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 10 Sep 2024 14:39:44 +0200 Subject: [PATCH 02/11] Useless change to trigger build --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 55aa190..7ebaa21 100644 --- a/conanfile.py +++ b/conanfile.py @@ -75,8 +75,8 @@ def configure(self): self.options["grpc"].node_plugin = False self.options["grpc"].objective_c_plugin = False self.options["grpc"].php_plugin = False - self.options["grpc"].python_plugin = False self.options["grpc"].ruby_plugin = False + self.options["grpc"].python_plugin = False self.options["asio-grpc"].local_allocator = "recycling_allocator" def layout(self): From 83f960a9057e7ab2e1ccaaec16b9c46fa4981e7d Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 12 Sep 2024 11:58:34 +0200 Subject: [PATCH 03/11] Use common packaging workflow --- .github/workflows/conan-package.yml | 54 ++--------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 64528da..bb79b98 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -18,58 +18,8 @@ on: jobs: # FIXME: Use main once merged - conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-11622_conan_v2 + conan-package: + uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@CURA-11622_conan_v2 with: project_name: curaengine_grpc_definitions - -# FIXME: Use main once merged - conan-package-export: - needs: [ conan-recipe-version ] - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-11622_conan_v2 - with: - recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} - recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} - recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} - recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} - recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - secrets: inherit - -# FIXME: Use main once merged - conan-package-create-macos: - needs: [ conan-recipe-version, conan-package-export ] - if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@CURA-11622_conan_v2 - with: - recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} - recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} - recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} - recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} - recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} secrets: inherit - -# FIXME: Use main once merged - conan-package-create-windows: - needs: [ conan-recipe-version, conan-package-export ] - if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@CURA-11622_conan_v2 - with: - recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} - recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} - recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} - recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} - recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - secrets: inherit - -# FIXME: Use main once merged - conan-package-create-linux: - needs: [ conan-recipe-version, conan-package-export ] - if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-11622_conan_v2 - with: - recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} - recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} - recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} - recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} - recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - secrets: inherit \ No newline at end of file From 0647f0316c33db795e472bed79920db753dd97b2 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 12 Sep 2024 16:37:12 +0200 Subject: [PATCH 04/11] Set minimum conan version --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 7ebaa21..d41d067 100644 --- a/conanfile.py +++ b/conanfile.py @@ -13,7 +13,7 @@ from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc from conan.tools.scm import Version, Git -required_conan_version = ">=1.58.0" +required_conan_version = ">=2.7.0" class CuraEngine_gRPC_DefinitionsConan(ConanFile): From 4d44cc67cc11deb1dce3be420712fe617fbe4734 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 17 Sep 2024 08:23:48 +0200 Subject: [PATCH 05/11] Remove now useless file --- .github/workflows/requirements-runner.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/requirements-runner.txt diff --git a/.github/workflows/requirements-runner.txt b/.github/workflows/requirements-runner.txt deleted file mode 100644 index e69de29..0000000 From 1ab8f5a9aa9ca532edf7733dfd368374daa70cd4 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 19 Sep 2024 12:08:56 +0200 Subject: [PATCH 06/11] Remove dependencies options Options are now set in global profile, as recommended by conan --- conanfile.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/conanfile.py b/conanfile.py index d41d067..29e83ec 100644 --- a/conanfile.py +++ b/conanfile.py @@ -67,17 +67,8 @@ def config_options(self): del self.options.fPIC def configure(self): - self.options["boost"].header_only = True - if self.options.shared: self.options.rm_safe("fPIC") - self.options["grpc"].csharp_plugin = False - self.options["grpc"].node_plugin = False - self.options["grpc"].objective_c_plugin = False - self.options["grpc"].php_plugin = False - self.options["grpc"].ruby_plugin = False - self.options["grpc"].python_plugin = False - self.options["asio-grpc"].local_allocator = "recycling_allocator" def layout(self): cmake_layout(self) @@ -98,9 +89,7 @@ def layout(self): def requirements(self): self.requires("protobuf/3.21.12", transitive_headers = True) - self.requires("boost/1.83.0") self.requires("asio-grpc/2.9.2") - self.requires("grpc/1.54.3", transitive_headers = True) self.requires("openssl/3.2.1") def validate(self): From ceb3d51e029f6e7778ad1d62ea31b89f3c479654 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 25 Sep 2024 15:26:50 +0200 Subject: [PATCH 07/11] Update variable name --- .github/workflows/conan-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 5ea5126..ba591ab 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -22,5 +22,5 @@ jobs: conan-package: uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@CURA-11622_conan_v2 with: - project_name: curaengine_grpc_definitions + package_name: curaengine_grpc_definitions secrets: inherit From e28ba74e5b934f1c285e5d45358e0c59f7417416 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 21 Nov 2024 09:57:42 +0100 Subject: [PATCH 08/11] (building) Change deprecated field into the new name. CURA-11622 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 29e83ec..5e48c83 100644 --- a/conanfile.py +++ b/conanfile.py @@ -114,7 +114,7 @@ def generate(self): if is_msvc(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - tc.variables["GRPC_PROTOS"] = ";".join([str(p).replace("\\", "/") for p in Path(self.source_path).rglob("*.proto")]) + tc.variables["GRPC_PROTOS"] = ";".join([str(p).replace("\\", "/") for p in Path(self.source_folder).rglob("*.proto")]) tc.generate() tc = CMakeDeps(self) From 8d7b8646a888463533afae352ae7cfe50b00a627 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 26 Nov 2024 11:58:17 +0100 Subject: [PATCH 09/11] Use simplified package creation workflow --- .github/workflows/conan-package.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index ba591ab..8e8a0c0 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -21,6 +21,4 @@ jobs: # FIXME: Use main once merged conan-package: uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@CURA-11622_conan_v2 - with: - package_name: curaengine_grpc_definitions secrets: inherit From 1a5d3b2e323ecb6e127cc3fddfa2e4a343fe74a0 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 29 Nov 2024 09:19:03 +0100 Subject: [PATCH 10/11] Remove openssl dependency --- conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 5e48c83..c843a7c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -90,7 +90,6 @@ def layout(self): def requirements(self): self.requires("protobuf/3.21.12", transitive_headers = True) self.requires("asio-grpc/2.9.2") - self.requires("openssl/3.2.1") def validate(self): # validate the minimum cpp standard supported. For C++ projects only From 62ada1d2aa4ff5351bfe3550a87fb053049550d7 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 4 Dec 2024 13:06:14 +0100 Subject: [PATCH 11/11] Prepare for merge CURA-11622 --- .github/workflows/conan-package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 8e8a0c0..4aecbe5 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -18,7 +18,6 @@ on: - '[0-9].[0-9][0-9]*' jobs: -# FIXME: Use main once merged conan-package: - uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@CURA-11622_conan_v2 + uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@main secrets: inherit