From c65f0e14932e29beb0a8cc84e65b2054b0bf3474 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 19 May 2023 09:04:13 +0200 Subject: [PATCH 001/118] Use pyArcus with static compiled Arcus and Protobuf Contributes to CURA-10475 --- conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index f6e1637355..68e73913d0 100644 --- a/conanfile.py +++ b/conanfile.py @@ -49,7 +49,7 @@ class CuraConan(ConanFile): def set_version(self): if not self.version: - self.version = "5.4.0-alpha" + self.version = "5.4.0-alpha.1" @property def _pycharm_targets(self): @@ -269,8 +269,8 @@ class CuraConan(ConanFile): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): - self.requires("pyarcus/5.2.2") - self.requires("curaengine/latest@ultimaker/testing") + self.requires("pyarcus/latest@ultimaker/cura_10475") # TODO: point to `testing` once the CURA-10475 from CuraEngine is main + self.requires("curaengine/latest@ultimaker/cura_10475") # TODO: point to `testing` once the CURA-10475 from CuraEngine is main self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") self.requires("uranium/(latest)@ultimaker/testing") From c11c23c173e68b574b3af6970cec100e248eafd8 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 19 May 2023 09:05:06 +0200 Subject: [PATCH 002/118] Disable plugins for Enterprise This would then default to default behaviour of slots Contributes to CURA-10475 --- conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conanfile.py b/conanfile.py index 68e73913d0..87e3652188 100644 --- a/conanfile.py +++ b/conanfile.py @@ -262,6 +262,8 @@ class CuraConan(ConanFile): self.options["pysavitar"].shared = True self.options["pynest2d"].shared = True self.options["cpython"].shared = True + if self._enterprise: + self.options["curaengine"].enable_plugins = False def validate(self): version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) From 281dde4b2300f49688816bcb83029be0d6d47345 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 19 May 2023 11:13:02 +0200 Subject: [PATCH 003/118] Use boost 1.81.0 Contributes to CURA-10475 --- conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conanfile.py b/conanfile.py index 87e3652188..a40b6b310e 100644 --- a/conanfile.py +++ b/conanfile.py @@ -278,6 +278,7 @@ class CuraConan(ConanFile): self.requires("uranium/(latest)@ultimaker/testing") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") + self.requires("boost/1.81.0") if self.options.internal: self.requires("cura_private_data/(latest)@ultimaker/testing") self.requires("fdm_materials/(latest)@internal/testing") From e3123e80cafd242fc5eb64b7e4594c23666183a3 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Fri, 19 May 2023 09:23:38 +0000 Subject: [PATCH 004/118] update translations --- resources/i18n/cs_CZ/cura.po | 8 +- resources/i18n/cura.pot | 932 +++++++++++++++++------------------ resources/i18n/de_DE/cura.po | 8 +- resources/i18n/es_ES/cura.po | 8 +- resources/i18n/fi_FI/cura.po | 8 +- resources/i18n/fr_FR/cura.po | 8 +- resources/i18n/hu_HU/cura.po | 8 +- resources/i18n/it_IT/cura.po | 8 +- resources/i18n/ja_JP/cura.po | 8 +- resources/i18n/ko_KR/cura.po | 8 +- resources/i18n/nl_NL/cura.po | 8 +- resources/i18n/pl_PL/cura.po | 8 +- resources/i18n/pt_BR/cura.po | 8 +- resources/i18n/pt_PT/cura.po | 8 +- resources/i18n/ru_RU/cura.po | 8 +- resources/i18n/tr_TR/cura.po | 8 +- resources/i18n/zh_CN/cura.po | 8 +- resources/i18n/zh_TW/cura.po | 8 +- 18 files changed, 534 insertions(+), 534 deletions(-) diff --git a/resources/i18n/cs_CZ/cura.po b/resources/i18n/cs_CZ/cura.po index f20c8c2949..30259d6310 100644 --- a/resources/i18n/cs_CZ/cura.po +++ b/resources/i18n/cs_CZ/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2023-02-16 20:28+0100\n" "Last-Translator: Miroslav Šustek \n" "Language-Team: DenyCZ \n" @@ -3689,17 +3689,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Odstranit tiskárnu" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Tisk přes síť" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Tisk přes síť" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Připojeno přes síť" diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 9321ffa72b..f916a15808 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3321,17 +3321,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "" @@ -6244,6 +6244,106 @@ msgstr "" msgctxt "@label" msgid "No items to select from" msgstr "" +#: plugins/UltimakerMachineActions/plugin.json +msgctxt "description" +msgid "Provides machine actions for Ultimaker machines (such as bed leveling wizard, selecting upgrades, etc.)." +msgstr "" + +#: plugins/UltimakerMachineActions/plugin.json +msgctxt "name" +msgid "UltiMaker machine actions" +msgstr "" + +#: plugins/SupportEraser/plugin.json +msgctxt "description" +msgid "Creates an eraser mesh to block the printing of support in certain places" +msgstr "" + +#: plugins/SupportEraser/plugin.json +msgctxt "name" +msgid "Support Eraser" +msgstr "" + +#: plugins/GCodeGzReader/plugin.json +msgctxt "description" +msgid "Reads g-code from a compressed archive." +msgstr "" + +#: plugins/GCodeGzReader/plugin.json +msgctxt "name" +msgid "Compressed G-code Reader" +msgstr "" + +#: plugins/SentryLogger/plugin.json +msgctxt "description" +msgid "Logs certain events so that they can be used by the crash reporter" +msgstr "" + +#: plugins/SentryLogger/plugin.json +msgctxt "name" +msgid "Sentry Logger" +msgstr "" + +#: plugins/CuraProfileReader/plugin.json +msgctxt "description" +msgid "Provides support for importing Cura profiles." +msgstr "" + +#: plugins/CuraProfileReader/plugin.json +msgctxt "name" +msgid "Cura Profile Reader" +msgstr "" + +#: plugins/3MFWriter/plugin.json +msgctxt "description" +msgid "Provides support for writing 3MF files." +msgstr "" + +#: plugins/3MFWriter/plugin.json +msgctxt "name" +msgid "3MF Writer" +msgstr "" + +#: plugins/PerObjectSettingsTool/plugin.json +msgctxt "description" +msgid "Provides the Per Model Settings." +msgstr "" + +#: plugins/PerObjectSettingsTool/plugin.json +msgctxt "name" +msgid "Per Model Settings Tool" +msgstr "" + +#: plugins/PrepareStage/plugin.json +msgctxt "description" +msgid "Provides a prepare stage in Cura." +msgstr "" + +#: plugins/PrepareStage/plugin.json +msgctxt "name" +msgid "Prepare Stage" +msgstr "" + +#: plugins/TrimeshReader/plugin.json +msgctxt "description" +msgid "Provides support for reading model files." +msgstr "" + +#: plugins/TrimeshReader/plugin.json +msgctxt "name" +msgid "Trimesh Reader" +msgstr "" + +#: plugins/Marketplace/plugin.json +msgctxt "description" +msgid "Manages extensions to the application and allows browsing extensions from the UltiMaker website." +msgstr "" + +#: plugins/Marketplace/plugin.json +msgctxt "name" +msgid "Marketplace" +msgstr "" + #: plugins/LegacyProfileReader/plugin.json msgctxt "description" msgid "Provides support for importing profiles from legacy Cura versions." @@ -6254,34 +6354,294 @@ msgctxt "name" msgid "Legacy Cura Profile Reader" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json +#: plugins/GCodeProfileReader/plugin.json msgctxt "description" -msgid "Upgrades configurations from Cura 2.2 to Cura 2.4." +msgid "Provides support for importing profiles from g-code files." msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json +#: plugins/GCodeProfileReader/plugin.json msgctxt "name" -msgid "Version Upgrade 2.2 to 2.4" +msgid "G-code Profile Reader" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade411to412/plugin.json +#: plugins/CuraDrive/plugin.json msgctxt "description" -msgid "Upgrades configurations from Cura 4.11 to Cura 4.12." +msgid "Backup and restore your configuration." msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade411to412/plugin.json +#: plugins/CuraDrive/plugin.json msgctxt "name" -msgid "Version Upgrade 4.11 to 4.12" +msgid "Cura Backups" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade41to42/plugin.json +#: plugins/3MFReader/plugin.json msgctxt "description" -msgid "Upgrades configurations from Cura 4.1 to Cura 4.2." +msgid "Provides support for reading 3MF files." msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade41to42/plugin.json +#: plugins/3MFReader/plugin.json msgctxt "name" -msgid "Version Upgrade 4.1 to 4.2" +msgid "3MF Reader" +msgstr "" + +#: plugins/X3DReader/plugin.json +msgctxt "description" +msgid "Provides support for reading X3D files." +msgstr "" + +#: plugins/X3DReader/plugin.json +msgctxt "name" +msgid "X3D Reader" +msgstr "" + +#: plugins/RemovableDriveOutputDevice/plugin.json +msgctxt "description" +msgid "Provides removable drive hotplugging and writing support." +msgstr "" + +#: plugins/RemovableDriveOutputDevice/plugin.json +msgctxt "name" +msgid "Removable Drive Output Device Plugin" +msgstr "" + +#: plugins/FirmwareUpdateChecker/plugin.json +msgctxt "description" +msgid "Checks for firmware updates." +msgstr "" + +#: plugins/FirmwareUpdateChecker/plugin.json +msgctxt "name" +msgid "Firmware Update Checker" +msgstr "" + +#: plugins/MachineSettingsAction/plugin.json +msgctxt "description" +msgid "Provides a way to change machine settings (such as build volume, nozzle size, etc.)." +msgstr "" + +#: plugins/MachineSettingsAction/plugin.json +msgctxt "name" +msgid "Machine Settings Action" +msgstr "" + +#: plugins/XmlMaterialProfile/plugin.json +msgctxt "description" +msgid "Provides capabilities to read and write XML-based material profiles." +msgstr "" + +#: plugins/XmlMaterialProfile/plugin.json +msgctxt "name" +msgid "Material Profiles" +msgstr "" + +#: plugins/UFPReader/plugin.json +msgctxt "description" +msgid "Provides support for reading Ultimaker Format Packages." +msgstr "" + +#: plugins/UFPReader/plugin.json +msgctxt "name" +msgid "UFP Reader" +msgstr "" + +#: plugins/CuraEngineBackend/plugin.json +msgctxt "description" +msgid "Provides the link to the CuraEngine slicing backend." +msgstr "" + +#: plugins/CuraEngineBackend/plugin.json +msgctxt "name" +msgid "CuraEngine Backend" +msgstr "" + +#: plugins/GCodeReader/plugin.json +msgctxt "description" +msgid "Allows loading and displaying G-code files." +msgstr "" + +#: plugins/GCodeReader/plugin.json +msgctxt "name" +msgid "G-code Reader" +msgstr "" + +#: plugins/CuraProfileWriter/plugin.json +msgctxt "description" +msgid "Provides support for exporting Cura profiles." +msgstr "" + +#: plugins/CuraProfileWriter/plugin.json +msgctxt "name" +msgid "Cura Profile Writer" +msgstr "" + +#: plugins/SimulationView/plugin.json +msgctxt "description" +msgid "Provides the preview of sliced layerdata." +msgstr "" + +#: plugins/SimulationView/plugin.json +msgctxt "name" +msgid "Simulation View" +msgstr "" + +#: plugins/UM3NetworkPrinting/plugin.json +msgctxt "description" +msgid "Manages network connections to UltiMaker networked printers." +msgstr "" + +#: plugins/UM3NetworkPrinting/plugin.json +msgctxt "name" +msgid "UltiMaker Network Connection" +msgstr "" + +#: plugins/XRayView/plugin.json +msgctxt "description" +msgid "Provides the X-Ray view." +msgstr "" + +#: plugins/XRayView/plugin.json +msgctxt "name" +msgid "X-Ray View" +msgstr "" + +#: plugins/UFPWriter/plugin.json +msgctxt "description" +msgid "Provides support for writing Ultimaker Format Packages." +msgstr "" + +#: plugins/UFPWriter/plugin.json +msgctxt "name" +msgid "UFP Writer" +msgstr "" + +#: plugins/GCodeWriter/plugin.json +msgctxt "description" +msgid "Writes g-code to a file." +msgstr "" + +#: plugins/GCodeWriter/plugin.json +msgctxt "name" +msgid "G-code Writer" +msgstr "" + +#: plugins/MonitorStage/plugin.json +msgctxt "description" +msgid "Provides a monitor stage in Cura." +msgstr "" + +#: plugins/MonitorStage/plugin.json +msgctxt "name" +msgid "Monitor Stage" +msgstr "" + +#: plugins/FirmwareUpdater/plugin.json +msgctxt "description" +msgid "Provides a machine actions for updating firmware." +msgstr "" + +#: plugins/FirmwareUpdater/plugin.json +msgctxt "name" +msgid "Firmware Updater" +msgstr "" + +#: plugins/SolidView/plugin.json +msgctxt "description" +msgid "Provides a normal solid mesh view." +msgstr "" + +#: plugins/SolidView/plugin.json +msgctxt "name" +msgid "Solid View" +msgstr "" + +#: plugins/SliceInfoPlugin/plugin.json +msgctxt "description" +msgid "Submits anonymous slice info. Can be disabled through preferences." +msgstr "" + +#: plugins/SliceInfoPlugin/plugin.json +msgctxt "name" +msgid "Slice info" +msgstr "" + +#: plugins/ImageReader/plugin.json +msgctxt "description" +msgid "Enables ability to generate printable geometry from 2D image files." +msgstr "" + +#: plugins/ImageReader/plugin.json +msgctxt "name" +msgid "Image Reader" +msgstr "" + +#: plugins/PostProcessingPlugin/plugin.json +msgctxt "description" +msgid "Extension that allows for user created scripts for post processing" +msgstr "" + +#: plugins/PostProcessingPlugin/plugin.json +msgctxt "name" +msgid "Post Processing" +msgstr "" + +#: plugins/AMFReader/plugin.json +msgctxt "description" +msgid "Provides support for reading AMF files." +msgstr "" + +#: plugins/AMFReader/plugin.json +msgctxt "name" +msgid "AMF Reader" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade53to54/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 5.3 to Cura 5.4." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade53to54/plugin.json +msgctxt "name" +msgid "Version Upgrade 5.3 to 5.4" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade460to462/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 4.6.0 to Cura 4.6.2." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade460to462/plugin.json +msgctxt "name" +msgid "Version Upgrade 4.6.0 to 4.6.2" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade47to48/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 4.7 to Cura 4.8." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade47to48/plugin.json +msgctxt "name" +msgid "Version Upgrade 4.7 to 4.8" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade42to43/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 4.2 to Cura 4.3." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade42to43/plugin.json +msgctxt "name" +msgid "Version Upgrade 4.2 to 4.3" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 3.2 to Cura 3.3." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json +msgctxt "name" +msgid "Version Upgrade 3.2 to 3.3" msgstr "" #: plugins/VersionUpgrade/VersionUpgrade35to40/plugin.json @@ -6304,136 +6664,6 @@ msgctxt "name" msgid "Version Upgrade 2.7 to 3.0" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade44to45/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.4 to Cura 4.5." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade44to45/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.4 to 4.5" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 3.0 to Cura 3.1." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json -msgctxt "name" -msgid "Version Upgrade 3.0 to 3.1" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 2.1 to Cura 2.2." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json -msgctxt "name" -msgid "Version Upgrade 2.1 to 2.2" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.13 to Cura 5.0." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.13 to 5.0" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade53to54/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 5.3 to Cura 5.4." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade53to54/plugin.json -msgctxt "name" -msgid "Version Upgrade 5.3 to 5.4" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 3.2 to Cura 3.3." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json -msgctxt "name" -msgid "Version Upgrade 3.2 to 3.3" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade40to41/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.0 to Cura 4.1." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade40to41/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.0 to 4.1" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade42to43/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.2 to Cura 4.3." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade42to43/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.2 to 4.3" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade47to48/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.7 to Cura 4.8." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade47to48/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.7 to 4.8" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 3.4 to Cura 3.5." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json -msgctxt "name" -msgid "Version Upgrade 3.4 to 3.5" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade48to49/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.8 to Cura 4.9." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade48to49/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.8 to 4.9" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade43to44/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.3 to Cura 4.4." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade43to44/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.3 to 4.4" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 2.5 to Cura 2.6." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json -msgctxt "name" -msgid "Version Upgrade 2.5 to 2.6" -msgstr "" - #: plugins/VersionUpgrade/VersionUpgrade462to47/plugin.json msgctxt "description" msgid "Upgrades configurations from Cura 4.6.2 to Cura 4.7." @@ -6444,34 +6674,14 @@ msgctxt "name" msgid "Version Upgrade 4.6.2 to 4.7" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json msgctxt "description" -msgid "Upgrades configurations from Cura 2.6 to Cura 2.7." +msgid "Upgrades configurations from Cura 2.2 to Cura 2.4." msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json msgctxt "name" -msgid "Version Upgrade 2.6 to 2.7" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade45to46/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.5 to Cura 4.6." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade45to46/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.5 to 4.6" -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 3.3 to Cura 3.4." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json -msgctxt "name" -msgid "Version Upgrade 3.3 to 3.4" +msgid "Version Upgrade 2.2 to 2.4" msgstr "" #: plugins/VersionUpgrade/VersionUpgrade52to53/plugin.json @@ -6484,16 +6694,6 @@ msgctxt "name" msgid "Version Upgrade 5.2 to 5.3" msgstr "" -#: plugins/VersionUpgrade/VersionUpgrade460to462/plugin.json -msgctxt "description" -msgid "Upgrades configurations from Cura 4.6.0 to Cura 4.6.2." -msgstr "" - -#: plugins/VersionUpgrade/VersionUpgrade460to462/plugin.json -msgctxt "name" -msgid "Version Upgrade 4.6.0 to 4.6.2" -msgstr "" - #: plugins/VersionUpgrade/VersionUpgrade49to410/plugin.json msgctxt "description" msgid "Upgrades configurations from Cura 4.9 to Cura 4.10." @@ -6504,114 +6704,144 @@ msgctxt "name" msgid "Version Upgrade 4.9 to 4.10" msgstr "" -#: plugins/CuraProfileWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade48to49/plugin.json msgctxt "description" -msgid "Provides support for exporting Cura profiles." +msgid "Upgrades configurations from Cura 4.8 to Cura 4.9." msgstr "" -#: plugins/CuraProfileWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade48to49/plugin.json msgctxt "name" -msgid "Cura Profile Writer" +msgid "Version Upgrade 4.8 to 4.9" msgstr "" -#: plugins/FirmwareUpdateChecker/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json msgctxt "description" -msgid "Checks for firmware updates." +msgid "Upgrades configurations from Cura 3.0 to Cura 3.1." msgstr "" -#: plugins/FirmwareUpdateChecker/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json msgctxt "name" -msgid "Firmware Update Checker" +msgid "Version Upgrade 3.0 to 3.1" msgstr "" -#: plugins/PostProcessingPlugin/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json msgctxt "description" -msgid "Extension that allows for user created scripts for post processing" +msgid "Upgrades configurations from Cura 3.4 to Cura 3.5." msgstr "" -#: plugins/PostProcessingPlugin/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json msgctxt "name" -msgid "Post Processing" +msgid "Version Upgrade 3.4 to 3.5" msgstr "" -#: plugins/USBPrinting/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade43to44/plugin.json msgctxt "description" -msgid "Accepts G-Code and sends them to a printer. Plugin can also update firmware." +msgid "Upgrades configurations from Cura 4.3 to Cura 4.4." msgstr "" -#: plugins/USBPrinting/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade43to44/plugin.json msgctxt "name" -msgid "USB printing" +msgid "Version Upgrade 4.3 to 4.4" msgstr "" -#: plugins/CuraDrive/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade41to42/plugin.json msgctxt "description" -msgid "Backup and restore your configuration." +msgid "Upgrades configurations from Cura 4.1 to Cura 4.2." msgstr "" -#: plugins/CuraDrive/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade41to42/plugin.json msgctxt "name" -msgid "Cura Backups" +msgid "Version Upgrade 4.1 to 4.2" msgstr "" -#: plugins/GCodeGzWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade44to45/plugin.json msgctxt "description" -msgid "Writes g-code to a compressed archive." +msgid "Upgrades configurations from Cura 4.4 to Cura 4.5." msgstr "" -#: plugins/GCodeGzWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade44to45/plugin.json msgctxt "name" -msgid "Compressed G-code Writer" +msgid "Version Upgrade 4.4 to 4.5" msgstr "" -#: plugins/GCodeWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json msgctxt "description" -msgid "Writes g-code to a file." +msgid "Upgrades configurations from Cura 3.3 to Cura 3.4." msgstr "" -#: plugins/GCodeWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json msgctxt "name" -msgid "G-code Writer" +msgid "Version Upgrade 3.3 to 3.4" msgstr "" -#: plugins/3MFWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade411to412/plugin.json msgctxt "description" -msgid "Provides support for writing 3MF files." +msgid "Upgrades configurations from Cura 4.11 to Cura 4.12." msgstr "" -#: plugins/3MFWriter/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade411to412/plugin.json msgctxt "name" -msgid "3MF Writer" +msgid "Version Upgrade 4.11 to 4.12" msgstr "" -#: plugins/ModelChecker/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json msgctxt "description" -msgid "Checks models and print configuration for possible printing issues and give suggestions." +msgid "Upgrades configurations from Cura 4.13 to Cura 5.0." msgstr "" -#: plugins/ModelChecker/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json msgctxt "name" -msgid "Model Checker" +msgid "Version Upgrade 4.13 to 5.0" msgstr "" -#: plugins/GCodeReader/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade45to46/plugin.json msgctxt "description" -msgid "Allows loading and displaying G-code files." +msgid "Upgrades configurations from Cura 4.5 to Cura 4.6." msgstr "" -#: plugins/GCodeReader/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade45to46/plugin.json msgctxt "name" -msgid "G-code Reader" +msgid "Version Upgrade 4.5 to 4.6" msgstr "" -#: plugins/GCodeGzReader/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json msgctxt "description" -msgid "Reads g-code from a compressed archive." +msgid "Upgrades configurations from Cura 2.1 to Cura 2.2." msgstr "" -#: plugins/GCodeGzReader/plugin.json +#: plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json msgctxt "name" -msgid "Compressed G-code Reader" +msgid "Version Upgrade 2.1 to 2.2" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade40to41/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 4.0 to Cura 4.1." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade40to41/plugin.json +msgctxt "name" +msgid "Version Upgrade 4.0 to 4.1" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 2.5 to Cura 2.6." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json +msgctxt "name" +msgid "Version Upgrade 2.5 to 2.6" +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +msgctxt "description" +msgid "Upgrades configurations from Cura 2.6 to Cura 2.7." +msgstr "" + +#: plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +msgctxt "name" +msgid "Version Upgrade 2.6 to 2.7" msgstr "" #: plugins/DigitalLibrary/plugin.json @@ -6624,234 +6854,34 @@ msgctxt "name" msgid "Ultimaker Digital Library" msgstr "" -#: plugins/SupportEraser/plugin.json +#: plugins/ModelChecker/plugin.json msgctxt "description" -msgid "Creates an eraser mesh to block the printing of support in certain places" +msgid "Checks models and print configuration for possible printing issues and give suggestions." msgstr "" -#: plugins/SupportEraser/plugin.json +#: plugins/ModelChecker/plugin.json msgctxt "name" -msgid "Support Eraser" +msgid "Model Checker" msgstr "" -#: plugins/RemovableDriveOutputDevice/plugin.json +#: plugins/USBPrinting/plugin.json msgctxt "description" -msgid "Provides removable drive hotplugging and writing support." +msgid "Accepts G-Code and sends them to a printer. Plugin can also update firmware." msgstr "" -#: plugins/RemovableDriveOutputDevice/plugin.json +#: plugins/USBPrinting/plugin.json msgctxt "name" -msgid "Removable Drive Output Device Plugin" +msgid "USB printing" msgstr "" -#: plugins/SolidView/plugin.json +#: plugins/GCodeGzWriter/plugin.json msgctxt "description" -msgid "Provides a normal solid mesh view." +msgid "Writes g-code to a compressed archive." msgstr "" -#: plugins/SolidView/plugin.json +#: plugins/GCodeGzWriter/plugin.json msgctxt "name" -msgid "Solid View" -msgstr "" - -#: plugins/SentryLogger/plugin.json -msgctxt "description" -msgid "Logs certain events so that they can be used by the crash reporter" -msgstr "" - -#: plugins/SentryLogger/plugin.json -msgctxt "name" -msgid "Sentry Logger" -msgstr "" - -#: plugins/PerObjectSettingsTool/plugin.json -msgctxt "description" -msgid "Provides the Per Model Settings." -msgstr "" - -#: plugins/PerObjectSettingsTool/plugin.json -msgctxt "name" -msgid "Per Model Settings Tool" -msgstr "" - -#: plugins/3MFReader/plugin.json -msgctxt "description" -msgid "Provides support for reading 3MF files." -msgstr "" - -#: plugins/3MFReader/plugin.json -msgctxt "name" -msgid "3MF Reader" -msgstr "" - -#: plugins/AMFReader/plugin.json -msgctxt "description" -msgid "Provides support for reading AMF files." -msgstr "" - -#: plugins/AMFReader/plugin.json -msgctxt "name" -msgid "AMF Reader" -msgstr "" - -#: plugins/X3DReader/plugin.json -msgctxt "description" -msgid "Provides support for reading X3D files." -msgstr "" - -#: plugins/X3DReader/plugin.json -msgctxt "name" -msgid "X3D Reader" -msgstr "" - -#: plugins/SimulationView/plugin.json -msgctxt "description" -msgid "Provides the preview of sliced layerdata." -msgstr "" - -#: plugins/SimulationView/plugin.json -msgctxt "name" -msgid "Simulation View" -msgstr "" - -#: plugins/TrimeshReader/plugin.json -msgctxt "description" -msgid "Provides support for reading model files." -msgstr "" - -#: plugins/TrimeshReader/plugin.json -msgctxt "name" -msgid "Trimesh Reader" -msgstr "" - -#: plugins/CuraEngineBackend/plugin.json -msgctxt "description" -msgid "Provides the link to the CuraEngine slicing backend." -msgstr "" - -#: plugins/CuraEngineBackend/plugin.json -msgctxt "name" -msgid "CuraEngine Backend" -msgstr "" - -#: plugins/ImageReader/plugin.json -msgctxt "description" -msgid "Enables ability to generate printable geometry from 2D image files." -msgstr "" - -#: plugins/ImageReader/plugin.json -msgctxt "name" -msgid "Image Reader" -msgstr "" - -#: plugins/GCodeProfileReader/plugin.json -msgctxt "description" -msgid "Provides support for importing profiles from g-code files." -msgstr "" - -#: plugins/GCodeProfileReader/plugin.json -msgctxt "name" -msgid "G-code Profile Reader" -msgstr "" - -#: plugins/XmlMaterialProfile/plugin.json -msgctxt "description" -msgid "Provides capabilities to read and write XML-based material profiles." -msgstr "" - -#: plugins/XmlMaterialProfile/plugin.json -msgctxt "name" -msgid "Material Profiles" -msgstr "" - -#: plugins/MonitorStage/plugin.json -msgctxt "description" -msgid "Provides a monitor stage in Cura." -msgstr "" - -#: plugins/MonitorStage/plugin.json -msgctxt "name" -msgid "Monitor Stage" -msgstr "" - -#: plugins/CuraProfileReader/plugin.json -msgctxt "description" -msgid "Provides support for importing Cura profiles." -msgstr "" - -#: plugins/CuraProfileReader/plugin.json -msgctxt "name" -msgid "Cura Profile Reader" -msgstr "" - -#: plugins/UM3NetworkPrinting/plugin.json -msgctxt "description" -msgid "Manages network connections to UltiMaker networked printers." -msgstr "" - -#: plugins/UM3NetworkPrinting/plugin.json -msgctxt "name" -msgid "UltiMaker Network Connection" -msgstr "" - -#: plugins/PrepareStage/plugin.json -msgctxt "description" -msgid "Provides a prepare stage in Cura." -msgstr "" - -#: plugins/PrepareStage/plugin.json -msgctxt "name" -msgid "Prepare Stage" -msgstr "" - -#: plugins/UFPWriter/plugin.json -msgctxt "description" -msgid "Provides support for writing Ultimaker Format Packages." -msgstr "" - -#: plugins/UFPWriter/plugin.json -msgctxt "name" -msgid "UFP Writer" -msgstr "" - -#: plugins/UltimakerMachineActions/plugin.json -msgctxt "description" -msgid "Provides machine actions for Ultimaker machines (such as bed leveling wizard, selecting upgrades, etc.)." -msgstr "" - -#: plugins/UltimakerMachineActions/plugin.json -msgctxt "name" -msgid "UltiMaker machine actions" -msgstr "" - -#: plugins/UFPReader/plugin.json -msgctxt "description" -msgid "Provides support for reading Ultimaker Format Packages." -msgstr "" - -#: plugins/UFPReader/plugin.json -msgctxt "name" -msgid "UFP Reader" -msgstr "" - -#: plugins/XRayView/plugin.json -msgctxt "description" -msgid "Provides the X-Ray view." -msgstr "" - -#: plugins/XRayView/plugin.json -msgctxt "name" -msgid "X-Ray View" -msgstr "" - -#: plugins/MachineSettingsAction/plugin.json -msgctxt "description" -msgid "Provides a way to change machine settings (such as build volume, nozzle size, etc.)." -msgstr "" - -#: plugins/MachineSettingsAction/plugin.json -msgctxt "name" -msgid "Machine Settings Action" +msgid "Compressed G-code Writer" msgstr "" #: plugins/PreviewStage/plugin.json @@ -6864,33 +6894,3 @@ msgctxt "name" msgid "Preview Stage" msgstr "" -#: plugins/SliceInfoPlugin/plugin.json -msgctxt "description" -msgid "Submits anonymous slice info. Can be disabled through preferences." -msgstr "" - -#: plugins/SliceInfoPlugin/plugin.json -msgctxt "name" -msgid "Slice info" -msgstr "" - -#: plugins/Marketplace/plugin.json -msgctxt "description" -msgid "Manages extensions to the application and allows browsing extensions from the UltiMaker website." -msgstr "" - -#: plugins/Marketplace/plugin.json -msgctxt "name" -msgid "Marketplace" -msgstr "" - -#: plugins/FirmwareUpdater/plugin.json -msgctxt "description" -msgid "Provides a machine actions for updating firmware." -msgstr "" - -#: plugins/FirmwareUpdater/plugin.json -msgctxt "name" -msgid "Firmware Updater" -msgstr "" - diff --git a/resources/i18n/de_DE/cura.po b/resources/i18n/de_DE/cura.po index 32d5befcda..1b7d46e588 100644 --- a/resources/i18n/de_DE/cura.po +++ b/resources/i18n/de_DE/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3675,17 +3675,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Drucker entfernen" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Drucken über Netzwerk" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Drücken über Netzwerk" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Über Netzwerk verbunden" diff --git a/resources/i18n/es_ES/cura.po b/resources/i18n/es_ES/cura.po index 991ce49f1e..fee311f94b 100644 --- a/resources/i18n/es_ES/cura.po +++ b/resources/i18n/es_ES/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3675,17 +3675,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Eliminar impresoras" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Imprimir a través de la red" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Imprime a través de la red" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Conectado a través de la red" diff --git a/resources/i18n/fi_FI/cura.po b/resources/i18n/fi_FI/cura.po index f2b4e4cbcb..3a09d9e326 100644 --- a/resources/i18n/fi_FI/cura.po +++ b/resources/i18n/fi_FI/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2022-07-15 10:53+0200\n" "Last-Translator: Bothof \n" "Language-Team: Finnish\n" @@ -3650,17 +3650,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Tulosta verkon kautta" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Tulosta verkon kautta" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "" diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index ea1d51cd5a..89d3733c7e 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3678,17 +3678,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Supprimer des imprimantes" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Imprimer sur le réseau" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Imprimer sur le réseau" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Connecté sur le réseau" diff --git a/resources/i18n/hu_HU/cura.po b/resources/i18n/hu_HU/cura.po index 9ea5ca5aea..5f85de5fd3 100644 --- a/resources/i18n/hu_HU/cura.po +++ b/resources/i18n/hu_HU/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2020-03-24 09:36+0100\n" "Last-Translator: Nagy Attila \n" "Language-Team: ATI-SZOFT\n" @@ -3666,17 +3666,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Hálózati nyomtatás" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Hálózati nyomtatás" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Csatlakozva hálózaton keresztül" diff --git a/resources/i18n/it_IT/cura.po b/resources/i18n/it_IT/cura.po index ea4fc72cff..4698a61486 100644 --- a/resources/i18n/it_IT/cura.po +++ b/resources/i18n/it_IT/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3678,17 +3678,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Rimuovere le stampanti" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Stampa sulla rete" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Stampa sulla rete" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Collegato alla rete" diff --git a/resources/i18n/ja_JP/cura.po b/resources/i18n/ja_JP/cura.po index 3a896394a5..cc6c2cf533 100644 --- a/resources/i18n/ja_JP/cura.po +++ b/resources/i18n/ja_JP/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3666,17 +3666,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "プリンターを取り除く" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "ネットワーク上のプリント" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "ネットワークのプリント" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "ネットワーク上で接続" diff --git a/resources/i18n/ko_KR/cura.po b/resources/i18n/ko_KR/cura.po index f7a5f47e0a..4824fbaba7 100644 --- a/resources/i18n/ko_KR/cura.po +++ b/resources/i18n/ko_KR/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3665,17 +3665,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "프린터 제거" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "네트워크를 통해 프린팅" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "네트워크를 통해 프린팅" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "네트워크를 통해 연결됨" diff --git a/resources/i18n/nl_NL/cura.po b/resources/i18n/nl_NL/cura.po index 6c903dd42c..2f761770d7 100644 --- a/resources/i18n/nl_NL/cura.po +++ b/resources/i18n/nl_NL/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3678,17 +3678,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Printers verwijderen" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Printen via netwerk" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Printen via netwerk" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Via het netwerk verbonden" diff --git a/resources/i18n/pl_PL/cura.po b/resources/i18n/pl_PL/cura.po index 6bdef88ffd..93bb91c081 100644 --- a/resources/i18n/pl_PL/cura.po +++ b/resources/i18n/pl_PL/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2021-09-07 08:02+0200\n" "Last-Translator: Mariusz Matłosz \n" "Language-Team: Mariusz Matłosz , reprapy.pl\n" @@ -3667,17 +3667,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Drukuj przez sieć" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Drukuj przez sieć" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Połączone przez sieć" diff --git a/resources/i18n/pt_BR/cura.po b/resources/i18n/pt_BR/cura.po index 4242a852d5..2ceb4fa495 100644 --- a/resources/i18n/pt_BR/cura.po +++ b/resources/i18n/pt_BR/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2023-02-17 17:37+0100\n" "Last-Translator: Cláudio Sampaio \n" "Language-Team: Cláudio Sampaio \n" @@ -3678,17 +3678,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Remover impressoras" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Imprimir pela rede" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Imprime pela rede" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Conectado pela rede" diff --git a/resources/i18n/pt_PT/cura.po b/resources/i18n/pt_PT/cura.po index 21eace1a53..336fdcb0c2 100644 --- a/resources/i18n/pt_PT/cura.po +++ b/resources/i18n/pt_PT/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3676,17 +3676,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Remover impressoras" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Imprimir através da rede" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Imprimir através da rede" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Ligado através da rede" diff --git a/resources/i18n/ru_RU/cura.po b/resources/i18n/ru_RU/cura.po index a43df3e590..22c2b8562e 100644 --- a/resources/i18n/ru_RU/cura.po +++ b/resources/i18n/ru_RU/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3687,17 +3687,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Удалить принтеры" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Печать через сеть" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Печать через сеть" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Подключен по сети" diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index 7731155049..b7d1d49625 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3678,17 +3678,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "Yazıcıları kaldır" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "Ağ üzerinden yazdır" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "Ağ üzerinden yazdır" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "Ağ üzerinden bağlandı" diff --git a/resources/i18n/zh_CN/cura.po b/resources/i18n/zh_CN/cura.po index 5d63f8552b..252bdd90a4 100644 --- a/resources/i18n/zh_CN/cura.po +++ b/resources/i18n/zh_CN/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2022-07-15 11:06+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -3667,17 +3667,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "删除打印机" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "通过网络打印" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "通过网络打印" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "已通过网络连接" diff --git a/resources/i18n/zh_TW/cura.po b/resources/i18n/zh_TW/cura.po index 0a4522c657..0c2b88b04b 100644 --- a/resources/i18n/zh_TW/cura.po +++ b/resources/i18n/zh_TW/cura.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Cura 5.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-27 12:22+0000\n" +"POT-Creation-Date: 2023-05-19 09:22+0000\n" "PO-Revision-Date: 2022-01-02 19:59+0800\n" "Last-Translator: Valen Chang \n" "Language-Team: Valen Chang \n" @@ -3668,17 +3668,17 @@ msgctxt "@action:button" msgid "Remove printers" msgstr "移除印表機" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:62 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 msgctxt "@action:button Preceded by 'Ready to'." msgid "Print over network" msgstr "網路連線列印" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:63 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 msgctxt "@properties:tooltip" msgid "Print over network" msgstr "網路連線列印" -#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:64 +#: plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py:65 msgctxt "@info:status" msgid "Connected over the network" msgstr "透過網路連接" From cccfebcc8edfc370a593885d2e67aa5f8fc078fc Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 19 May 2023 13:33:05 +0200 Subject: [PATCH 005/118] Allow Cura front-end to set plugins (port & address) This can currently be done by setting the environment variables: - SIMPLIFY_ENABLE: default disabled, setting this to any value will enable the plugin - SIMPLIFY_ADDRESS: defaults to localhost - SIMPLIFY_PORT: defaults to 33700 - POSTPROCESS_ENABLE: default disabled, setting this to any value will enable the plugin - POSTPROCESS_ADDRESS: defaults to localhost - POSTPROCESS_PORT: defaults to 33701 Hacky for now Contributes to CURA-10475 --- plugins/CuraEngineBackend/Cura.proto | 13 +++++++++++++ plugins/CuraEngineBackend/StartSliceJob.py | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index b420a6ecc2..4953531a64 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -8,12 +8,25 @@ message ObjectList repeated Setting settings = 2; // meshgroup settings (for one-at-a-time printing) } +enum SlotID { + SIMPLIFY = 0; + POSTPROCESS = 1; +} + +message EnginePlugin +{ + SlotID id = 1; + optional string address = 2; + optional uint32 port = 3; +} + message Slice { repeated ObjectList object_lists = 1; // The meshgroups to be printed one after another SettingList global_settings = 2; // The global settings used for the whole print job repeated Extruder extruders = 3; // The settings sent to each extruder object repeated SettingExtruder limit_to_extruder = 4; // From which stack the setting would inherit if not defined per object + repeated EnginePlugin engine_plugins = 5; } message Extruder diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index d06136a2b4..4f320a3a79 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -1,5 +1,6 @@ # Copyright (c) 2021-2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +import os import numpy from string import Formatter @@ -301,6 +302,22 @@ class StartSliceJob(Job): for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) + # EnginePlugins + # TODO: don't hardcode them + # Ports: are chosen based on https://stackoverflow.com/questions/10476987/best-tcp-port-number-range-for-internal-applications + + plugins = { + 0: {"address": os.environ.get("SIMPLIFY_ADDRESS", "localhost"), "port": os.environ.get("SIMPLIFY_PORT", 33700)} if os.environ.get("SIMPLIFY_ENABLE") is not None else None, + 1: {"address": os.environ.get("POSTPROCESS_ADDRESS", "localhost"), "port": os.environ.get("POSTPROCESS_PORT", 33701)} if os.environ.get("POSTPROCESS_ENABLE") is not None else None, + } + + for plugin, connection in plugins.items(): + plugin_message = self._slice_message.addRepeatedMessage("engine_plugins") + plugin_message.id = plugin + if connection: + plugin_message.address = connection["address"] + plugin_message.port = connection["port"] + for group in filtered_object_groups: group_message = self._slice_message.addRepeatedMessage("object_lists") parent = group[0].getParent() From 26bf00ccc05f9c54ddd24f5fc952299a450c948f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Jul 2023 13:25:29 +0200 Subject: [PATCH 006/118] Add backend_plugin messages to proto file CURA-10717 --- plugins/CuraEngineBackend/Cura.proto | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index b420a6ecc2..ef12ab6d6f 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -8,12 +8,26 @@ message ObjectList repeated Setting settings = 2; // meshgroup settings (for one-at-a-time printing) } +enum SlotID { + SIMPLIFY = 0; + POSTPROCESS = 1; +} + +message EnginePlugin +{ + SlotID id = 1; + optional string address = 2; + optional uint32 port = 3; +} + message Slice { repeated ObjectList object_lists = 1; // The meshgroups to be printed one after another SettingList global_settings = 2; // The global settings used for the whole print job repeated Extruder extruders = 3; // The settings sent to each extruder object repeated SettingExtruder limit_to_extruder = 4; // From which stack the setting would inherit if not defined per object + + repeated EnginePlugin engine_plugins = 5; } message Extruder From f3bc7bf28a60ce7555e59d633983e55233fdc141 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 11:24:28 +0200 Subject: [PATCH 007/118] Move backend plugin logic to Cura from Uranium I was running into abstraction issues when it was defined in Uranium. Instead of trying to fight those, it's just easier to move it to Cura CURA-10717 --- cura/BackendPlugin.py | 74 +++++++++++++++++++ cura/CuraApplication.py | 9 +++ .../CuraEngineBackend/CuraEngineBackend.py | 16 +++- 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 cura/BackendPlugin.py diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py new file mode 100644 index 0000000000..6493f20487 --- /dev/null +++ b/cura/BackendPlugin.py @@ -0,0 +1,74 @@ +# Copyright (c) 2023 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. +import subprocess +from typing import Optional, List + +from UM.Logger import Logger +from UM.PluginObject import PluginObject + + +class BackendPlugin(PluginObject): + def __init__(self) -> None: + super().__init__() + self.__port: int = 0 + self._plugin_address: str = "127.0.0.1" + self._plugin_command: Optional[List[str]] = None + self._process = None + self._is_running = False + + def isRunning(self): + return self._is_running + + def setPort(self, port: int) -> None: + self.__port = port + + def getPort(self) -> int: + return self.__port + + def _validatePluginCommand(self) -> list[str]: + """ + Validate the plugin command and add the port parameter if it is missing. + + :return: A list of strings containing the validated plugin command. + """ + if not self._plugin_command or "--port" in self._plugin_command: + return self._plugin_command or [] + + return self._plugin_command + ["--port", str(self.__port)] + + def start(self) -> bool: + """ + Starts the backend_plugin process. + + :return: True if the plugin process started successfully, False otherwise. + """ + try: + # STDIN needs to be None because we provide no input, but communicate via a local socket instead. + # The NUL device sometimes doesn't exist on some computers. + self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None) + self._is_running = True + return True + except PermissionError: + Logger.log("e", f"Couldn't start backend_plugin [{self._plugin_id}]: No permission to execute process.") + except FileNotFoundError: + Logger.logException("e", f"Unable to find backend_plugin executable [{self._plugin_id}]") + except BlockingIOError: + Logger.logException("e", f"Couldn't start backend_plugin [{self._plugin_id}]: Resource is temporarily unavailable") + except OSError as e: + Logger.logException("e", f"Couldn't start backend_plugin [{self._plugin_id}]: Operating system is blocking it (antivirus?)") + return False + + def stop(self) -> bool: + if not self._process: + self._is_running = False + return True # Nothing to stop + + try: + self._process.terminate() + return_code = self._process.wait() + self._is_running = False + Logger.log("d", f"Backend_plugin [{self._plugin_id}] was killed. Received return code {return_code}") + return True + except PermissionError: + Logger.log("e", "Unable to kill running engine. Access is denied.") + return False diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6b04503ebc..c96de7e50a 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -205,6 +205,8 @@ class CuraApplication(QtApplication): self._cura_scene_controller = None self._machine_error_checker = None + self._backend_plugins: List[BackendPlugin] = [] + self._machine_settings_manager = MachineSettingsManager(self, parent = self) self._material_management_model = None self._quality_management_model = None @@ -792,6 +794,7 @@ class CuraApplication(QtApplication): self._plugin_registry.addType("profile_reader", self._addProfileReader) self._plugin_registry.addType("profile_writer", self._addProfileWriter) + self._plugin_registry.addType("backend_plugin", self._addBackendPlugin) if Platform.isLinux(): lib_suffixes = {"", "64", "32", "x32"} # A few common ones on different distributions. @@ -1730,6 +1733,12 @@ class CuraApplication(QtApplication): def _addProfileWriter(self, profile_writer): pass + def _addBackendPlugin(self, backend_plugin: "BackendPlugin") -> None: + self._backend_plugins.append(backend_plugin) + + def getBackendPlugins(self) -> List["BackendPlugin"]: + return self._backend_plugins + @pyqtSlot("QSize") def setMinimumWindowSize(self, size): main_window = self.getMainWindow() diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index f5d701f6f7..e53d29d9b9 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -70,7 +70,7 @@ class CuraEngineBackend(QObject, Backend): os.path.join(CuraApplication.getInstallPrefix(), "bin"), os.path.dirname(os.path.abspath(sys.executable)), ] - + self._last_backend_plugin_port = self._port + 1000 for path in search_path: engine_path = os.path.join(path, executable_name) if os.path.isfile(engine_path): @@ -176,6 +176,20 @@ class CuraEngineBackend(QObject, Backend): application.initializationFinished.connect(self.initialize) + def startPlugins(self) -> None: + """ + Ensure that all backend plugins are started + :return: + """ + backend_plugins = CuraApplication.getInstance().getBackendPlugins() + for backend_plugin in backend_plugins: + if backend_plugin.isRunning(): + continue + # Set the port to prevent plugins from using the same one. + backend_plugin.setPort(self._last_backend_plugin_port) + self.__last_backend_plugin_port += 1 + backend_plugin.start() + def _resetLastSliceTimeStats(self) -> None: self._time_start_process = None self._time_send_message = None From 5d74f2d2507fd1ee07d3a8a039f7cd098ad86956 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 11:30:49 +0200 Subject: [PATCH 008/118] Convert typing in CuraEngineBackend to modern style Boyscouting CURA-10717 --- .../CuraEngineBackend/CuraEngineBackend.py | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index e53d29d9b9..903617d076 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -86,9 +86,9 @@ class CuraEngineBackend(QObject, Backend): self._default_engine_location = execpath break - application = CuraApplication.getInstance() #type: CuraApplication - self._multi_build_plate_model = None #type: Optional[MultiBuildPlateModel] - self._machine_error_checker = None #type: Optional[MachineErrorChecker] + application: CuraApplication = CuraApplication.getInstance() + self._multi_build_plate_model: Optional[MultiBuildPlateModel] = None + self._machine_error_checker: Optional[MachineErrorChecker] = None if not self._default_engine_location: raise EnvironmentError("Could not find CuraEngine") @@ -99,13 +99,15 @@ class CuraEngineBackend(QObject, Backend): application.getPreferences().addPreference("backend/location", self._default_engine_location) # Workaround to disable layer view processing if layer view is not active. - self._layer_view_active = False #type: bool + self._layer_view_active: bool = False self._onActiveViewChanged() - self._stored_layer_data = [] # type: List[Arcus.PythonMessage] - self._stored_optimized_layer_data = {} # type: Dict[int, List[Arcus.PythonMessage]] # key is build plate number, then arrays are stored until they go to the ProcessSlicesLayersJob + self._stored_layer_data: List[Arcus.PythonMessage] = [] - self._scene = application.getController().getScene() #type: Scene + # key is build plate number, then arrays are stored until they go to the ProcessSlicesLayersJob + self._stored_optimized_layer_data: Dict[int, List[Arcus.PythonMessage]] = {} + + self._scene: Scene = application.getController().getScene() self._scene.sceneChanged.connect(self._onSceneChanged) # Triggers for auto-slicing. Auto-slicing is triggered as follows: @@ -116,7 +118,7 @@ class CuraEngineBackend(QObject, Backend): # If there is an error check, stop the auto-slicing timer, and only wait for the error check to be finished # to start the auto-slicing timer again. # - self._global_container_stack = None #type: Optional[ContainerStack] + self._global_container_stack: Optional[ContainerStack] = None # Listeners for receiving messages from the back-end. self._message_handlers["cura.proto.Layer"] = self._onLayerMessage @@ -128,31 +130,32 @@ class CuraEngineBackend(QObject, Backend): self._message_handlers["cura.proto.PrintTimeMaterialEstimates"] = self._onPrintTimeMaterialEstimates self._message_handlers["cura.proto.SlicingFinished"] = self._onSlicingFinishedMessage - self._start_slice_job = None #type: Optional[StartSliceJob] - self._start_slice_job_build_plate = None #type: Optional[int] - self._slicing = False #type: bool # Are we currently slicing? - self._restart = False #type: bool # Back-end is currently restarting? - self._tool_active = False #type: bool # If a tool is active, some tasks do not have to do anything - self._always_restart = True #type: bool # Always restart the engine when starting a new slice. Don't keep the process running. TODO: Fix engine statelessness. - self._process_layers_job = None #type: Optional[ProcessSlicedLayersJob] # The currently active job to process layers, or None if it is not processing layers. - self._build_plates_to_be_sliced = [] #type: List[int] # what needs slicing? - self._engine_is_fresh = True #type: bool # Is the newly started engine used before or not? + self._start_slice_job: Optional[StartSliceJob] = None + self._start_slice_job_build_plate: Optional[int] = None + self._slicing: bool = False # Are we currently slicing? + self._restart: bool = False # Back-end is currently restarting? + self._tool_active: bool = False # If a tool is active, some tasks do not have to do anything + self._always_restart: bool = True # Always restart the engine when starting a new slice. Don't keep the process running. TODO: Fix engine statelessness. + self._process_layers_job: Optional[ProcessSlicedLayersJob] = None # The currently active job to process layers, or None if it is not processing layers. + self._build_plates_to_be_sliced: List[int] = [] # what needs slicing? + self._engine_is_fresh: bool = True # Is the newly started engine used before or not? - self._backend_log_max_lines = 20000 #type: int # Maximum number of lines to buffer - self._error_message = None #type: Optional[Message] # Pop-up message that shows errors. - self._last_num_objects = defaultdict(int) #type: Dict[int, int] # Count number of objects to see if there is something changed - self._postponed_scene_change_sources = [] #type: List[SceneNode] # scene change is postponed (by a tool) + self._backend_log_max_lines: int = 20000 # Maximum number of lines to buffer + self._error_message: Optional[Message] = None # Pop-up message that shows errors. + self._last_num_objects: Dict[int, int] = defaultdict(int) # Count number of objects to see if there is something changed + self._postponed_scene_change_sources: List[SceneNode] = [] # scene change is postponed (by a tool) - self._time_start_process = None #type: Optional[float] - self._is_disabled = False #type: bool + self._time_start_process: Optional[float] = None + self._is_disabled: bool = False application.getPreferences().addPreference("general/auto_slice", False) - self._use_timer = False #type: bool + self._use_timer: bool = False + # When you update a setting and other settings get changed through inheritance, many propertyChanged signals are fired. # This timer will group them up, and only slice for the last setting changed signal. # TODO: Properly group propertyChanged signals by whether they are triggered by the same user interaction. - self._change_timer = QTimer() #type: QTimer + self._change_timer: QTimer = QTimer() self._change_timer.setSingleShot(True) self._change_timer.setInterval(500) self.determineAutoSlicing() @@ -172,7 +175,7 @@ class CuraEngineBackend(QObject, Backend): self._slicing_error_message.actionTriggered.connect(self._reportBackendError) self._resetLastSliceTimeStats() - self._snapshot = None #type: Optional[QImage] + self._snapshot: Optional[QImage] = None application.initializationFinished.connect(self.initialize) @@ -443,14 +446,14 @@ class CuraEngineBackend(QObject, Backend): Logger.log("w", "Global container stack not assigned to CuraEngineBackend!") return extruders = ExtruderManager.getInstance().getActiveExtruderStacks() - error_keys = [] #type: List[str] + error_keys: List[str] = [] for extruder in extruders: error_keys.extend(extruder.getErrorKeys()) if not extruders: error_keys = self._global_container_stack.getErrorKeys() error_labels = set() for key in error_keys: - for stack in [self._global_container_stack] + extruders: #Search all container stacks for the definition of this setting. Some are only in an extruder stack. + for stack in [self._global_container_stack] + extruders: #Search all container stacks for the definition of this setting. Some are only in an extruder stack. definitions = cast(DefinitionContainerInterface, stack.getBottom()).findDefinitions(key = key) if definitions: break #Found it! No need to continue search. @@ -580,7 +583,7 @@ class CuraEngineBackend(QObject, Backend): def _numObjectsPerBuildPlate(self) -> Dict[int, int]: """Return a dict with number of objects per build plate""" - num_objects = defaultdict(int) #type: Dict[int, int] + num_objects: Dict[int, int] = defaultdict(int) for node in DepthFirstIterator(self._scene.getRoot()): # Only count sliceable objects if node.callDecoration("isSliceable"): From 19a4e0d2f834d22037080d688806aaa4ad69ae90 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 11:37:31 +0200 Subject: [PATCH 009/118] Fix bunch of comments violating max line length Boyscouting CURA-10717 --- .../CuraEngineBackend/CuraEngineBackend.py | 76 +++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 903617d076..544780a03c 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -142,7 +142,9 @@ class CuraEngineBackend(QObject, Backend): self._backend_log_max_lines: int = 20000 # Maximum number of lines to buffer self._error_message: Optional[Message] = None # Pop-up message that shows errors. - self._last_num_objects: Dict[int, int] = defaultdict(int) # Count number of objects to see if there is something changed + + # Count number of objects to see if there is something changed + self._last_num_objects: Dict[int, int] = defaultdict(int) self._postponed_scene_change_sources: List[SceneNode] = [] # scene change is postponed (by a tool) self._time_start_process: Optional[float] = None @@ -152,8 +154,8 @@ class CuraEngineBackend(QObject, Backend): self._use_timer: bool = False - # When you update a setting and other settings get changed through inheritance, many propertyChanged signals are fired. - # This timer will group them up, and only slice for the last setting changed signal. + # When you update a setting and other settings get changed through inheritance, many propertyChanged + # signals are fired. This timer will group them up, and only slice for the last setting changed signal. # TODO: Properly group propertyChanged signals by whether they are triggered by the same user interaction. self._change_timer: QTimer = QTimer() self._change_timer.setSingleShot(True) @@ -219,7 +221,8 @@ class CuraEngineBackend(QObject, Backend): application.getMachineManager().globalContainerChanged.connect(self._onGlobalStackChanged) self._onGlobalStackChanged() - # extruder enable / disable. Actually wanted to use machine manager here, but the initialization order causes it to crash + # Extruder enable / disable. Actually wanted to use machine manager here, + # but the initialization order causes it to crash ExtruderManager.getInstance().extrudersChanged.connect(self._extruderChanged) self.backendQuit.connect(self._onBackendQuit) @@ -256,7 +259,8 @@ class CuraEngineBackend(QObject, Backend): command += ["connect", "127.0.0.1:{0}".format(self._port), ""] parser = argparse.ArgumentParser(prog = "cura", add_help = False) - parser.add_argument("--debug", action = "store_true", default = False, help = "Turn on the debug mode by setting this option.") + parser.add_argument("--debug", action = "store_true", default = False, + help = "Turn on the debug mode by setting this option.") known_args = vars(parser.parse_known_args()[0]) if known_args["debug"]: command.append("-vvv") @@ -283,7 +287,8 @@ class CuraEngineBackend(QObject, Backend): self._terminate() self._createSocket() - if self._process_layers_job is not None: # We were processing layers. Stop that, the layers are going to change soon. + if self._process_layers_job is not None: + # We were processing layers. Stop that, the layers are going to change soon. Logger.log("i", "Aborting process layers job...") self._process_layers_job.abort() self._process_layers_job = None @@ -298,7 +303,7 @@ class CuraEngineBackend(QObject, Backend): self.markSliceAll() self.slice() - @call_on_qt_thread # must be called from the main thread because of OpenGL + @call_on_qt_thread # Must be called from the main thread because of OpenGL def _createSnapshot(self) -> None: self._snapshot = None if not CuraApplication.getInstance().isVisible: @@ -307,7 +312,7 @@ class CuraEngineBackend(QObject, Backend): Logger.log("i", "Creating thumbnail image (just before slice)...") try: self._snapshot = Snapshot.snapshot(width = 300, height = 300) - except: + except Exception: Logger.logException("w", "Failed to create snapshot image") self._snapshot = None # Failing to create thumbnail should not fail creation of UFP @@ -332,7 +337,8 @@ class CuraEngineBackend(QObject, Backend): return if not hasattr(self._scene, "gcode_dict"): - self._scene.gcode_dict = {} #type: ignore #Because we are creating the missing attribute here. + self._scene.gcode_dict = {} # type: ignore + # We need to ignore type because we are creating the missing attribute here. # see if we really have to slice application = CuraApplication.getInstance() @@ -343,9 +349,9 @@ class CuraEngineBackend(QObject, Backend): self._stored_layer_data = [] - if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0: - self._scene.gcode_dict[build_plate_to_be_sliced] = [] #type: ignore #Because we created this attribute above. + self._scene.gcode_dict[build_plate_to_be_sliced] = [] # type: ignore + # We need to ignore the type because we created this attribute above. Logger.log("d", "Build plate %s has no objects to be sliced, skipping", build_plate_to_be_sliced) if self._build_plates_to_be_sliced: self.slice() @@ -354,7 +360,7 @@ class CuraEngineBackend(QObject, Backend): if application.getPrintInformation() and build_plate_to_be_sliced == active_build_plate: application.getPrintInformation().setToZeroPrintInformation(build_plate_to_be_sliced) - if self._process is None: # type: ignore + if self._process is None: # type: ignore self._createSocket() self.stopSlicing() self._engine_is_fresh = False # Yes we're going to use the engine @@ -362,7 +368,7 @@ class CuraEngineBackend(QObject, Backend): self.processingProgress.emit(0.0) self.backendStateChange.emit(BackendState.NotStarted) - self._scene.gcode_dict[build_plate_to_be_sliced] = [] #type: ignore #[] indexed by build plate number + self._scene.gcode_dict[build_plate_to_be_sliced] = [] # type: ignore #[] indexed by build plate number self._slicing = True self.slicingStarted.emit() @@ -394,14 +400,15 @@ class CuraEngineBackend(QObject, Backend): if CuraApplication.getInstance().getUseExternalBackend(): return - if self._process is not None: # type: ignore + if self._process is not None: # type: ignore Logger.log("d", "Killing engine process") try: - self._process.terminate() # type: ignore - Logger.log("d", "Engine process is killed. Received return code %s", self._process.wait()) # type: ignore - self._process = None # type: ignore + self._process.terminate() # type: ignore + Logger.log("d", "Engine process is killed. Received return code %s", self._process.wait()) # type: ignore + self._process = None # type: ignore - except Exception as e: # terminating a process that is already terminating causes an exception, silently ignore this. + except Exception as e: + # Terminating a process that is already terminating causes an exception, silently ignore this. Logger.log("d", "Exception occurred while trying to kill the engine %s", str(e)) def _onStartSliceCompleted(self, job: StartSliceJob) -> None: @@ -541,7 +548,7 @@ class CuraEngineBackend(QObject, Backend): # Preparation completed, send it to the backend. self._socket.sendMessage(job.getSliceMessage()) - # Notify the user that it's now up to the backend to do it's job + # Notify the user that it's now up to the backend to do its job self.setState(BackendState.Processing) # Handle time reporting. @@ -568,7 +575,8 @@ class CuraEngineBackend(QObject, Backend): self._is_disabled = True gcode_list = node.callDecoration("getGCodeList") if gcode_list is not None: - self._scene.gcode_dict[node.callDecoration("getBuildPlateNumber")] = gcode_list #type: ignore #Because we generate this attribute dynamically. + self._scene.gcode_dict[node.callDecoration("getBuildPlateNumber")] = gcode_list # type: ignore + # We need to ignore type because we generate this attribute dynamically. if self._use_timer == enable_timer: return self._use_timer @@ -663,11 +671,13 @@ class CuraEngineBackend(QObject, Backend): self._terminate() self._createSocket() - if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, Arcus.ErrorCode.ConnectionResetError, Arcus.ErrorCode.Debug]: + if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, + Arcus.ErrorCode.ConnectionResetError, + Arcus.ErrorCode.Debug]: Logger.log("w", "A socket error caused the connection to be reset") # _terminate()' function sets the job status to 'cancel', after reconnecting to another Port the job status - # needs to be updated. Otherwise backendState is "Unable To Slice" + # needs to be updated. Otherwise, backendState is "Unable To Slice" if error.getErrorCode() == Arcus.ErrorCode.BindFailedError and self._start_slice_job is not None: self._start_slice_job.setIsCancelled(False) @@ -689,7 +699,7 @@ class CuraEngineBackend(QObject, Backend): for node in DepthFirstIterator(self._scene.getRoot()): if node.callDecoration("getLayerData"): if not build_plate_numbers or node.callDecoration("getBuildPlateNumber") in build_plate_numbers: - # We can assume that all nodes have a parent as we're looping through the scene (and filter out root) + # We can assume that all nodes have a parent as we're looping through the scene and filter out root cast(SceneNode, node.getParent()).removeChild(node) def markSliceAll(self) -> None: @@ -718,7 +728,7 @@ class CuraEngineBackend(QObject, Backend): :param instance: The setting instance that has changed. :param property: The property of the setting instance that has changed. """ - if property == "value": # Only reslice if the value has changed. + if property == "value": # Only re-slice if the value has changed. self.needsSlicing() self._onChanged() @@ -787,8 +797,10 @@ class CuraEngineBackend(QObject, Backend): self._time_end_slice = time() try: - gcode_list = self._scene.gcode_dict[self._start_slice_job_build_plate] #type: ignore #Because we generate this attribute dynamically. - except KeyError: # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. + gcode_list = self._scene.gcode_dict[self._start_slice_job_build_plate] #type: ignore + # We need to ignore the type because it was generated dynamically. + except KeyError: + # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. gcode_list = [] application = CuraApplication.getInstance() for index, line in enumerate(gcode_list): @@ -833,7 +845,8 @@ class CuraEngineBackend(QObject, Backend): try: self._scene.gcode_dict[self._start_slice_job_build_plate].append(message.data.decode("utf-8", "replace")) #type: ignore #Because we generate this attribute dynamically. - except KeyError: # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. + except KeyError: + # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. pass # Throw the message away. def _onGCodePrefixMessage(self, message: Arcus.PythonMessage) -> None: @@ -845,7 +858,8 @@ class CuraEngineBackend(QObject, Backend): try: self._scene.gcode_dict[self._start_slice_job_build_plate].insert(0, message.data.decode("utf-8", "replace")) #type: ignore #Because we generate this attribute dynamically. - except KeyError: # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. + except KeyError: + # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. pass # Throw the message away. def _onSliceUUIDMessage(self, message: Arcus.PythonMessage) -> None: @@ -972,7 +986,8 @@ class CuraEngineBackend(QObject, Backend): view = CuraApplication.getInstance().getController().getActiveView() if view: active_build_plate = CuraApplication.getInstance().getMultiBuildPlateModel().activeBuildPlate - if view.getPluginId() == "SimulationView": # If switching to layer view, we should process the layers if that hasn't been done yet. + if view.getPluginId() == "SimulationView": + # If switching to layer view, we should process the layers if that hasn't been done yet. self._layer_view_active = True # There is data and we're not slicing at the moment # if we are slicing, there is no need to re-calculate the data as it will be invalid in a moment. @@ -1024,7 +1039,8 @@ class CuraEngineBackend(QObject, Backend): self._global_container_stack = CuraApplication.getInstance().getMachineManager().activeMachine if self._global_container_stack: - self._global_container_stack.propertyChanged.connect(self._onSettingChanged) # Note: Only starts slicing when the value changed. + # Note: Only starts slicing when the value changed. + self._global_container_stack.propertyChanged.connect(self._onSettingChanged) self._global_container_stack.containersChanged.connect(self._onChanged) for extruder in self._global_container_stack.extruderList: From bf32b83c82e061a2d9614051f0ac14d62214bace Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 11:38:21 +0200 Subject: [PATCH 010/118] Move signal definition to top of file It's easier to understand what is going on if the signal definitions are not spread out CURA-10717 --- .../CuraEngineBackend/CuraEngineBackend.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 544780a03c..39f3c75185 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -46,6 +46,19 @@ catalog = i18nCatalog("cura") class CuraEngineBackend(QObject, Backend): backendError = Signal() + printDurationMessage = Signal() + """Emitted when we get a message containing print duration and material amount. + + This also implies the slicing has finished. + :param time: The amount of time the print will take. + :param material_amount: The amount of material the print will use. + """ + slicingStarted = Signal() + """Emitted when the slicing process starts.""" + + slicingCancelled = Signal() + """Emitted when the slicing process is aborted forcefully.""" + def __init__(self) -> None: """Starts the back-end plug-in. @@ -267,19 +280,6 @@ class CuraEngineBackend(QObject, Backend): return command - printDurationMessage = Signal() - """Emitted when we get a message containing print duration and material amount. - - This also implies the slicing has finished. - :param time: The amount of time the print will take. - :param material_amount: The amount of material the print will use. - """ - slicingStarted = Signal() - """Emitted when the slicing process starts.""" - - slicingCancelled = Signal() - """Emitted when the slicing process is aborted forcefully.""" - @pyqtSlot() def stopSlicing(self) -> None: self.setState(BackendState.NotStarted) From 4aebd755b2aa6d814c87d26da1ecee19e8c6913a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 11:43:15 +0200 Subject: [PATCH 011/118] Clarify documentation of startBackendPlugin function CURA-10717 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 39f3c75185..a7a0dfbdbf 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -197,6 +197,7 @@ class CuraEngineBackend(QObject, Backend): def startPlugins(self) -> None: """ Ensure that all backend plugins are started + It assigns unique ports to each plugin to avoid conflicts. :return: """ backend_plugins = CuraApplication.getInstance().getBackendPlugins() @@ -205,7 +206,7 @@ class CuraEngineBackend(QObject, Backend): continue # Set the port to prevent plugins from using the same one. backend_plugin.setPort(self._last_backend_plugin_port) - self.__last_backend_plugin_port += 1 + self._last_backend_plugin_port += 1 backend_plugin.start() def _resetLastSliceTimeStats(self) -> None: From 3037320b03b10bc67bcd3ce4522a21c6da5c25f3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 15:18:52 +0200 Subject: [PATCH 012/118] Send slotID's for backend_plugins CURA-10717 --- cura/BackendPlugin.py | 7 +++++++ plugins/CuraEngineBackend/StartSliceJob.py | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index 6493f20487..de7b3f29dc 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -15,6 +15,10 @@ class BackendPlugin(PluginObject): self._plugin_command: Optional[List[str]] = None self._process = None self._is_running = False + self._supported_slots: List[int] = [] + + def getSupportedSlots(self) -> List[int]: + return self._supported_slots def isRunning(self): return self._is_running @@ -25,6 +29,9 @@ class BackendPlugin(PluginObject): def getPort(self) -> int: return self.__port + def getAddress(self) -> str: + return self._plugin_address + def _validatePluginCommand(self) -> list[str]: """ Validate the plugin command and add the port parameter if it is missing. diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index d06136a2b4..f9fb7f6615 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -301,6 +301,19 @@ class StartSliceJob(Job): for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) + for plugin in CuraApplication.getInstance().getBackendPlugins(): + for slot in plugin.getSupportedSlots(): + # Right now we just send the message for every slot that we support. A single plugin can support + # multiple slots + # In the future the frontend will need to decide what slots that a plugin actually supports should + # also be used. For instance, if you have two plugins and each of them support a_generate and b_generate + # only one of each can actually be used (eg; plugin 1 does both, plugin 1 does a_generate and 2 does + # b_generate, etc). + plugin_message = self._slice_message.addRepeatedMessage("engine_plugins") + plugin_message.id = slot + plugin_message.address = plugin.getAddress() + plugin_message.port = plugin.getPort() + for group in filtered_object_groups: group_message = self._slice_message.addRepeatedMessage("object_lists") parent = group[0].getParent() From d37afe78801f14fa39578c51df65a60248ba868b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jul 2023 15:21:36 +0200 Subject: [PATCH 013/118] Actually call startPlugins before slicing CURA-10717 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index a7a0dfbdbf..ef073e6865 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -325,6 +325,8 @@ class CuraEngineBackend(QObject, Backend): self._createSnapshot() + self.startPlugins() + Logger.log("i", "Starting to slice...") self._time_start_process = time() if not self._build_plates_to_be_sliced: From 8c5278ab1d123235770f376fe7b21a4689c45292 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 12 Jul 2023 18:39:32 +0200 Subject: [PATCH 014/118] Use the branch dependencies Contributes to CURA-10717 and CURA-10475 --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 46e143cc10..cdebfbd924 100644 --- a/conanfile.py +++ b/conanfile.py @@ -270,10 +270,10 @@ class CuraConan(ConanFile): def requirements(self): self.requires("pyarcus/5.2.2") - self.requires("curaengine/(latest)@ultimaker/testing") + self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") - self.requires("uranium/(latest)@ultimaker/testing") + self.requires("uranium/(latest)@ultimaker/cura_10475") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") if self.options.internal: From 129e0d04b0a4339176a411b5baced953d508a9a1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 14 Jul 2023 09:27:39 +0200 Subject: [PATCH 015/118] Sync used SlotID Contributes to CURA-10717 and CURA-10475 --- plugins/CuraEngineBackend/Cura.proto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index 4953531a64..5afe585e30 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -9,8 +9,11 @@ message ObjectList } enum SlotID { - SIMPLIFY = 0; - POSTPROCESS = 1; + BROADCAST_SETTINGS = 0; + SIMPLIFY_MODIFY = 100; + POSTPROCESS_MODIFY = 101; + INFILL_MODIFY = 102; + INFILL_GENERATE = 200; } message EnginePlugin From 289b71cd9fb396386bba6406a04b9c4c0d253726 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 18 Jul 2023 11:11:27 +0200 Subject: [PATCH 016/118] Use common cmdline practices for named args Contributes CURA-10475 and CURA-10625 --- cura/BackendPlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index de7b3f29dc..fe8f2246e4 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -41,7 +41,7 @@ class BackendPlugin(PluginObject): if not self._plugin_command or "--port" in self._plugin_command: return self._plugin_command or [] - return self._plugin_command + ["--port", str(self.__port)] + return self._plugin_command + ["--port=", str(self.__port)] def start(self) -> bool: """ From 982ba7e36b273c80455340fdde6fed2a610c68cc Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 18 Jul 2023 11:17:15 +0200 Subject: [PATCH 017/118] Add log statement when starting plugin Revert = Contributes CURA-10475 and CURA-10625 --- cura/BackendPlugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index fe8f2246e4..5f22e33fbb 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -41,7 +41,7 @@ class BackendPlugin(PluginObject): if not self._plugin_command or "--port" in self._plugin_command: return self._plugin_command or [] - return self._plugin_command + ["--port=", str(self.__port)] + return self._plugin_command + ["--port", str(self.__port)] def start(self) -> bool: """ @@ -52,6 +52,7 @@ class BackendPlugin(PluginObject): try: # STDIN needs to be None because we provide no input, but communicate via a local socket instead. # The NUL device sometimes doesn't exist on some computers. + Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}") self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None) self._is_running = True return True From cd08e6e3bf5e5cb3fb5eeddbdf8dd45cf847b5a2 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 18 Jul 2023 12:31:02 +0200 Subject: [PATCH 018/118] Use pyarcus from branch CURA-10475 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index cdebfbd924..8b902265c5 100644 --- a/conanfile.py +++ b/conanfile.py @@ -269,7 +269,7 @@ class CuraConan(ConanFile): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): - self.requires("pyarcus/5.2.2") + self.requires("pyarcus/(latest)@ultimaker/cura_10475") self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") From fad3d09b95262b9fc202c24ffb7120184245290d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 18 Jul 2023 12:41:34 +0200 Subject: [PATCH 019/118] specify boost version in root package Solve version conflict with libnest2d --- conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conanfile.py b/conanfile.py index 8b902265c5..92b4b06983 100644 --- a/conanfile.py +++ b/conanfile.py @@ -262,6 +262,7 @@ class CuraConan(ConanFile): self.options["pysavitar"].shared = True self.options["pynest2d"].shared = True self.options["cpython"].shared = True + self.options["boost"].header_only = True def validate(self): version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) @@ -269,6 +270,7 @@ class CuraConan(ConanFile): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): + self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10475") self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/5.2.2") From a1f02154f1579dbde6b1a65997e0f2cd67af6274 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 27 Jul 2023 09:02:28 +0200 Subject: [PATCH 020/118] Add used backend plugins to 3mf metadata These are appended to project metadata. A warning can now be shown to the user when trying to load a project file while the correct plugins are not installed. These missing plugins can concequently be downloaded from the marketplace. To show the warning and install missing package dialog the same system we use to install missing materials is used. CURA-10719 --- plugins/3MFWriter/ThreeMFWriter.py | 88 ++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 11 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 57c667145e..cbbb635d21 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -1,8 +1,9 @@ # Copyright (c) 2015-2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import json +import re -from typing import Optional, cast, List, Dict +from typing import Optional, cast, List, Dict, Pattern, Set from UM.Mesh.MeshWriter import MeshWriter from UM.Math.Vector import Vector @@ -17,6 +18,7 @@ from UM.Settings.EmptyInstanceContainer import EmptyInstanceContainer from cura.CuraApplication import CuraApplication from cura.CuraPackageManager import CuraPackageManager +from cura.Settings import CuraContainerStack from cura.Utils.Threading import call_on_qt_thread from cura.Snapshot import Snapshot @@ -175,13 +177,15 @@ class ThreeMFWriter(MeshWriter): archive.writestr(thumbnail_file, thumbnail_buffer.data()) # Add PNG to content types file - thumbnail_type = ET.SubElement(content_types, "Default", Extension = "png", ContentType = "image/png") + thumbnail_type = ET.SubElement(content_types, "Default", Extension="png", ContentType="image/png") # Add thumbnail relation to _rels/.rels file - thumbnail_relation_element = ET.SubElement(relations_element, "Relationship", Target = "/" + THUMBNAIL_PATH, Id = "rel1", Type = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail") + thumbnail_relation_element = ET.SubElement(relations_element, "Relationship", + Target="/" + THUMBNAIL_PATH, Id="rel1", + Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail") # Write material metadata - material_metadata = self._getMaterialPackageMetadata() - self._storeMetadataJson({"packages": material_metadata}, archive, PACKAGE_METADATA_PATH) + packages_metadata = self._getMaterialPackageMetadata() + self._getPluginPackageMetadata() + self._storeMetadataJson({"packages": packages_metadata}, archive, PACKAGE_METADATA_PATH) savitar_scene = Savitar.Scene() @@ -253,7 +257,64 @@ class ThreeMFWriter(MeshWriter): metadata_file = zipfile.ZipInfo(path) # We have to set the compress type of each file as well (it doesn't keep the type of the entire archive) metadata_file.compress_type = zipfile.ZIP_DEFLATED - archive.writestr(metadata_file, json.dumps(metadata, separators=(", ", ": "), indent=4, skipkeys=True, ensure_ascii=False)) + archive.writestr(metadata_file, + json.dumps(metadata, separators=(", ", ": "), indent=4, skipkeys=True, ensure_ascii=False)) + + @staticmethod + def _getPluginPackageMetadata() -> List[Dict[str, str]]: + """Get metadata for all backend plugins that are used in the project. + + :return: List of material metadata dictionaries. + """ + + backend_plugin_enum_value_regex = re.compile( + r"PLUGIN::(?P\w+)@(?P\d+.\d+.\d+)::(?P\w+)") + # This regex parses enum values to find if they contain custom + # backend engine values. These custom enum values are in the format + # PLUGIN::@:: + # where + # - plugin_id is the id of the plugin + # - version is in the semver format + # - value is the value of the enum + + plugin_ids = set() + + def add_plugin_ids_in_stack(stack: CuraContainerStack): + for key in stack.getAllKeys(): + value = str(stack.getProperty(key, "value")) + for plugin_id, _version, _value in backend_plugin_enum_value_regex.findall(value): + plugin_ids.add(plugin_id) + + # go through all stacks and find all the plugin id contained in the project + global_stack = Application.getInstance().getMachineManager().activeMachine + add_plugin_ids_in_stack(global_stack) + + for container in global_stack.getContainers(): + add_plugin_ids_in_stack(container) + + for extruder_stack in global_stack.extruderList: + add_plugin_ids_in_stack(extruder_stack) + + for container in extruder_stack.getContainers(): + add_plugin_ids_in_stack(container) + + metadata = {} + + package_manager = cast(CuraPackageManager, CuraApplication.getInstance().getPackageManager()) + for plugin_id in plugin_ids: + package_data = package_manager.getInstalledPackageInfo(plugin_id) + + metadata[plugin_id] = { + "id": plugin_id, + "display_name": package_data.get("display_name") if package_data.get("display_name") else "", + "package_version": package_data.get("package_version") if package_data.get("package_version") else "", + "sdk_version_semver": package_data.get("sdk_version_semver") if package_data.get( + "sdk_version_semver") else "", + "type": "backend_plugin", + } + + # Storing in a dict and fetching values to avoid duplicates + return list(metadata.values()) @staticmethod def _getMaterialPackageMetadata() -> List[Dict[str, str]]: @@ -278,7 +339,8 @@ class ThreeMFWriter(MeshWriter): # Don't export bundled materials continue - package_id = package_manager.getMaterialFilePackageId(extruder.material.getFileName(), extruder.material.getMetaDataEntry("GUID")) + package_id = package_manager.getMaterialFilePackageId(extruder.material.getFileName(), + extruder.material.getMetaDataEntry("GUID")) package_data = package_manager.getInstalledPackageInfo(package_id) # We failed to find the package for this material @@ -286,10 +348,14 @@ class ThreeMFWriter(MeshWriter): Logger.info(f"Could not find package for material in extruder {extruder.id}, skipping.") continue - material_metadata = {"id": package_id, - "display_name": package_data.get("display_name") if package_data.get("display_name") else "", - "package_version": package_data.get("package_version") if package_data.get("package_version") else "", - "sdk_version_semver": package_data.get("sdk_version_semver") if package_data.get("sdk_version_semver") else ""} + material_metadata = { + "id": package_id, + "display_name": package_data.get("display_name") if package_data.get("display_name") else "", + "package_version": package_data.get("package_version") if package_data.get("package_version") else "", + "sdk_version_semver": package_data.get("sdk_version_semver") if package_data.get( + "sdk_version_semver") else "", + "type": "material", + } metadata[package_id] = material_metadata From 42002dac3690e3d0f9a72e5a5a33ff05ad2f09da Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 27 Jul 2023 09:03:35 +0200 Subject: [PATCH 021/118] Update copy Now more then just materials can be installed. Update copy to reflect this. CURA-10719 --- plugins/3MFReader/WorkspaceDialog.qml | 2 +- .../Marketplace/resources/qml/InstallMissingPackagesDialog.qml | 2 +- plugins/Marketplace/resources/qml/MissingPackages.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index d1a000bae4..3def26277d 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -404,7 +404,7 @@ UM.Dialog Cura.PrimaryButton { visible: warning - text: catalog.i18nc("@action:button", "Install missing material") + text: catalog.i18nc("@action:button", "Install missing packages") onClicked: manager.installMissingPackages() } ] diff --git a/plugins/Marketplace/resources/qml/InstallMissingPackagesDialog.qml b/plugins/Marketplace/resources/qml/InstallMissingPackagesDialog.qml index edad18f1a8..7ac0a241e6 100644 --- a/plugins/Marketplace/resources/qml/InstallMissingPackagesDialog.qml +++ b/plugins/Marketplace/resources/qml/InstallMissingPackagesDialog.qml @@ -12,7 +12,7 @@ import Cura 1.6 as Cura Marketplace { modality: Qt.ApplicationModal - title: catalog.i18nc("@title", "Install missing Materials") + title: catalog.i18nc("@title", "Install missing packages") pageContentsSource: "MissingPackages.qml" showSearchHeader: false showOnboadBanner: false diff --git a/plugins/Marketplace/resources/qml/MissingPackages.qml b/plugins/Marketplace/resources/qml/MissingPackages.qml index 316d048317..a1d29addf9 100644 --- a/plugins/Marketplace/resources/qml/MissingPackages.qml +++ b/plugins/Marketplace/resources/qml/MissingPackages.qml @@ -5,7 +5,7 @@ import UM 1.4 as UM Packages { - pageTitle: catalog.i18nc("@header", "Install Materials") + pageTitle: catalog.i18nc("@header", "Install Packages") bannerVisible: false showUpdateButton: false From 0e77a05c742460339547b29a047dea762e18ac98 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 27 Jul 2023 10:15:27 +0200 Subject: [PATCH 022/118] Correctly differentiate between plugins and materials in missing packages dialog CURA-10719 --- plugins/3MFWriter/ThreeMFWriter.py | 2 +- plugins/Marketplace/MissingPackageList.py | 10 ++++++++-- plugins/Marketplace/PackageModel.py | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index cbbb635d21..2bfb152217 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -310,7 +310,7 @@ class ThreeMFWriter(MeshWriter): "package_version": package_data.get("package_version") if package_data.get("package_version") else "", "sdk_version_semver": package_data.get("sdk_version_semver") if package_data.get( "sdk_version_semver") else "", - "type": "backend_plugin", + "type": "plugin", } # Storing in a dict and fetching values to avoid duplicates diff --git a/plugins/Marketplace/MissingPackageList.py b/plugins/Marketplace/MissingPackageList.py index 385e78b95f..018e977823 100644 --- a/plugins/Marketplace/MissingPackageList.py +++ b/plugins/Marketplace/MissingPackageList.py @@ -20,7 +20,6 @@ class MissingPackageList(RemotePackageList): def __init__(self, packages_metadata: List[Dict[str, str]], parent: Optional["QObject"] = None) -> None: super().__init__(parent) self._packages_metadata: List[Dict[str, str]] = packages_metadata - self._package_type_filter = "material" self._search_type = "package_ids" self._requested_search_string = ",".join(map(lambda package: package["id"], packages_metadata)) @@ -38,7 +37,14 @@ class MissingPackageList(RemotePackageList): for package_metadata in self._packages_metadata: if package_metadata["id"] not in returned_packages_ids: - package = PackageModel.fromIncompletePackageInformation(package_metadata["display_name"], package_metadata["package_version"], self._package_type_filter) + package_type = package_metadata["type"] if "type" in package_metadata else "material" + # When this feature was originally introduced only missing materials were detected. With the inclusion + # of backend plugins this system was extended to also detect missing plugins. With that change the type + # of the package was added to the metadata. Project files before this change do not have this type. So + # if the type is not present we assume it is a material. + package = PackageModel.fromIncompletePackageInformation(package_metadata["display_name"], + package_metadata["package_version"], + package_type) self.appendItem({"package": package}) self.itemsChanged.emit() diff --git a/plugins/Marketplace/PackageModel.py b/plugins/Marketplace/PackageModel.py index fa909b4120..afc6e0ce73 100644 --- a/plugins/Marketplace/PackageModel.py +++ b/plugins/Marketplace/PackageModel.py @@ -87,12 +87,22 @@ class PackageModel(QObject): self._is_missing_package_information = False @classmethod - def fromIncompletePackageInformation(cls, display_name: str, package_version: str, package_type: str) -> "PackageModel": + def fromIncompletePackageInformation(cls, display_name: str, package_version: str, + package_type: str) -> "PackageModel": + description = "" + match package_type: + case "material": + description = catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", + "The material package associated with the Cura project could not be found on the Ultimaker Marketplace. Use the partial material profile definition stored in the Cura project file at your own risk.") + case "plugin": + description = catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", + "The plugin associated with the Cura project could not be found on the Ultimaker Marketplace. As the plugin may be required to slice the project it might not be possible to correctly slice the file.") + package_data = { "display_name": display_name, "package_version": package_version, "package_type": package_type, - "description": catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", "The material package associated with the Cura project could not be found on the Ultimaker Marketplace. Use the partial material profile definition stored in the Cura project file at your own risk.") + "description": description, } package_model = cls(package_data) package_model.setIsMissingPackageInformation(True) From 31cb11ce63b2c6f529f10086b53d757c9f2b9479 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 27 Jul 2023 10:31:38 +0200 Subject: [PATCH 023/118] Update more copies CURA-10719 --- plugins/3MFReader/WorkspaceDialog.py | 29 ++++++++++++++------------- plugins/3MFReader/WorkspaceDialog.qml | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index afa1deecfd..cce195e2fa 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -408,26 +408,27 @@ class WorkspaceDialog(QObject): @pyqtSlot() def showMissingMaterialsWarning(self) -> None: result_message = Message( - i18n_catalog.i18nc("@info:status", "The material used in this project relies on some material definitions not available in Cura, this might produce undesirable print results. We highly recommend installing the full material package from the Marketplace."), + i18n_catalog.i18nc("@info:status", + "Some of the packages used in the project file are currently not installed in Cura, this might produce undesirable print results. We highly recommend installing the all required packages from the Marketplace."), lifetime=0, - title=i18n_catalog.i18nc("@info:title", "Material profiles not installed"), + title=i18n_catalog.i18nc("@info:title", "Some required packages are not installed"), message_type=Message.MessageType.WARNING ) result_message.addAction( - "learn_more", - name=i18n_catalog.i18nc("@action:button", "Learn more"), - icon="", - description="Learn more about project materials.", - button_align=Message.ActionButtonAlignment.ALIGN_LEFT, - button_style=Message.ActionButtonStyle.LINK + "learn_more", + name=i18n_catalog.i18nc("@action:button", "Learn more"), + icon="", + description=i18n_catalog.i18nc("@label", "Learn more about project packages."), + button_align=Message.ActionButtonAlignment.ALIGN_LEFT, + button_style=Message.ActionButtonStyle.LINK ) result_message.addAction( - "install_materials", - name=i18n_catalog.i18nc("@action:button", "Install Materials"), - icon="", - description="Install missing materials from project file.", - button_align=Message.ActionButtonAlignment.ALIGN_RIGHT, - button_style=Message.ActionButtonStyle.DEFAULT + "install_materials", + name=i18n_catalog.i18nc("@action:button", "Install Packages"), + icon="", + description=i18n_catalog.i18nc("@label", "Install missing packages from project file."), + button_align=Message.ActionButtonAlignment.ALIGN_RIGHT, + button_style=Message.ActionButtonStyle.DEFAULT ) result_message.actionTriggered.connect(self._onMessageActionTriggered) result_message.show() diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 3def26277d..d5f9b1817d 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -364,7 +364,7 @@ UM.Dialog UM.Label { id: warningText - text: catalog.i18nc("@label", "The material used in this project is currently not installed in Cura.
Install the material profile and reopen the project.") + text: catalog.i18nc("@label", "This project contains materials or plugins that are currently not installed in Cura.
Install the missing packages and reopen the project.") } } From 7c810eeca85362bc229db4de09f912da9d4e1940 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 28 Jul 2023 14:52:56 +0200 Subject: [PATCH 024/118] Ease of use; each backend-plugin can now provide additional settings. Any overriding cals that does so, should just add 'self.definition_file_paths' to load their additional settings. However, at the moment of this commit, you should still suppy setting_definitions_appender in the list of __init__.register for the plugin. part of CURA-10722 --- cura/BackendPlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index 5f22e33fbb..be48aa50d2 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -4,10 +4,10 @@ import subprocess from typing import Optional, List from UM.Logger import Logger -from UM.PluginObject import PluginObject +from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender -class BackendPlugin(PluginObject): +class BackendPlugin(AdditionalSettingDefinitionsAppender): def __init__(self) -> None: super().__init__() self.__port: int = 0 From 4c8209874573ec0ef34b1812000acf96acb088d7 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 28 Jul 2023 15:13:48 +0200 Subject: [PATCH 025/118] Backend-plugins don't have to register separately for extra setting-defs. Also they now have their own appender-type (previously it was _always_ 'PLUGIN', now the other plugins are 'EXTRA'). part of CURA-10722 --- cura/BackendPlugin.py | 1 + cura/CuraApplication.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index be48aa50d2..cd859197a0 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -16,6 +16,7 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender): self._process = None self._is_running = False self._supported_slots: List[int] = [] + self.appender_type = "PLUGIN" def getSupportedSlots(self) -> List[int]: return self._supported_slots diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 807757d1ed..1a00d527d3 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1745,6 +1745,7 @@ class CuraApplication(QtApplication): pass def _addBackendPlugin(self, backend_plugin: "BackendPlugin") -> None: + self._container_registry.addAdditionalSettingDefinitionsAppender(backend_plugin) self._backend_plugins.append(backend_plugin) def getBackendPlugins(self) -> List["BackendPlugin"]: From b1797111d58d3894501a56e3b7e7be56d444b426 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 31 Jul 2023 17:06:58 +0200 Subject: [PATCH 026/118] Update message id to properly reflect action CURA-10719 --- plugins/3MFReader/WorkspaceDialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index cce195e2fa..ed42485691 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -423,7 +423,7 @@ class WorkspaceDialog(QObject): button_style=Message.ActionButtonStyle.LINK ) result_message.addAction( - "install_materials", + "install_packages", name=i18n_catalog.i18nc("@action:button", "Install Packages"), icon="", description=i18n_catalog.i18nc("@label", "Install missing packages from project file."), From e3d482514ba1041b4573a7180f72428dfba8bad7 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 31 Jul 2023 17:09:27 +0200 Subject: [PATCH 027/118] Use camelCase for python function definition CURA-10719 Co-authored-by: Jaime van Kessel --- plugins/3MFWriter/ThreeMFWriter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 2bfb152217..a3636a98b9 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -279,7 +279,7 @@ class ThreeMFWriter(MeshWriter): plugin_ids = set() - def add_plugin_ids_in_stack(stack: CuraContainerStack): + def addPluginIdsInStack(stack: CuraContainerStack) -> None: for key in stack.getAllKeys(): value = str(stack.getProperty(key, "value")) for plugin_id, _version, _value in backend_plugin_enum_value_regex.findall(value): @@ -287,16 +287,16 @@ class ThreeMFWriter(MeshWriter): # go through all stacks and find all the plugin id contained in the project global_stack = Application.getInstance().getMachineManager().activeMachine - add_plugin_ids_in_stack(global_stack) + addPluginIdsInStack(global_stack) for container in global_stack.getContainers(): - add_plugin_ids_in_stack(container) + addPluginIdsInStack(container) for extruder_stack in global_stack.extruderList: - add_plugin_ids_in_stack(extruder_stack) + addPluginIdsInStack(extruder_stack) for container in extruder_stack.getContainers(): - add_plugin_ids_in_stack(container) + addPluginIdsInStack(container) metadata = {} From 9b6abf80d74528e662fa9d53f72e647aee4d7d9b Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 31 Jul 2023 17:10:06 +0200 Subject: [PATCH 028/118] Capitalize first word of comment comment CURA-10719 Co-authored-by: Jaime van Kessel --- plugins/3MFWriter/ThreeMFWriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index a3636a98b9..3be9a7478d 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -285,7 +285,7 @@ class ThreeMFWriter(MeshWriter): for plugin_id, _version, _value in backend_plugin_enum_value_regex.findall(value): plugin_ids.add(plugin_id) - # go through all stacks and find all the plugin id contained in the project + # Go through all stacks and find all the plugin id contained in the project global_stack = Application.getInstance().getMachineManager().activeMachine addPluginIdsInStack(global_stack) From f9d4eb955428706496652ebe0c46cf2be4f996d5 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 1 Aug 2023 07:47:22 +0200 Subject: [PATCH 029/118] Sync Cura.proto with other repo's Contributes CURA-10475 --- plugins/CuraEngineBackend/Cura.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index 5afe585e30..d5d7c92d0b 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -9,7 +9,7 @@ message ObjectList } enum SlotID { - BROADCAST_SETTINGS = 0; + SETTINGS_BROADCAST = 0; SIMPLIFY_MODIFY = 100; POSTPROCESS_MODIFY = 101; INFILL_MODIFY = 102; From 0f7b092507154274867f69afd410c9b37d686013 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 1 Aug 2023 07:47:51 +0200 Subject: [PATCH 030/118] Allow for using Conan 1.60 Contributes CURA-10475 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 92b4b06983..598168fe73 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,7 +10,7 @@ from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration, ConanException -required_conan_version = "<=1.56.0" +required_conan_version = "<=1.60.0" class CuraConan(ConanFile): From c436dd36cf77f8a3032ce6fb34e8963f3149969e Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 2 Aug 2023 14:03:55 +0200 Subject: [PATCH 031/118] Add unit test CURA-10719 --- plugins/3MFWriter/ThreeMFWriter.py | 2 +- plugins/3MFWriter/tests/TestMFWriter.py | 56 +++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 plugins/3MFWriter/tests/TestMFWriter.py diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 3be9a7478d..10b040e01f 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -286,7 +286,7 @@ class ThreeMFWriter(MeshWriter): plugin_ids.add(plugin_id) # Go through all stacks and find all the plugin id contained in the project - global_stack = Application.getInstance().getMachineManager().activeMachine + global_stack = CuraApplication.getInstance().getMachineManager().activeMachine addPluginIdsInStack(global_stack) for container in global_stack.getContainers(): diff --git a/plugins/3MFWriter/tests/TestMFWriter.py b/plugins/3MFWriter/tests/TestMFWriter.py new file mode 100644 index 0000000000..addef2788e --- /dev/null +++ b/plugins/3MFWriter/tests/TestMFWriter.py @@ -0,0 +1,56 @@ +import sys +import os.path +from typing import Dict, Optional + +from unittest.mock import patch, MagicMock, PropertyMock + +from UM.PackageManager import PackageManager +from cura.CuraApplication import CuraApplication + +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) + +import ThreeMFWriter + +PLUGIN_ID = "my_plugin" +DISPLAY_NAME = "MyPlugin" +PACKAGE_VERSION = "0.0.1" +SDK_VERSION = "8.0.0" + + +def package_manager() -> MagicMock: + pm = MagicMock(spec=PackageManager) + pm.getInstalledPackageInfo.return_value = { + "display_name": DISPLAY_NAME, + "package_version": PACKAGE_VERSION, + "sdk_version_semver": SDK_VERSION + } + return pm + + +def machine_manager() -> MagicMock: + mm = MagicMock(spec=PackageManager) + active_machine = MagicMock() + active_machine.getAllKeys.return_value = ["infill_pattern", "layer_height", "material_bed_temperature"] + active_machine.getProperty.return_value = f"PLUGIN::{PLUGIN_ID}@{PACKAGE_VERSION}::custom_value" + active_machine.getContainers.return_value = [] + active_machine.extruderList = [] + mm.activeMachine = active_machine + return mm + + +def application(): + app = MagicMock() + app.getPackageManager.return_value = package_manager() + app.getMachineManager.return_value = machine_manager() + return app + + +def test_enumParsing(): + with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value=application())): + packages_metadata = ThreeMFWriter.ThreeMFWriter._getPluginPackageMetadata()[0] + + assert packages_metadata.get("id") == PLUGIN_ID + assert packages_metadata.get("display_name") == DISPLAY_NAME + assert packages_metadata.get("package_version") == PACKAGE_VERSION + assert packages_metadata.get("sdk_version_semver") == SDK_VERSION + assert packages_metadata.get("type") == "plugin" From 83d35ccd8b3100df9dc4cbfe9b3426bd7bd1f47c Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 2 Aug 2023 14:46:37 +0200 Subject: [PATCH 032/118] Use pytest fixtures CURA-10719 --- plugins/3MFWriter/tests/TestMFWriter.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/3MFWriter/tests/TestMFWriter.py b/plugins/3MFWriter/tests/TestMFWriter.py index addef2788e..7bee581105 100644 --- a/plugins/3MFWriter/tests/TestMFWriter.py +++ b/plugins/3MFWriter/tests/TestMFWriter.py @@ -1,6 +1,7 @@ import sys import os.path from typing import Dict, Optional +import pytest from unittest.mock import patch, MagicMock, PropertyMock @@ -17,6 +18,7 @@ PACKAGE_VERSION = "0.0.1" SDK_VERSION = "8.0.0" +@pytest.fixture def package_manager() -> MagicMock: pm = MagicMock(spec=PackageManager) pm.getInstalledPackageInfo.return_value = { @@ -27,6 +29,7 @@ def package_manager() -> MagicMock: return pm +@pytest.fixture def machine_manager() -> MagicMock: mm = MagicMock(spec=PackageManager) active_machine = MagicMock() @@ -38,15 +41,16 @@ def machine_manager() -> MagicMock: return mm -def application(): +@pytest.fixture +def application(package_manager, machine_manager): app = MagicMock() - app.getPackageManager.return_value = package_manager() - app.getMachineManager.return_value = machine_manager() + app.getPackageManager.return_value = package_manager + app.getMachineManager.return_value = machine_manager return app -def test_enumParsing(): - with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value=application())): +def test_enumParsing(application): + with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value=application)): packages_metadata = ThreeMFWriter.ThreeMFWriter._getPluginPackageMetadata()[0] assert packages_metadata.get("id") == PLUGIN_ID From 4f2b038a5969d6464bfffb710da362316f9f7bc8 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 3 Aug 2023 13:04:14 +0200 Subject: [PATCH 033/118] Use "PLUGIN" as default `appender_type` --- cura/BackendPlugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index cd859197a0..be48aa50d2 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -16,7 +16,6 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender): self._process = None self._is_running = False self._supported_slots: List[int] = [] - self.appender_type = "PLUGIN" def getSupportedSlots(self) -> List[int]: return self._supported_slots From 2240db9062699b17471a4e0c233a68866d50f9f1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 7 Aug 2023 16:04:25 +0200 Subject: [PATCH 034/118] Add GCodePathsModify Contributes CURA-10446 --- plugins/CuraEngineBackend/Cura.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index d5d7c92d0b..96f1f64477 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -13,6 +13,7 @@ enum SlotID { SIMPLIFY_MODIFY = 100; POSTPROCESS_MODIFY = 101; INFILL_MODIFY = 102; + GCODE_PATHS_MODIFY = 103; INFILL_GENERATE = 200; } From e01b1406e31c87b580f0f9640d0cabe440473dc7 Mon Sep 17 00:00:00 2001 From: GregValiant <64202104+GregValiant@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:08:41 -0400 Subject: [PATCH 035/118] Update LimitXYAccelJerk.py Added Gradual Accel Change. Update LimitXYAccelJerk.py Round the Accel numbers to nearest "50". Create LimitXYAccelJerk.py New post processor to limit the X and or Y accel and jerk for bed-slinger printers. Update LimitXYAccelJerk.py Removed debug code. Update LimitXYAccelJerk.py Remove debug code Update LimitXYAccelJerk.py Bug Fix --- .../scripts/LimitXYAccelJerk.py | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py diff --git a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py new file mode 100644 index 0000000000..8932d8e4ea --- /dev/null +++ b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py @@ -0,0 +1,273 @@ +# Limit XY Accel: Authored by: Greg Foresi (GregValiant) +# July 2023 +# Sometimes bed-slinger printers need different Accel and Jerk values for the Y but Cura always makes them the same. +# This script changes the Accel and/or Jerk from the beginning of the 'Start Layer' to the end of the 'End Layer'. +# The existing M201 Max Accel will be changed to limit the Y (and/or X) accel at the printer. If you have Accel enabled in Cura and the XY Accel is set to 3000 then setting the Y limit to 1000 will result in the printer limiting the Y to 1000. This can keep tall skinny prints from breaking loose of the bed and failing. The script was not tested with Junction Deviation. +# If enabled - the Jerk setting is changed line-by-line within the gcode as there is no "limit" on Jerk. +# if 'Gradual ACCEL change' is enabled then the Accel is changed gradually from the Start to the End layer and that will be the final Accel setting in the file. If 'Gradual' is enabled then the Jerk settings will continue to be changed to the end of the file (rather than ending at the End layer). + +from ..Script import Script +from cura.CuraApplication import CuraApplication +import re + +class LimitXYAccelJerk(Script): + def __init__(self): + super().__init__() + + def initialize(self) -> None: + super().initialize() + # Get the Accel and Jerk and set the values in the setting boxes--------------------------------------------- + mycura = CuraApplication.getInstance().getGlobalContainerStack() + extruder = mycura.extruderList + accel_print = extruder[0].getProperty("acceleration_print", "value") + accel_travel = extruder[0].getProperty("acceleration_travel", "value") + jerk_print_old = extruder[0].getProperty("jerk_print", "value") + jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") + self._instance.setProperty("X_accel_limit", "value", round(accel_print)) + self._instance.setProperty("Y_accel_limit", "value", round(accel_print)) + self._instance.setProperty("X_jerk", "value", jerk_print_old) + self._instance.setProperty("Y_jerk", "value", jerk_print_old) + + def getSettingDataString(self): + return """{ + "name": "Limit the X-Y Accel/Jerk", + "key": "LimitXYAccelJerk", + "metadata": {}, + "version": 2, + "settings": + { + "X_accel_limit": + { + "label": "X MAX Acceleration", + "description": "If this number is lower than the 'X Print Accel' in Cura then this will limit the Accel on the X axis. Enter the Maximum Acceleration value for the X axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", + "type": "int", + "enabled": true, + "minimum_value": 50, + "unit": "mm/sec² ", + "default_value": 500 + }, + "Y_accel_limit": + { + "label": "Y MAX Acceleration", + "description": "If this number is lower than the Y accel in Cura then this will limit the Accel on the Y axis. Enter the Maximum Acceleration value for the Y axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", + "type": "int", + "enabled": true, + "minimum_value": 50, + "unit": "mm/sec² ", + "default_value": 500 + }, + "jerk_enable": + { + "label": "Change the Jerk", + "description": "Whether to change the Jerk values.", + "type": "bool", + "enabled": true, + "default_value": false + }, + "X_jerk": + { + "label": " X jerk", + "description": "Enter the Jerk value for the X axis. Enter '0' to use the existing X Jerk. This setting will affect both the Print and Travel jerk.", + "type": "int", + "enabled": "jerk_enable", + "unit": "mm/sec ", + "default_value": 8 + }, + "Y_jerk": + { + "label": " Y jerk", + "description": "Enter the Jerk value for the Y axis. Enter '0' to use the existing Y Jerk. This setting will affect both the Print and Travel jerk.", + "type": "int", + "enabled": "jerk_enable", + "unit": "mm/sec ", + "default_value": 8 + }, + "start_layer": + { + "label": "From Start of Layer:", + "description": "Use the Cura Preview numbers. Enter the Layer to start the changes at. The minimum is Layer 1.", + "type": "int", + "default_value": 1, + "minimum_value": 1, + "unit": "Lay# ", + "enabled": "not gradient_change" + }, + "end_layer": + { + "label": "To End of Layer", + "description": "Use the Cura Preview numbers. Enter '-1' for the entire file or enter a layer number. The changes will end at your 'End Layer' and revert back to the original numbers.", + "type": "int", + "default_value": -1, + "minimum_value": -1, + "unit": "Lay# ", + "enabled": "not gradient_change" + }, + "gradient_change": + { + "label": "Gradual ACCEL Change", + "description": "Gradually change the Accel numbers 'From layer' - 'To Layer'. If Jerk is enabled the Jerk changes are not 'Gradual' because there is no Max Jerk setting. Unlike Constant change - using 'Gradual' the Accel and Jerk change continues from the End Layer to the end of the file.", + "type": "bool", + "default_value": false, + "enabled": true + }, + "gradient_start_layer": + { + "label": " Gradual From Layer:", + "description": "Use the Cura Preview numbers. Enter the Layer to start the changes at. The minimum is Layer 1.", + "type": "int", + "default_value": 1, + "minimum_value": 1, + "unit": "Lay# ", + "enabled": "gradient_change" + }, + "gradient_end_layer": + { + "label": " Gradual To Layer", + "description": "Use the Cura Preview numbers. Enter '-1' for the top layer or enter a layer number. The last 'Gradual' change will continue to the end of the file.", + "type": "int", + "default_value": -1, + "minimum_value": -1, + "unit": "Lay# ", + "enabled": "gradient_change" + } + } + }""" + + def execute(self, data): + mycura = CuraApplication.getInstance().getGlobalContainerStack() + extruder = mycura.extruderList + constant_change = not bool(self.getSettingValueByKey("gradient_change")) + accel_print_enabled = bool(extruder[0].getProperty("acceleration_enabled", "value")) + accel_travel_enabled = bool(extruder[0].getProperty("acceleration_travel_enabled", "value")) + accel_print = extruder[0].getProperty("acceleration_print", "value") + accel_travel = extruder[0].getProperty("acceleration_travel", "value") + jerk_print_enabled = str(extruder[0].getProperty("jerk_enabled", "value")) + jerk_travel_enabled = str(extruder[0].getProperty("jerk_travel_enabled", "value")) + jerk_print_old = extruder[0].getProperty("jerk_print", "value") + jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") + if int(accel_print) >= int(accel_travel): + accel_old = accel_print + else: + accel_old = accel_travel + jerk_travel = str(extruder[0].getProperty("jerk_travel", "value")) + if int(jerk_print_old) >= int(jerk_travel_old): + jerk_old = jerk_print_old + else: + jerk_old = jerk_travel_old + + #Set the new Accel values--------------------------------------------------------------------------------- + x_accel = str(self.getSettingValueByKey("X_accel_limit")) + y_accel = str(self.getSettingValueByKey("Y_accel_limit")) + x_jerk = int(self.getSettingValueByKey("X_jerk")) + y_jerk = int(self.getSettingValueByKey("Y_jerk")) + # Put the strings together + M201_limit_new = "M201 X" + x_accel + " Y" + y_accel + M201_limit_old = "M201 X" + str(round(accel_old)) + " Y" + str(round(accel_old)) + if x_jerk == 0: + M205_jerk_pattern = "Y(\d*)" + M205_jerk_new = "Y" + str(y_jerk) + if y_jerk == 0: + M205_jerk_pattern = "X(\d*)" + M205_jerk_new = "X" + str(x_jerk) + if x_jerk != 0 and y_jerk != 0: + M205_jerk_pattern = "M205 X(\d*) Y(\d*)" + M205_jerk_new = "M205 X" + str(x_jerk) + " Y" + str(y_jerk) + M205_jerk_old = "M205 X" + str(jerk_old) + " Y" + str(jerk_old) + + #Get the indexes of the start and end layers---------------------------------------- + if constant_change: + start_layer = int(self.getSettingValueByKey("start_layer"))-1 + end_layer = int(self.getSettingValueByKey("end_layer")) + else: + start_layer = int(self.getSettingValueByKey("gradient_start_layer"))-1 + end_layer = int(self.getSettingValueByKey("gradient_end_layer")) + start_index = 2 + end_index = len(data)-2 + for num in range(2,len(data)-1): + if ";LAYER:" + str(start_layer) + "\n" in data[num]: + start_index = num + break + if int(end_layer) > 0: + for num in range(3,len(data)-1): + try: + if ";LAYER:" + str(end_layer) + "\n" in data[num]: + end_index = num + break + except: + end_index = len(data)-2 + + #Add Accel limit and new Jerk at start layer----------------------------------------------------- + if constant_change: + layer = data[start_index] + lines = layer.split("\n") + for index, line in enumerate(lines): + if lines[index].startswith(";LAYER:"): + lines.insert(index+1,M201_limit_new) + if self.getSettingValueByKey("jerk_enable"): + lines.insert(index+2,M205_jerk_new) + data[start_index] = "\n".join(lines) + break + + #Alter any existing jerk lines. Accel lines can be ignored----------------------------------- + for num in range(start_index,end_index,1): + layer = data[num] + lines = layer.split("\n") + for index, line in enumerate(lines): + if line.startswith("M205"): + lines[index] = re.sub(M205_jerk_pattern, M205_jerk_new, line) + data[num] = "\n".join(lines) + if end_layer != -1: + try: + layer = data[end_index-1] + lines = layer.split("\n") + lines.insert(len(lines)-2,M201_limit_old) + lines.insert(len(lines)-2,M205_jerk_old) + data[end_index-1] = "\n".join(lines) + except: + all + else: + data[len(data)-1] = M201_limit_old + "\n" + M205_jerk_old + "\n" + data[len(data)-1] + return data + + + elif not constant_change: + layer_spread = end_index - start_index + x_accel_hyst = round((accel_old - int(x_accel)) / layer_spread) + y_accel_hyst = round((accel_old - int(y_accel)) / layer_spread) + x_accel_start = round(round((accel_old - x_accel_hyst)/50)*50) + y_accel_start = round(round((accel_old - y_accel_hyst)/50)*50) + M201_limit_new = "M201 X" + str(x_accel_start) + " Y" + str(y_accel_start) + #Add Accel limit and new Jerk at start layer------------------------------------------------------------- + layer = data[start_index] + lines = layer.split("\n") + for index, line in enumerate(lines): + if lines[index].startswith(";LAYER:"): + lines.insert(index+1,M201_limit_new) + if self.getSettingValueByKey("jerk_enable"): + lines.insert(index+2,M205_jerk_new) + data[start_index] = "\n".join(lines) + break + for num in range(start_index + 1, end_index,1): + layer = data[num] + lines = layer.split("\n") + x_accel_start -= x_accel_hyst + if x_accel_start < int(x_accel): x_accel_start = int(x_accel) + y_accel_start -= y_accel_hyst + if y_accel_start < int(y_accel): y_accel_start = int(y_accel) + M201_limit_new = "M201 X" + str(round(round(x_accel_start/50)*50)) + " Y" + str(round(round(y_accel_start/50)*50)) + for index, line in enumerate(lines): + if line.startswith(";LAYER:"): + lines.insert(index+1, M201_limit_new) + continue + data[num] = "\n".join(lines) + #Alter any existing jerk lines. Accel lines can be ignored----------------------------------- + if self.getSettingValueByKey("jerk_enable"): + for num in range(start_index,len(data)-1,1): + layer = data[num] + lines = layer.split("\n") + for index, line in enumerate(lines): + if line.startswith("M205"): + lines[index] = re.sub(M205_jerk_pattern, M205_jerk_new, line) + data[num] = "\n".join(lines) + data[len(data)-1] = M201_limit_old + "\n" + M205_jerk_old + "\n" + data[len(data)-1] + return data \ No newline at end of file From dead016ed991eb7508a18bd3f97a303e34270103 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 10 Aug 2023 05:56:24 +0200 Subject: [PATCH 036/118] Add error messages to BackendPlugin and enhance exception handling Exception handling in BackendPlugin has been improved by adding user-friendly error messages for various exceptions. Errors during backend plugin start or stop will now trigger a message to the user, providing more context about the cause of the failure. This makes it easier for users to understand and resolve possible issues. In addition, the EngineBackend stop function has been modified to forcibly stop all running backend plugins instead of allowing multiple plugins to run simultaneously. --- cura/BackendPlugin.py | 32 +++++++++++++++---- .../CuraEngineBackend/CuraEngineBackend.py | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index be48aa50d2..a92e4fe405 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -4,6 +4,7 @@ import subprocess from typing import Optional, List from UM.Logger import Logger +from UM.Message import Message from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender @@ -57,13 +58,25 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender): self._is_running = True return True except PermissionError: - Logger.log("e", f"Couldn't start backend_plugin [{self._plugin_id}]: No permission to execute process.") + Logger.log("e", f"Couldn't start EnginePlugin: {self._plugin_id} No permission to execute process.") + self._showMessage(self.catalog.i18nc("@info:plugin_failed", + f"Couldn't start EnginePlugin: {self._plugin_id}\nNo permission to execute process."), + message_type = Message.MessageType.ERROR) except FileNotFoundError: - Logger.logException("e", f"Unable to find backend_plugin executable [{self._plugin_id}]") + Logger.logException("e", f"Unable to find local EnginePlugin server executable for: {self._plugin_id}") + self._showMessage(self.catalog.i18nc("@info:plugin_failed", + f"Unable to find local EnginePlugin server executable for: {self._plugin_id}"), + message_type = Message.MessageType.ERROR) except BlockingIOError: - Logger.logException("e", f"Couldn't start backend_plugin [{self._plugin_id}]: Resource is temporarily unavailable") + Logger.logException("e", f"Couldn't start EnginePlugin: {self._plugin_id} Resource is temporarily unavailable") + self._showMessage(self.catalog.i18nc("@info:plugin_failed", + f"Couldn't start EnginePlugin: {self._plugin_id}\nResource is temporarily unavailable"), + message_type = Message.MessageType.ERROR) except OSError as e: - Logger.logException("e", f"Couldn't start backend_plugin [{self._plugin_id}]: Operating system is blocking it (antivirus?)") + Logger.logException("e", f"Couldn't start EnginePlugin {self._plugin_id} Operating system is blocking it (antivirus?)") + self._showMessage(self.catalog.i18nc("@info:plugin_failed", + f"Couldn't start EnginePlugin: {self._plugin_id}\nOperating system is blocking it (antivirus?)"), + message_type = Message.MessageType.ERROR) return False def stop(self) -> bool: @@ -75,8 +88,15 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender): self._process.terminate() return_code = self._process.wait() self._is_running = False - Logger.log("d", f"Backend_plugin [{self._plugin_id}] was killed. Received return code {return_code}") + Logger.log("d", f"EnginePlugin: {self._plugin_id} was killed. Received return code {return_code}") return True except PermissionError: - Logger.log("e", "Unable to kill running engine. Access is denied.") + Logger.log("e", f"Unable to kill running EnginePlugin: {self._plugin_id} Access is denied.") + self._showMessage(self.catalog.i18nc("@info:plugin_failed", + f"Unable to kill running EnginePlugin: {self._plugin_id}\nAccess is denied."), + message_type = Message.MessageType.ERROR) return False + + def _showMessage(self, message: str, message_type: Message.MessageType = Message.MessageType.ERROR) -> None: + Message(message, title=self.catalog.i18nc("@info:title", "EnginePlugin"), message_type = message_type).show() + diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index ef073e6865..2577d227cc 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -203,7 +203,7 @@ class CuraEngineBackend(QObject, Backend): backend_plugins = CuraApplication.getInstance().getBackendPlugins() for backend_plugin in backend_plugins: if backend_plugin.isRunning(): - continue + backend_plugin.stop() # Set the port to prevent plugins from using the same one. backend_plugin.setPort(self._last_backend_plugin_port) self._last_backend_plugin_port += 1 From f634a5bd44e8d0e394b280c8445663caaf4f079d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 15 Aug 2023 11:27:15 +0200 Subject: [PATCH 037/118] Send over plugin name and version Might be needed during the handshake between engine and plugin Contributes to CURA-10619 --- cura/BackendPlugin.py | 3 ++- plugins/CuraEngineBackend/Cura.proto | 6 ++++-- plugins/CuraEngineBackend/StartSliceJob.py | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index a92e4fe405..b4a6ad8835 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -6,9 +6,10 @@ from typing import Optional, List from UM.Logger import Logger from UM.Message import Message from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender +from UM.PluginObject import PluginObject -class BackendPlugin(AdditionalSettingDefinitionsAppender): +class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): def __init__(self) -> None: super().__init__() self.__port: int = 0 diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index d5d7c92d0b..f60a7f96d8 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -19,8 +19,10 @@ enum SlotID { message EnginePlugin { SlotID id = 1; - optional string address = 2; - optional uint32 port = 3; + string address = 2; + uint32 port = 3; + string plugin_name = 4; + string plugin_version = 5; } message Slice diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index b1f92b3b25..892e4dfca6 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -314,6 +314,8 @@ class StartSliceJob(Job): plugin_message.id = slot plugin_message.address = plugin.getAddress() plugin_message.port = plugin.getPort() + plugin_message.plugin_name = plugin.getPluginId() + plugin_message.plugin_version = plugin.getVersion() for group in filtered_object_groups: group_message = self._slice_message.addRepeatedMessage("object_lists") From eadf9881ef57e25bcc2ee2ee7d92ff5f5bd2a983 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 16 Aug 2023 09:15:03 +0200 Subject: [PATCH 038/118] Use cura_10169 for the engine revert after merge Contributes CURA-10619 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index bcb276832b..d2cfbe3e41 100644 --- a/conanfile.py +++ b/conanfile.py @@ -303,7 +303,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10475") - self.requires("curaengine/(latest)@ultimaker/cura_10475") + self.requires("curaengine/(latest)@ultimaker/cura_10619") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") self.requires("uranium/(latest)@ultimaker/cura_10475") From b483537c43012b4009cae05559e251335e52ac02 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 16 Aug 2023 14:26:54 +0200 Subject: [PATCH 039/118] Explicitly use address for plugin_command Contributes CURA-10619 --- cura/BackendPlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index b4a6ad8835..1003d46009 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -43,7 +43,7 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): if not self._plugin_command or "--port" in self._plugin_command: return self._plugin_command or [] - return self._plugin_command + ["--port", str(self.__port)] + return self._plugin_command + ["--address", self.getAddress(), "--port", str(self.__port)] def start(self) -> bool: """ From 8cc54b0d8995b24a3680b5f1db1ad69cddb93219 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 16 Aug 2023 16:08:05 +0200 Subject: [PATCH 040/118] Add missing catalog to BackendPlugin Contribute to CURA-10619 --- cura/BackendPlugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index 1003d46009..bbdd622d5f 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -7,9 +7,12 @@ from UM.Logger import Logger from UM.Message import Message from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender from UM.PluginObject import PluginObject +from UM.i18n import i18nCatalog class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): + catalog = i18nCatalog("cura") + def __init__(self) -> None: super().__init__() self.__port: int = 0 From 4393603b8e0c3e2ce997c8d0740350ebc03e6fff Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 16 Aug 2023 21:08:52 +0200 Subject: [PATCH 041/118] pin curaengine channel --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index d2cfbe3e41..bcb276832b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -303,7 +303,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10475") - self.requires("curaengine/(latest)@ultimaker/cura_10619") + self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") self.requires("uranium/(latest)@ultimaker/cura_10475") From 55d27bd0afdafe46f0448102d888d73839eedf43 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 17 Aug 2023 00:15:32 +0200 Subject: [PATCH 042/118] Don't create shell windows when starting plugin Contribute to CURA-10619 --- cura/BackendPlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index bbdd622d5f..d51379ebb1 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -58,7 +58,7 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): # STDIN needs to be None because we provide no input, but communicate via a local socket instead. # The NUL device sometimes doesn't exist on some computers. Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}") - self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None) + self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None, creationflags = subprocess.CREATE_NO_WINDOW) self._is_running = True return True except PermissionError: From fa52469f5d179c2b932b7559d28319eaab313ad1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 17 Aug 2023 08:13:50 +0200 Subject: [PATCH 043/118] Make popen kwargs OS specific Contribute to CURA-10619 --- cura/BackendPlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/BackendPlugin.py b/cura/BackendPlugin.py index d51379ebb1..935b376c63 100644 --- a/cura/BackendPlugin.py +++ b/cura/BackendPlugin.py @@ -8,6 +8,7 @@ from UM.Message import Message from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender from UM.PluginObject import PluginObject from UM.i18n import i18nCatalog +from UM.Platform import Platform class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): @@ -58,7 +59,10 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject): # STDIN needs to be None because we provide no input, but communicate via a local socket instead. # The NUL device sometimes doesn't exist on some computers. Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}") - self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None, creationflags = subprocess.CREATE_NO_WINDOW) + popen_kwargs = {"stdin": None} + if Platform.isWindows(): + popen_kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW + self._process = subprocess.Popen(self._validatePluginCommand(), **popen_kwargs) self._is_running = True return True except PermissionError: From fc159a2f5d56cb7ef01fa488802bffc4371cf63d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 01:56:23 +0200 Subject: [PATCH 044/118] Also make sure that the packaging tools can be run Contributes to CURA-8415 --- .github/workflows/macos.yml | 22 ++++++++++++++++++---- .github/workflows/windows.yml | 30 +++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4c77692cff..1b8eab877f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -242,27 +242,39 @@ jobs: f.writelines(f"`{package.key}/{package.version}`\n") - name: Archive the artifacts (bash) - run: tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./dist/" + run: | + tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./dist/" + tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}-package.tar.gz" "./cura_inst/packaging/" - - name: upload the tarred dist folder + - name: upload the tarred dist and packaging folder uses: actions/upload-artifact@v3 with: name: dist path: | ${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz + ${{ steps.filename.outputs.INSTALLER_FILENAME }}-package.tar.gz retention-days: 5 cura-installer-create-dmg: needs: [ cura-installer-create ] runs-on: macos-11 steps: + - name: Setup Python and pip + uses: actions/setup-python@v4 + with: + python-version: '3.10.x' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements-conan-package.txt + - name: Download the dist uses: actions/download-artifact@v3 with: name: dist - name: untar the dist folder - run: tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.tar.gz" + run: | + tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.tar.gz" + tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-package.tar.gz" - name: Remove Macos keychain (Bash) run: security delete-keychain signing_temp.keychain || true @@ -309,7 +321,9 @@ jobs: name: dist - name: untar the dist folder - run: tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.tar.gz" + run: | + tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.tar.gz" + tar -zxf "./${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-package.tar.gz" - name: Remove Macos keychain (Bash) run: security delete-keychain signing_temp.keychain || true diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f335605b91..37f7975129 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -199,29 +199,40 @@ jobs: for package in pkg_resources.working_set: f.writelines(f"`{package.key}/{package.version}`\n") - - name: Archive the artifacts (Powershell) - run: Compress-Archive -Path ".\dist" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip" + run: | + Compress-Archive -Path ".\dist" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip" + Compress-Archive -Path ".\cura_inst\packaging\" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}-packaging.zip" - - name: upload the zipped dist folder + - name: upload the zipped dist and packaging folder uses: actions/upload-artifact@v3 with: name: dist path: | ${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip + ${{ steps.filename.outputs.INSTALLER_FILENAME }}-packaging.zip retention-days: 5 cura-installer-create-exe: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: + - name: Setup Python and pip + uses: actions/setup-python@v4 + with: + python-version: '3.10.x' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements-conan-package.txt + - name: Download the zipped dist uses: actions/download-artifact@v3 with: name: dist - name: Extract the zipped dist - run: Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.zip" -DestinationPath "." + run: | + Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.zip" -DestinationPath "." + Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-packaging.zip" -DestinationPath "." shell: powershell - name: Create PFX certificate from BASE64_PFX_CONTENT secret @@ -258,13 +269,22 @@ jobs: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: + - name: Setup Python and pip + uses: actions/setup-python@v4 + with: + python-version: '3.10.x' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements-conan-package.txt + - name: Download the dist uses: actions/download-artifact@v3 with: name: dist - name: Extract the zipped dist - run: Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.zip" -DestinationPath "." + run: | + Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.zip" -DestinationPath "." + Expand-Archive -Path ".\${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-packaging.zip" -DestinationPath "." shell: powershell - name: Create PFX certificate from BASE64_PFX_CONTENT secret From 05ded4885e8dcbe26635d747b1861919273dbcea Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 02:00:53 +0200 Subject: [PATCH 045/118] inherit secrets Contributes to CURA-8415 --- .github/workflows/installers.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 283fc76ee5..ead3b7a87a 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -35,6 +35,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: windows-2022 + secrets: inherit linux-modern-installer: uses: ./.github/workflows/linux.yml @@ -45,6 +46,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: ubuntu-22.04 + secrets: inherit linux-legacy-installer: uses: ./.github/workflows/linux.yml @@ -55,6 +57,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: ubuntu-20.04 + secrets: inherit macos-installer: uses: ./.github/workflows/macos.yml @@ -65,6 +68,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: macos-11.0 + secrets: inherit macos-arm-installer: uses: ./.github/workflows/macos.yml @@ -74,4 +78,5 @@ jobs: enterprise: ${{ inputs.enterprise }} staging: ${{ inputs.staging }} architecture: ARM64 - operating_system: self-hosted \ No newline at end of file + operating_system: self-hosted + secrets: inherit \ No newline at end of file From cf97b97d9e6bdbd62f64f312b3383957f6f4cd29 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 02:13:25 +0200 Subject: [PATCH 046/118] don't cache pip Contributes to CURA-8415 --- .github/workflows/macos.yml | 9 ++++++--- .github/workflows/windows.yml | 8 ++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1b8eab877f..418e99c470 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -259,12 +259,10 @@ jobs: needs: [ cura-installer-create ] runs-on: macos-11 steps: - - name: Setup Python and pip + - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - name: Download the dist uses: actions/download-artifact@v3 @@ -315,6 +313,11 @@ jobs: needs: [ cura-installer-create ] runs-on: macos-11 steps: + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10.x' + - name: Download the dist uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 37f7975129..8c5cad9d68 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -217,12 +217,10 @@ jobs: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: - - name: Setup Python and pip + - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - name: Download the zipped dist uses: actions/download-artifact@v3 @@ -269,12 +267,10 @@ jobs: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: - - name: Setup Python and pip + - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - name: Download the dist uses: actions/download-artifact@v3 From deffdeb6427c1d4153851286ffe1f690554af6b0 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 02:42:17 +0200 Subject: [PATCH 047/118] checkout repo Contributes to CURA-8415 --- .github/workflows/macos.yml | 9 ++++++--- .github/workflows/windows.yml | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 418e99c470..024c64ad75 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -259,6 +259,9 @@ jobs: needs: [ cura-installer-create ] runs-on: macos-11 steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python uses: actions/setup-python@v4 with: @@ -313,6 +316,9 @@ jobs: needs: [ cura-installer-create ] runs-on: macos-11 steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python uses: actions/setup-python@v4 with: @@ -348,9 +354,6 @@ jobs: p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - name: Install MacOS system requirements - run: brew install create-dmg - - name: Create the Macos dmg and pkg (Bash) run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}" --build_pkg --app_name "$CURA_APP_NAME" working-directory: dist diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8c5cad9d68..ef26baa8ad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -217,6 +217,9 @@ jobs: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python uses: actions/setup-python@v4 with: @@ -267,6 +270,9 @@ jobs: needs: [ cura-installer-create ] runs-on: ${{ inputs.operating_system }} steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python uses: actions/setup-python@v4 with: From 365166e493c785949849628db9d19513631cfb5d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 03:01:53 +0200 Subject: [PATCH 048/118] few minor fixes Contributes to CURA-8415 --- .github/workflows/linux.yml | 1 - .github/workflows/macos.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 42312219d6..70a15bcbb5 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -179,7 +179,6 @@ jobs: run: | import os enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-${{ inputs.architecture }}" if "${{ inputs.operating_system }}" == "ubuntu-22.04": installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-${{ inputs.architecture }}" else: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 024c64ad75..e5e8ead2cd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -300,7 +300,7 @@ jobs: - name: Install MacOS system requirements run: brew install create-dmg - - name: Create the Macos dmg and pkg (Bash) + - name: Create the Macos dmg (Bash) run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}" --build_dmg --app_name "$CURA_APP_NAME" working-directory: dist @@ -354,7 +354,10 @@ jobs: p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - name: Create the Macos dmg and pkg (Bash) + - name: Install MacOS system requirements + run: brew install create-dmg + + - name: Create the Macos pkg (Bash) run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}" --build_pkg --app_name "$CURA_APP_NAME" working-directory: dist From ddc4ec473e7604a155789c5fbb83203fe2f0d81f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 03:05:54 +0200 Subject: [PATCH 049/118] no trailing / Contributes to CURA-8415 --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ef26baa8ad..568a3c30de 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -202,7 +202,7 @@ jobs: - name: Archive the artifacts (Powershell) run: | Compress-Archive -Path ".\dist" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip" - Compress-Archive -Path ".\cura_inst\packaging\" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}-packaging.zip" + Compress-Archive -Path ".\cura_inst\packaging" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}-packaging.zip" - name: upload the zipped dist and packaging folder uses: actions/upload-artifact@v3 From 28afca187c1feec77f3a8bb555b9039725435ae0 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 03:22:19 +0200 Subject: [PATCH 050/118] Nightlies Contributes to CURA-9494 --- .github/workflows/installers.yml | 103 ++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index ead3b7a87a..a0e11f63eb 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -24,6 +24,16 @@ on: default: false required: true type: boolean + nightly: + description: 'Upload to nightly release' + default: false + required: true + type: boolean + +env: + CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} + ENTERPRISE: ${{ inputs.enterprise }} + STAGING: ${{ inputs.staging }} jobs: windows-installer: @@ -79,4 +89,95 @@ jobs: staging: ${{ inputs.staging }} architecture: ARM64 operating_system: self-hosted - secrets: inherit \ No newline at end of file + secrets: inherit + + update-nightly-release: + runs-on: ubuntu-latest + needs: [ windows-installer, linux-modern-installer, linux-legacy-installer, macos-installer, macos-arm-installer ] + steps: + + - name: Output the name file name and extension + id: filename + shell: python + run: | + import os + enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" + linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64-AppImage" + linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64-AppImage" + mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64-dmg" + mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64-pkg" + mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64-dmg" + mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64-pkg" + win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64-msi + win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64-exe" + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"LINUX_MODERN={linux_modern}\n") + f.writelines(f"LINUX_LEGACY={linux_legacy}\n") + f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") + f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") + f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") + f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") + f.writelines(f"WIN_MSI={win_msi}\n") + f.writelines(f"WIN_EXE={win_exe}\n") + + - name: Download linux modern installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.LINUX_MODERN }} + path: installers + + - name: Download linux legacy installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.LINUX_LEGACY }} + path: installers + + - name: Download mac x64 dmg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_X64_DMG }} + path: installers + + - name: Download mac x64 pkg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_X64_PKG }} + path: installers + + - name: Download mac arm dmg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_ARM_DMG }} + path: installers + + - name: Download mac arm pkg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_ARM_PKG }} + path: installers + + - name: Download win msi installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.WIN_MSI }} + path: installers + + - name: Download win exe installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.WIN_EXE }} + path: installers + + - name: Update nightly release + uses: pyTooling/Actions/releaser@main + with: + tag: nightly + rm: true + token: ${{ secrets.GITHUB_TOKEN }} + files: installers/*.* \ No newline at end of file From 76787b9898936cb7617bd34887263f0afe66c63b Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 19 Aug 2023 03:31:48 +0200 Subject: [PATCH 051/118] Update installers.yml for nightly release option Added a conditional statement for optionally triggering nightly releases in the installer workflow. This change allows us to initiate automatic nightly builds only when required, contributing to efficiency and resource utilization optimization. This is linked to Jira task CURA-9494. --- .github/workflows/installers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index a0e11f63eb..1a3a96bae0 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -92,6 +92,7 @@ jobs: secrets: inherit update-nightly-release: + if: ${{ inputs.nightly }} runs-on: ubuntu-latest needs: [ windows-installer, linux-modern-installer, linux-legacy-installer, macos-installer, macos-arm-installer ] steps: From ae33d03eb25faa3d7fc7ed5a4e83e60a021ffa2a Mon Sep 17 00:00:00 2001 From: GregValiant <64202104+GregValiant@users.noreply.github.com> Date: Sat, 19 Aug 2023 08:42:27 -0400 Subject: [PATCH 052/118] Update LimitXYAccelJerk.py Add Exit for Ultimaker printers. Add notice that Accel is not-extruder specific. Changed variable names to lower case. --- .../scripts/LimitXYAccelJerk.py | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py index 8932d8e4ea..d50726fc76 100644 --- a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py +++ b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py @@ -9,6 +9,10 @@ from ..Script import Script from cura.CuraApplication import CuraApplication import re +<<<<<<< Updated upstream +======= +from UM.Message import Message +>>>>>>> Stashed changes class LimitXYAccelJerk(Script): def __init__(self): @@ -16,13 +20,18 @@ class LimitXYAccelJerk(Script): def initialize(self) -> None: super().initialize() +<<<<<<< Updated upstream # Get the Accel and Jerk and set the values in the setting boxes--------------------------------------------- +======= + # Get the Accel and Jerk and set the values in the setting boxes-- +>>>>>>> Stashed changes mycura = CuraApplication.getInstance().getGlobalContainerStack() extruder = mycura.extruderList accel_print = extruder[0].getProperty("acceleration_print", "value") accel_travel = extruder[0].getProperty("acceleration_travel", "value") jerk_print_old = extruder[0].getProperty("jerk_print", "value") jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") +<<<<<<< Updated upstream self._instance.setProperty("X_accel_limit", "value", round(accel_print)) self._instance.setProperty("Y_accel_limit", "value", round(accel_print)) self._instance.setProperty("X_jerk", "value", jerk_print_old) @@ -31,12 +40,36 @@ class LimitXYAccelJerk(Script): def getSettingDataString(self): return """{ "name": "Limit the X-Y Accel/Jerk", +======= + self._instance.setProperty("x_accel_limit", "value", round(accel_print)) + self._instance.setProperty("y_accel_limit", "value", round(accel_print)) + self._instance.setProperty("x_jerk", "value", jerk_print_old) + self._instance.setProperty("y_jerk", "value", jerk_print_old) + ext_count = int(mycura.getProperty("machine_extruder_count", "value")) + machine_name = str(mycura.getProperty("machine_name", "value")) + + # Warn the user if the printer is an Ultimaker------------------------- + if "Ultimaker" in machine_name: + Message(text = " [Limit the X-Y Accel/Jerk] WILL NOT RUN because Ultimaker printers have fixed beds (it is intended for 'bed slinger' printers only.").show() + + # Warn the user if the printer is multi-extruder------------------ + if ext_count > 1: + Message(text = " 'Limit the X-Y Accel/Jerk': The post processor treats all extruders the same. If you have multiple extruders they will all be subject to the same Accel and Jerk limits imposed. If you have different Travel and Print Accel they will be subject to the same limit. If that is not acceptable then you should not use this Post Processor.").show() + + def getSettingDataString(self): + return """{ + "name": "Limit the X-Y Accel/Jerk (all extruders equal)", +>>>>>>> Stashed changes "key": "LimitXYAccelJerk", "metadata": {}, "version": 2, "settings": { +<<<<<<< Updated upstream "X_accel_limit": +======= + "x_accel_limit": +>>>>>>> Stashed changes { "label": "X MAX Acceleration", "description": "If this number is lower than the 'X Print Accel' in Cura then this will limit the Accel on the X axis. Enter the Maximum Acceleration value for the X axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", @@ -46,7 +79,11 @@ class LimitXYAccelJerk(Script): "unit": "mm/sec² ", "default_value": 500 }, +<<<<<<< Updated upstream "Y_accel_limit": +======= + "y_accel_limit": +>>>>>>> Stashed changes { "label": "Y MAX Acceleration", "description": "If this number is lower than the Y accel in Cura then this will limit the Accel on the Y axis. Enter the Maximum Acceleration value for the Y axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", @@ -64,7 +101,11 @@ class LimitXYAccelJerk(Script): "enabled": true, "default_value": false }, +<<<<<<< Updated upstream "X_jerk": +======= + "x_jerk": +>>>>>>> Stashed changes { "label": " X jerk", "description": "Enter the Jerk value for the X axis. Enter '0' to use the existing X Jerk. This setting will affect both the Print and Travel jerk.", @@ -73,7 +114,11 @@ class LimitXYAccelJerk(Script): "unit": "mm/sec ", "default_value": 8 }, +<<<<<<< Updated upstream "Y_jerk": +======= + "y_jerk": +>>>>>>> Stashed changes { "label": " Y jerk", "description": "Enter the Jerk value for the Y axis. Enter '0' to use the existing Y Jerk. This setting will affect both the Print and Travel jerk.", @@ -136,6 +181,17 @@ class LimitXYAccelJerk(Script): def execute(self, data): mycura = CuraApplication.getInstance().getGlobalContainerStack() extruder = mycura.extruderList +<<<<<<< Updated upstream +======= + machine_name = str(mycura.getProperty("machine_name", "value")) + + # Exit if the printer is an Ultimaker------------------------- + if "Ultimaker" in machine_name: + Message(text = " [Limit the X-Y Accel/Jerk] DID NOT RUN. This post processor is not intended for fixed printers (for 'bed slinger' printers only.").show() + data[0] += "; [LimitXYAccelJerk] DID NOT RUN because the printer doesn't have a sliding bed.\n" + return data + +>>>>>>> Stashed changes constant_change = not bool(self.getSettingValueByKey("gradient_change")) accel_print_enabled = bool(extruder[0].getProperty("acceleration_enabled", "value")) accel_travel_enabled = bool(extruder[0].getProperty("acceleration_travel_enabled", "value")) @@ -145,6 +201,10 @@ class LimitXYAccelJerk(Script): jerk_travel_enabled = str(extruder[0].getProperty("jerk_travel_enabled", "value")) jerk_print_old = extruder[0].getProperty("jerk_print", "value") jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes if int(accel_print) >= int(accel_travel): accel_old = accel_print else: @@ -156,10 +216,17 @@ class LimitXYAccelJerk(Script): jerk_old = jerk_travel_old #Set the new Accel values--------------------------------------------------------------------------------- +<<<<<<< Updated upstream x_accel = str(self.getSettingValueByKey("X_accel_limit")) y_accel = str(self.getSettingValueByKey("Y_accel_limit")) x_jerk = int(self.getSettingValueByKey("X_jerk")) y_jerk = int(self.getSettingValueByKey("Y_jerk")) +======= + x_accel = str(self.getSettingValueByKey("x_accel_limit")) + y_accel = str(self.getSettingValueByKey("y_accel_limit")) + x_jerk = int(self.getSettingValueByKey("x_jerk")) + y_jerk = int(self.getSettingValueByKey("y_jerk")) +>>>>>>> Stashed changes # Put the strings together M201_limit_new = "M201 X" + x_accel + " Y" + y_accel M201_limit_old = "M201 X" + str(round(accel_old)) + " Y" + str(round(accel_old)) @@ -227,6 +294,7 @@ class LimitXYAccelJerk(Script): all else: data[len(data)-1] = M201_limit_old + "\n" + M205_jerk_old + "\n" + data[len(data)-1] +<<<<<<< Updated upstream return data @@ -236,6 +304,29 @@ class LimitXYAccelJerk(Script): y_accel_hyst = round((accel_old - int(y_accel)) / layer_spread) x_accel_start = round(round((accel_old - x_accel_hyst)/50)*50) y_accel_start = round(round((accel_old - y_accel_hyst)/50)*50) +======= + return data + + elif not constant_change: + layer_spread = end_index - start_index + if accel_old >= int(x_accel): + x_accel_hyst = round((accel_old - int(x_accel)) / layer_spread) + else: + x_accel_hyst = round((int(x_accel) - accel_old) / layer_spread) + if accel_old >= int(y_accel): + y_accel_hyst = round((accel_old - int(y_accel)) / layer_spread) + else: + y_accel_hyst = round((int(y_accel) - accel_old) / layer_spread) + + if accel_old >= int(x_accel): + x_accel_start = round(round((accel_old - x_accel_hyst)/25)*25) + else: + x_accel_start = round(round((x_accel_hyst + accel_old)/25)*25) + if accel_old >= int(y_accel): + y_accel_start = round(round((accel_old - y_accel_hyst)/25)*25) + else: + y_accel_start = round(round((y_accel_hyst + accel_old)/25)*25) +>>>>>>> Stashed changes M201_limit_new = "M201 X" + str(x_accel_start) + " Y" + str(y_accel_start) #Add Accel limit and new Jerk at start layer------------------------------------------------------------- layer = data[start_index] @@ -250,11 +341,27 @@ class LimitXYAccelJerk(Script): for num in range(start_index + 1, end_index,1): layer = data[num] lines = layer.split("\n") +<<<<<<< Updated upstream x_accel_start -= x_accel_hyst if x_accel_start < int(x_accel): x_accel_start = int(x_accel) y_accel_start -= y_accel_hyst if y_accel_start < int(y_accel): y_accel_start = int(y_accel) M201_limit_new = "M201 X" + str(round(round(x_accel_start/50)*50)) + " Y" + str(round(round(y_accel_start/50)*50)) +======= + if accel_old >= int(x_accel): + x_accel_start -= x_accel_hyst + if x_accel_start < int(x_accel): x_accel_start = int(x_accel) + else: + x_accel_start += x_accel_hyst + if x_accel_start > int(x_accel): x_accel_start = int(x_accel) + if accel_old >= int(y_accel): + y_accel_start -= y_accel_hyst + if y_accel_start < int(y_accel): y_accel_start = int(y_accel) + else: + y_accel_start += y_accel_hyst + if y_accel_start > int(y_accel): y_accel_start = int(y_accel) + M201_limit_new = "M201 X" + str(round(round(x_accel_start/25)*25)) + " Y" + str(round(round(y_accel_start/25)*25)) +>>>>>>> Stashed changes for index, line in enumerate(lines): if line.startswith(";LAYER:"): lines.insert(index+1, M201_limit_new) From 43036953162739d77ec4a274cd45b59b16cffcec Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 20 Aug 2023 14:08:00 +0200 Subject: [PATCH 053/118] Add automatic scheduled updates for nightly release A daily schedule for the update-nightly-release workflow was added. Now, apart from when the 'nightly' input is set to true, the release update will be triggered everyday at 5:20 CET. This functionality allows more up to date releases without manual input. Also, installer file names were updated and it now includes the daily creation timestamp which provides visibility on when the nightly build was generated. Contributes to CURA-9494 --- .github/workflows/installers.yml | 89 +++++++++++++++++++++++--------- .github/workflows/linux.yml | 15 ++++++ .github/workflows/macos.yml | 15 ++++++ .github/workflows/windows.yml | 15 ++++++ 4 files changed, 111 insertions(+), 23 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 1a3a96bae0..451387eddd 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -29,6 +29,9 @@ on: default: false required: true type: boolean + schedule: + # Daily at 5:20 CET + - cron: '20 4 * * *' env: CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} @@ -91,26 +94,41 @@ jobs: operating_system: self-hosted secrets: inherit + # Run and update nightly release when the nightly input is set to true or if the schedule is triggered update-nightly-release: - if: ${{ inputs.nightly }} + if: ${{ inputs.nightly == 'true' || github.event_name == 'schedule' }} runs-on: ubuntu-latest needs: [ windows-installer, linux-modern-installer, linux-legacy-installer, macos-installer, macos-arm-installer ] steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download the run info + uses: actions/download-artifact@v2 + with: + name: macos-run-info + + - name: Set the run info as environment variables + run: | + . run_info.sh - name: Output the name file name and extension id: filename shell: python run: | import os + import datetime enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64-AppImage" - linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64-AppImage" - mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64-dmg" - mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64-pkg" - mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64-dmg" - mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64-pkg" - win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64-msi - win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64-exe" + linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" + linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" + mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] + nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) output_env = os.environ["GITHUB_OUTPUT"] content = "" if os.path.exists(output_env): @@ -126,59 +144,84 @@ jobs: f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") f.writelines(f"WIN_MSI={win_msi}\n") f.writelines(f"WIN_EXE={win_exe}\n") + f.writelines(f"NIGHTLY_NAME={nightly_name}\n") + f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.LINUX_MODERN }} + name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.LINUX_LEGACY }} + name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage path: installers - name: Download mac x64 dmg installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.MAC_X64_DMG }} + name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg path: installers - name: Download mac x64 pkg installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.MAC_X64_PKG }} + name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg path: installers - name: Download mac arm dmg installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.MAC_ARM_DMG }} + name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg path: installers - name: Download mac arm pkg installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.MAC_ARM_PKG }} + name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg path: installers - name: Download win msi installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.WIN_MSI }} + name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts uses: actions/download-artifact@v2 with: - name: ${{ steps.filename.outputs.WIN_EXE }} + name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers + - name: Rename installers to nightlies + run: | + mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage + mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage + mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg + mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg + mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg + mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg + mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi + mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe + - name: Update nightly release - uses: pyTooling/Actions/releaser@main - with: - tag: nightly - rm: true - token: ${{ secrets.GITHUB_TOKEN }} - files: installers/*.* \ No newline at end of file + run: | + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update nightly release description (with date) + run: | + gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}-alpha" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4d58dcee34..7f68aed0b4 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -252,6 +252,21 @@ jobs: dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage retention-days: 5 + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: linux-run-info + path: | + run_info.sh + retention-days: 5 + notify-export: if: ${{ always() }} needs: [ cura-installer-create ] diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4690d27878..6ba952d6bd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -259,6 +259,21 @@ jobs: dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.pkg retention-days: 5 + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: macos-run-info + path: | + run_info.sh + retention-days: 5 + notify-export: if: ${{ always() }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 88d9d84e94..9844d7724c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -251,6 +251,21 @@ jobs: dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe retention-days: 5 + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: windows-run-info + path: | + run_info.sh + retention-days: 5 + notify-export: if: ${{ always() }} needs: [ cura-installer-create ] From d90da61f44199fe688dbc30bd5f216182d5f2dc3 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 20 Aug 2023 18:20:25 +0200 Subject: [PATCH 054/118] Fixed nighlty title alpha Contributes to CURA-9494 --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 451387eddd..169d6af22a 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -221,7 +221,7 @@ jobs: - name: Update nightly release description (with date) run: | - gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}-alpha" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" + gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ac60b59da592eaea08af8d969a06f59c80002ca1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 20 Aug 2023 18:53:25 +0200 Subject: [PATCH 055/118] Fixed nightlies run check Contributes to CURA-9494 --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 169d6af22a..96b67a0541 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -96,7 +96,7 @@ jobs: # Run and update nightly release when the nightly input is set to true or if the schedule is triggered update-nightly-release: - if: ${{ inputs.nightly == 'true' || github.event_name == 'schedule' }} + if: ${{ inputs.nightly || github.event_name == 'schedule' }} runs-on: ubuntu-latest needs: [ windows-installer, linux-modern-installer, linux-legacy-installer, macos-installer, macos-arm-installer ] steps: From 7efe485f65f31dc5e58a2c10cd298a7f4d9b0dc2 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 20 Aug 2023 19:24:38 +0200 Subject: [PATCH 056/118] Show version in Title bar except for actual releases Contributes to CURA-9494 --- cura/CuraApplication.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 64d88d13dc..e81584660a 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -50,6 +50,7 @@ from UM.Settings.Validator import Validator from UM.View.SelectionPass import SelectionPass # For typing. from UM.Workspace.WorkspaceReader import WorkspaceReader from UM.i18n import i18nCatalog +from UM.Version import Version from cura import ApplicationMetadata from cura.API import CuraAPI from cura.API.Account import Account @@ -614,6 +615,9 @@ class CuraApplication(QtApplication): def _onEngineCreated(self): self._qml_engine.addImageProvider("print_job_preview", PrintJobPreviewImageProvider.PrintJobPreviewImageProvider()) + version = Version(self.getVersion()) + if version.hasPostFix(): + self._qml_engine.rootObjects()[0].setTitle(f"{ApplicationMetadata.CuraAppDisplayName} {ApplicationMetadata.CuraVersion}") @pyqtProperty(bool) def needToShowUserAgreement(self) -> bool: From 6424c26f782a9ec3dcccfd24dc8b81e543c28aed Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 20 Aug 2023 19:41:58 +0200 Subject: [PATCH 057/118] Show warning message when using nightly build Only shown in builds, for alpha versions Contributes to CURA-9494 --- cura/CuraApplication.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index e81584660a..44ea69bd74 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -616,8 +616,15 @@ class CuraApplication(QtApplication): def _onEngineCreated(self): self._qml_engine.addImageProvider("print_job_preview", PrintJobPreviewImageProvider.PrintJobPreviewImageProvider()) version = Version(self.getVersion()) - if version.hasPostFix(): + if hasattr(sys, "frozen") and version.hasPostFix() and "beta" not in version.getPostfixType(): self._qml_engine.rootObjects()[0].setTitle(f"{ApplicationMetadata.CuraAppDisplayName} {ApplicationMetadata.CuraVersion}") + message = Message( + self._i18n_catalog.i18nc("@info:warning", + f"This version is not intended for production use. If you encounter any issues, please report them on our GitHub page, mentioning the full version {self.getVersion()}"), + lifetime = 0, + title = self._i18n_catalog.i18nc("@info:title", "Nightly build"), + message_type = Message.MessageType.WARNING) + message.show() @pyqtProperty(bool) def needToShowUserAgreement(self) -> bool: From 413aa181ff782de33ffc971f20691a8b2ba9d682 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 28 Aug 2023 12:42:16 +0200 Subject: [PATCH 058/118] Update conan version CURA-10446 --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 26d167db2b..6b4d4cffc8 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan==1.56.0 +conan==1.60.2 sip From 247025ffc488d42c345760318cdef77c60235a98 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 13:48:47 +0200 Subject: [PATCH 059/118] Use curaengine from cura_10446 Contributes CURA-10466 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index bcb276832b..608a450c39 100644 --- a/conanfile.py +++ b/conanfile.py @@ -303,7 +303,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10475") - self.requires("curaengine/(latest)@ultimaker/cura_10475") + self.requires("curaengine/(latest)@ultimaker/cura_10446") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") self.requires("uranium/(latest)@ultimaker/cura_10475") From 93b10cb770f6d25c8d3db85cd43a6ccc6a187e9f Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 28 Aug 2023 14:49:51 +0200 Subject: [PATCH 060/118] Revert "Update conan version" This reverts commit 413aa181ff782de33ffc971f20691a8b2ba9d682. --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 6b4d4cffc8..26d167db2b 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan==1.60.2 +conan==1.56.0 sip From d7a218b30246e158d4b618fd3f9051980ced2627 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 15:36:46 +0200 Subject: [PATCH 061/118] Bundle the gradualflow plugin Contributes CURA-10466 --- .gitignore | 1 + conanfile.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 048bb915c7..90171b3561 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ Ultimaker-Cura.spec .run/ /printer-linter/src/printerlinter.egg-info/ /resources/qml/Dialogs/AboutDialogVersionsList.qml +/plugins/CuraEngineGradualFlow diff --git a/conanfile.py b/conanfile.py index 608a450c39..3a6dbdf1a5 100644 --- a/conanfile.py +++ b/conanfile.py @@ -304,6 +304,7 @@ class CuraConan(ConanFile): self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10475") self.requires("curaengine/(latest)@ultimaker/cura_10446") + self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/cura_10951") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") self.requires("uranium/(latest)@ultimaker/cura_10475") @@ -395,6 +396,16 @@ class CuraConan(ConanFile): self.copy("*.pyi", src = "@libdirs", dst = self._site_packages) self.copy("*.dylib", src = "@libdirs", dst = self._script_dir) + if self.settings.arch == "x86_64" or self.settings.arch == "armv8": + # Copy the external plugins that we want to bundle with Cura + curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info + print(curaengine_plugin_gradual_flow.resdirs) + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) + copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + def deploy(self): # Copy CuraEngine.exe to bindirs of Virtual Python Environment curaengine = self.dependencies["curaengine"].cpp_info @@ -476,6 +487,14 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV icon_path = "'{}'".format(os.path.join(self.package_folder, self.cpp_info.resdirs[2], self.conan_data["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"), entitlements_file = entitlements_file if self.settings.os == "Macos" else "None") + if self.settings.arch == "x86_64" or self.settings.arch == "armv8": + # Copy the external plugins that we want to bundle with Cura + curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) + copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) def package(self): copy(self, "cura_app.py", src = self.source_folder, dst = os.path.join(self.package_folder, self.cpp.package.bindirs[0])) From c3354472929b4576edca14ea528d593389d9267b Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 16:37:09 +0200 Subject: [PATCH 062/118] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 26d167db2b..5efbf3f18b 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ conan==1.56.0 -sip +sip==6.7.9 From 72db652aecfad6e6523fc5cfc7c550cfb6190391 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 17:32:45 +0200 Subject: [PATCH 063/118] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 5efbf3f18b..48121932b8 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ conan==1.56.0 -sip==6.7.9 +sip==6.7.1 From b648eddfd795d8a1301e1b654058acbad133dd01 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 17:33:15 +0200 Subject: [PATCH 064/118] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 6b4d4cffc8..fd101a0b3a 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ conan==1.60.2 -sip +sip==6.7.1 From 7cb2e96b63598f3ac7d436bc7782982118ba3d5c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 08:24:01 +0200 Subject: [PATCH 065/118] Use pyarcus 10951 Contributes to CURA-10951 and CURA-10446 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 3a6dbdf1a5..e9de241947 100644 --- a/conanfile.py +++ b/conanfile.py @@ -302,7 +302,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.81.0") - self.requires("pyarcus/(latest)@ultimaker/cura_10475") + self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10446") self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/cura_10951") self.requires("pysavitar/5.2.2") From 2f166a545cedc90486364c5e24b6c54b5dae81e8 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 08:25:35 +0200 Subject: [PATCH 066/118] Use pyarcus from CURA-10951 Contributes to CURA-10951 and CURA-10446 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 608a450c39..a4a752a2f2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -302,7 +302,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.81.0") - self.requires("pyarcus/(latest)@ultimaker/cura_10475") + self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10446") self.requires("pysavitar/5.2.2") self.requires("pynest2d/5.2.2") From ea43f61ae4e34fb08f230227eb98d63ca1b57904 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 09:03:39 +0200 Subject: [PATCH 067/118] Use pynest from CURA-10951 Contributes to CURA-10951 and CURA-10446 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index a4a752a2f2..2813daa79b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -305,7 +305,7 @@ class CuraConan(ConanFile): self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10446") self.requires("pysavitar/5.2.2") - self.requires("pynest2d/5.2.2") + self.requires("pynest2d/(latest)@ultimaker/cura_10951") self.requires("uranium/(latest)@ultimaker/cura_10475") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") From 8a4dd000f1faf1b2e9e1b6d88ed69d9edc755eb6 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 09:26:08 +0200 Subject: [PATCH 068/118] Use pysavitar from CURA-10951 Contributes to CURA-10951 and CURA-10446 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 2813daa79b..7725ade370 100644 --- a/conanfile.py +++ b/conanfile.py @@ -304,7 +304,7 @@ class CuraConan(ConanFile): self.requires("boost/1.81.0") self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10446") - self.requires("pysavitar/5.2.2") + self.requires("pysavitar/(latest)@ultimaker/cura_10951") self.requires("pynest2d/(latest)@ultimaker/cura_10951") self.requires("uranium/(latest)@ultimaker/cura_10475") self.requires("cura_binary_data/(latest)@ultimaker/testing") From 89fe3d2777c51b40403870acd51c6e783d8cb730 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 13:07:23 +0200 Subject: [PATCH 069/118] Don't use the import method This will be deprecated, since we are also using self.dependencies we should do this in the generate. Contributes to CURA-10951 --- conanfile.py | 93 +++++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/conanfile.py b/conanfile.py index d7eed0799c..35c683f5dc 100644 --- a/conanfile.py +++ b/conanfile.py @@ -341,7 +341,47 @@ class CuraConan(ConanFile): vr.generate() self._generate_cura_version(os.path.join(self.source_folder, "cura")) + self._generate_about_versions(os.path.join(self.source_folder, "resources","qml", "Dialogs")) + if not self.in_local_cache: + # Copy CuraEngine.exe to bindirs of Virtual Python Environment + curaengine = self.dependencies["curaengine"].cpp_info + copy(self, "CuraEngine.exe", curaengine.bindirs[0], self.source_folder, keep_path = False) + copy(self, "CuraEngine", curaengine.bindirs[0], self.source_folder, keep_path = False) + + # Copy the external plugins that we want to bundle with Cura + rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) + curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) + copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + + # Copy resources of cura_binary_data + cura_binary_data = self.dependencies["cura_binary_data"].cpp_info + copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) + copy(self, "*", cura_binary_data.resdirs[1], str(self._share_dir.joinpath("uranium")), keep_path = True) + if self.settings.os == "Windows": + copy(self, "*", cura_binary_data.resdirs[2], str(self._share_dir.joinpath("windows")), keep_path = True) + + for dependency in self.dependencies.host.values(): + for bindir in dependency.cpp_info.bindirs: + copy(self, "*.dll", bindir, str(self._site_packages), keep_path = False) + for libdir in dependency.cpp_info.libdirs: + copy(self, "*.pyd", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.pyi", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.dylib", libdir, str(self._base_dir.joinpath("lib")), keep_path = False) + + # Copy materials (flat) + rmdir(self, os.path.join(self.source_folder, "resources", "materials")) + fdm_materials = self.dependencies["fdm_materials"].cpp_info + copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) + + # Copy internal resources + if self.options.internal: + cura_private_data = self.dependencies["cura_private_data"].cpp_info + copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) if self.options.devtools: entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements")) @@ -360,8 +400,6 @@ class CuraConan(ConanFile): pot = self.python_requires["translationextractor"].module.ExtractTranslations(self, cpp_info.bindirs[0]) pot.generate() - self._generate_about_versions(os.path.join(self.source_folder, "resources","qml", "Dialogs")) - def build(self): if self.options.devtools: if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str): @@ -373,44 +411,20 @@ class CuraConan(ConanFile): cpp_info = self.dependencies["gettext"].cpp_info self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) - def imports(self): - self.copy("CuraEngine.exe", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) - self.copy("CuraEngine", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) - - rmdir(self, os.path.join(self.source_folder, "resources", "materials")) - self.copy("*.fdm_material", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) - self.copy("*.sig", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) - - if self.options.internal: - self.copy("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0], - dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) - - # Copy resources of cura_binary_data - self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[0], - dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) - self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[1], - dst =self._share_dir.joinpath("uranium", "resources"), keep_path = True) - - self.copy("*.dll", src = "@bindirs", dst = self._site_packages) - self.copy("*.pyd", src = "@libdirs", dst = self._site_packages) - self.copy("*.pyi", src = "@libdirs", dst = self._site_packages) - self.copy("*.dylib", src = "@libdirs", dst = self._script_dir) - - if self.settings.arch == "x86_64" or self.settings.arch == "armv8": - # Copy the external plugins that we want to bundle with Cura - curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) - copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) - curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) - copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - def deploy(self): # Copy CuraEngine.exe to bindirs of Virtual Python Environment curaengine = self.dependencies["curaengine"].cpp_info copy(self, "CuraEngine.exe", curaengine.bindirs[0], str(self._base_dir), keep_path = False) copy(self, "CuraEngine", curaengine.bindirs[0], str(self._base_dir), keep_path = False) + # Copy the external plugins that we want to bundle with Cura + curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) + copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + # Copy resources of Cura (keep folder structure) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.bindirs[0]), str(self._base_dir), keep_path = False) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.libdirs[0]), str(self._site_packages.joinpath("cura")), keep_path = True) @@ -486,15 +500,6 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV icon_path = "'{}'".format(os.path.join(self.package_folder, self.cpp_info.resdirs[2], self.conan_data["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"), entitlements_file = entitlements_file if self.settings.os == "Macos" else "None") - if self.settings.arch == "x86_64" or self.settings.arch == "armv8": - # Copy the external plugins that we want to bundle with Cura - curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) - copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - def package(self): copy(self, "cura_app.py", src = self.source_folder, dst = os.path.join(self.package_folder, self.cpp.package.bindirs[0])) copy(self, "*", src = os.path.join(self.source_folder, "cura"), dst = os.path.join(self.package_folder, self.cpp.package.libdirs[0])) @@ -517,8 +522,6 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV self.runenv_info.append_path("PYTHONPATH", os.path.join(self.source_folder, "plugins")) def package_id(self): - self.info.clear() - # The following options shouldn't be used to determine the hash, since these are only used to set the CuraVersion.py # which will als be generated by the deploy method during the `conan install cura/5.1.0@_/_` del self.info.options.enterprise From 8f0fb5ef12f72b63223b28cd8fc3f358f36a29bc Mon Sep 17 00:00:00 2001 From: GregValiant <64202104+GregValiant@users.noreply.github.com> Date: Tue, 29 Aug 2023 07:51:58 -0400 Subject: [PATCH 070/118] Update LimitXYAccelJerk.py Changes made per Rburema requests. --- .../scripts/LimitXYAccelJerk.py | 174 ++++++------------ 1 file changed, 60 insertions(+), 114 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py index d50726fc76..b47a5876d8 100644 --- a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py +++ b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py @@ -5,42 +5,26 @@ # The existing M201 Max Accel will be changed to limit the Y (and/or X) accel at the printer. If you have Accel enabled in Cura and the XY Accel is set to 3000 then setting the Y limit to 1000 will result in the printer limiting the Y to 1000. This can keep tall skinny prints from breaking loose of the bed and failing. The script was not tested with Junction Deviation. # If enabled - the Jerk setting is changed line-by-line within the gcode as there is no "limit" on Jerk. # if 'Gradual ACCEL change' is enabled then the Accel is changed gradually from the Start to the End layer and that will be the final Accel setting in the file. If 'Gradual' is enabled then the Jerk settings will continue to be changed to the end of the file (rather than ending at the End layer). +# This post is intended for printers with moving beds (bed slingers) so UltiMaker printers are excluded. +# When setting an accel limit on multi-extruder printers ALL extruders are effected. +# This post does not distinguish between Print Accel and Travel Accel. The limit is the limit for all regardless. Example: Skin Accel = 1000 and Outer Wall accel = 500. If the limit is set to 300 then both Skin and Outer Wall will be Accel = 300. from ..Script import Script from cura.CuraApplication import CuraApplication import re -<<<<<<< Updated upstream -======= from UM.Message import Message ->>>>>>> Stashed changes class LimitXYAccelJerk(Script): - def __init__(self): - super().__init__() def initialize(self) -> None: super().initialize() -<<<<<<< Updated upstream - # Get the Accel and Jerk and set the values in the setting boxes--------------------------------------------- -======= # Get the Accel and Jerk and set the values in the setting boxes-- ->>>>>>> Stashed changes mycura = CuraApplication.getInstance().getGlobalContainerStack() extruder = mycura.extruderList accel_print = extruder[0].getProperty("acceleration_print", "value") accel_travel = extruder[0].getProperty("acceleration_travel", "value") jerk_print_old = extruder[0].getProperty("jerk_print", "value") jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") -<<<<<<< Updated upstream - self._instance.setProperty("X_accel_limit", "value", round(accel_print)) - self._instance.setProperty("Y_accel_limit", "value", round(accel_print)) - self._instance.setProperty("X_jerk", "value", jerk_print_old) - self._instance.setProperty("Y_jerk", "value", jerk_print_old) - - def getSettingDataString(self): - return """{ - "name": "Limit the X-Y Accel/Jerk", -======= self._instance.setProperty("x_accel_limit", "value", round(accel_print)) self._instance.setProperty("y_accel_limit", "value", round(accel_print)) self._instance.setProperty("x_jerk", "value", jerk_print_old) @@ -50,26 +34,31 @@ class LimitXYAccelJerk(Script): # Warn the user if the printer is an Ultimaker------------------------- if "Ultimaker" in machine_name: - Message(text = " [Limit the X-Y Accel/Jerk] WILL NOT RUN because Ultimaker printers have fixed beds (it is intended for 'bed slinger' printers only.").show() + Message(text = " [Limit the X-Y Accel/Jerk] DID NOT RUN because Ultimaker printers don't have sliding beds.").show() # Warn the user if the printer is multi-extruder------------------ if ext_count > 1: - Message(text = " 'Limit the X-Y Accel/Jerk': The post processor treats all extruders the same. If you have multiple extruders they will all be subject to the same Accel and Jerk limits imposed. If you have different Travel and Print Accel they will be subject to the same limit. If that is not acceptable then you should not use this Post Processor.").show() + Message(text = " 'Limit the X-Y Accel/Jerk': The post processor treats all extruders the same. If you have multiple extruders they will all be subject to the same Accel and Jerk limits imposed. If you have different Travel and Print Accel they will also be subject to the same limits. If that is not acceptable then you should not use this Post Processor.").show() def getSettingDataString(self): return """{ "name": "Limit the X-Y Accel/Jerk (all extruders equal)", ->>>>>>> Stashed changes "key": "LimitXYAccelJerk", "metadata": {}, "version": 2, "settings": { -<<<<<<< Updated upstream - "X_accel_limit": -======= + "type_of_change": + { + "label": "Immediate or Gradual change", + "description": "An 'Immediate' change will insert the new numbers immediately at the Start Layer. A 'Gradual' change will transition from the starting Accel to the new Accel limit across a range of layers.", + "type": "enum", + "options": { + "immediate_change": "Immediate", + "gradual_change": "Gradual"}, + "default_value": "immediate_change" + }, "x_accel_limit": ->>>>>>> Stashed changes { "label": "X MAX Acceleration", "description": "If this number is lower than the 'X Print Accel' in Cura then this will limit the Accel on the X axis. Enter the Maximum Acceleration value for the X axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", @@ -79,11 +68,7 @@ class LimitXYAccelJerk(Script): "unit": "mm/sec² ", "default_value": 500 }, -<<<<<<< Updated upstream - "Y_accel_limit": -======= "y_accel_limit": ->>>>>>> Stashed changes { "label": "Y MAX Acceleration", "description": "If this number is lower than the Y accel in Cura then this will limit the Accel on the Y axis. Enter the Maximum Acceleration value for the Y axis. This will affect both Print and Travel Accel. If you enable an End Layer then at the end of that layer the Accel Limit will be reset (unless you choose 'Gradual' in which case the new limit goes to the top layer).", @@ -101,11 +86,7 @@ class LimitXYAccelJerk(Script): "enabled": true, "default_value": false }, -<<<<<<< Updated upstream - "X_jerk": -======= "x_jerk": ->>>>>>> Stashed changes { "label": " X jerk", "description": "Enter the Jerk value for the X axis. Enter '0' to use the existing X Jerk. This setting will affect both the Print and Travel jerk.", @@ -114,11 +95,7 @@ class LimitXYAccelJerk(Script): "unit": "mm/sec ", "default_value": 8 }, -<<<<<<< Updated upstream - "Y_jerk": -======= "y_jerk": ->>>>>>> Stashed changes { "label": " Y jerk", "description": "Enter the Jerk value for the Y axis. Enter '0' to use the existing Y Jerk. This setting will affect both the Print and Travel jerk.", @@ -135,7 +112,7 @@ class LimitXYAccelJerk(Script): "default_value": 1, "minimum_value": 1, "unit": "Lay# ", - "enabled": "not gradient_change" + "enabled": "type_of_change == 'immediate_change'" }, "end_layer": { @@ -145,15 +122,7 @@ class LimitXYAccelJerk(Script): "default_value": -1, "minimum_value": -1, "unit": "Lay# ", - "enabled": "not gradient_change" - }, - "gradient_change": - { - "label": "Gradual ACCEL Change", - "description": "Gradually change the Accel numbers 'From layer' - 'To Layer'. If Jerk is enabled the Jerk changes are not 'Gradual' because there is no Max Jerk setting. Unlike Constant change - using 'Gradual' the Accel and Jerk change continues from the End Layer to the end of the file.", - "type": "bool", - "default_value": false, - "enabled": true + "enabled": "type_of_change == 'immediate_change'" }, "gradient_start_layer": { @@ -163,7 +132,7 @@ class LimitXYAccelJerk(Script): "default_value": 1, "minimum_value": 1, "unit": "Lay# ", - "enabled": "gradient_change" + "enabled": "type_of_change == 'gradual_change'" }, "gradient_end_layer": { @@ -173,7 +142,7 @@ class LimitXYAccelJerk(Script): "default_value": -1, "minimum_value": -1, "unit": "Lay# ", - "enabled": "gradient_change" + "enabled": "type_of_change == 'gradual_change'" } } }""" @@ -181,18 +150,22 @@ class LimitXYAccelJerk(Script): def execute(self, data): mycura = CuraApplication.getInstance().getGlobalContainerStack() extruder = mycura.extruderList -<<<<<<< Updated upstream -======= machine_name = str(mycura.getProperty("machine_name", "value")) + print_sequence = str(mycura.getProperty("print_sequence", "value")) + + # Exit if 'one_at_a_time' is enabled------------------------- + if print_sequence == "one_at_a_time": + Message(text = " [Limit the X-Y Accel/Jerk] DID NOT RUN. This post processor is not compatible with 'One-at-a-Time' mode.").show() + data[0] += "; [LimitXYAccelJerk] DID NOT RUN because Cura is set to 'One-at-a-Time' mode.\n" + return data # Exit if the printer is an Ultimaker------------------------- if "Ultimaker" in machine_name: - Message(text = " [Limit the X-Y Accel/Jerk] DID NOT RUN. This post processor is not intended for fixed printers (for 'bed slinger' printers only.").show() + Message(text = " [Limit the X-Y Accel/Jerk] DID NOT RUN. This post processor is for bed slinger printers only.").show() data[0] += "; [LimitXYAccelJerk] DID NOT RUN because the printer doesn't have a sliding bed.\n" return data ->>>>>>> Stashed changes - constant_change = not bool(self.getSettingValueByKey("gradient_change")) + type_of_change = str(self.getSettingValueByKey("type_of_change")) accel_print_enabled = bool(extruder[0].getProperty("acceleration_enabled", "value")) accel_travel_enabled = bool(extruder[0].getProperty("acceleration_travel_enabled", "value")) accel_print = extruder[0].getProperty("acceleration_print", "value") @@ -201,10 +174,7 @@ class LimitXYAccelJerk(Script): jerk_travel_enabled = str(extruder[0].getProperty("jerk_travel_enabled", "value")) jerk_print_old = extruder[0].getProperty("jerk_print", "value") jerk_travel_old = extruder[0].getProperty("jerk_travel", "value") -<<<<<<< Updated upstream -======= ->>>>>>> Stashed changes if int(accel_print) >= int(accel_travel): accel_old = accel_print else: @@ -215,34 +185,29 @@ class LimitXYAccelJerk(Script): else: jerk_old = jerk_travel_old - #Set the new Accel values--------------------------------------------------------------------------------- -<<<<<<< Updated upstream - x_accel = str(self.getSettingValueByKey("X_accel_limit")) - y_accel = str(self.getSettingValueByKey("Y_accel_limit")) - x_jerk = int(self.getSettingValueByKey("X_jerk")) - y_jerk = int(self.getSettingValueByKey("Y_jerk")) -======= + #Set the new Accel values---------------------------------------------------------- x_accel = str(self.getSettingValueByKey("x_accel_limit")) y_accel = str(self.getSettingValueByKey("y_accel_limit")) x_jerk = int(self.getSettingValueByKey("x_jerk")) y_jerk = int(self.getSettingValueByKey("y_jerk")) ->>>>>>> Stashed changes - # Put the strings together - M201_limit_new = "M201 X" + x_accel + " Y" + y_accel - M201_limit_old = "M201 X" + str(round(accel_old)) + " Y" + str(round(accel_old)) + + # Put the strings together------------------------------------------- + m201_limit_new = "M201 X" + x_accel + " Y" + y_accel + m201_limit_old = "M201 X" + str(round(accel_old)) + " Y" + str(round(accel_old)) if x_jerk == 0: - M205_jerk_pattern = "Y(\d*)" - M205_jerk_new = "Y" + str(y_jerk) + m205_jerk_pattern = "Y(\d*)" + m205_jerk_new = "Y" + str(y_jerk) if y_jerk == 0: - M205_jerk_pattern = "X(\d*)" - M205_jerk_new = "X" + str(x_jerk) + m205_jerk_pattern = "X(\d*)" + m205_jerk_new = "X" + str(x_jerk) if x_jerk != 0 and y_jerk != 0: - M205_jerk_pattern = "M205 X(\d*) Y(\d*)" - M205_jerk_new = "M205 X" + str(x_jerk) + " Y" + str(y_jerk) - M205_jerk_old = "M205 X" + str(jerk_old) + " Y" + str(jerk_old) - + m205_jerk_pattern = "M205 X(\d*) Y(\d*)" + m205_jerk_new = "M205 X" + str(x_jerk) + " Y" + str(y_jerk) + m205_jerk_old = "M205 X" + str(jerk_old) + " Y" + str(jerk_old) + type_of_change = self.getSettingValueByKey("type_of_change") + #Get the indexes of the start and end layers---------------------------------------- - if constant_change: + if type_of_change == 'immediate_change': start_layer = int(self.getSettingValueByKey("start_layer"))-1 end_layer = int(self.getSettingValueByKey("end_layer")) else: @@ -264,14 +229,14 @@ class LimitXYAccelJerk(Script): end_index = len(data)-2 #Add Accel limit and new Jerk at start layer----------------------------------------------------- - if constant_change: + if type_of_change == "immediate_change": layer = data[start_index] lines = layer.split("\n") for index, line in enumerate(lines): if lines[index].startswith(";LAYER:"): - lines.insert(index+1,M201_limit_new) + lines.insert(index+1,m201_limit_new) if self.getSettingValueByKey("jerk_enable"): - lines.insert(index+2,M205_jerk_new) + lines.insert(index+2,m205_jerk_new) data[start_index] = "\n".join(lines) break @@ -281,33 +246,22 @@ class LimitXYAccelJerk(Script): lines = layer.split("\n") for index, line in enumerate(lines): if line.startswith("M205"): - lines[index] = re.sub(M205_jerk_pattern, M205_jerk_new, line) + lines[index] = re.sub(m205_jerk_pattern, m205_jerk_new, line) data[num] = "\n".join(lines) if end_layer != -1: try: layer = data[end_index-1] lines = layer.split("\n") - lines.insert(len(lines)-2,M201_limit_old) - lines.insert(len(lines)-2,M205_jerk_old) + lines.insert(len(lines)-2,m201_limit_old) + lines.insert(len(lines)-2,m205_jerk_old) data[end_index-1] = "\n".join(lines) except: all else: - data[len(data)-1] = M201_limit_old + "\n" + M205_jerk_old + "\n" + data[len(data)-1] -<<<<<<< Updated upstream - return data - - - elif not constant_change: - layer_spread = end_index - start_index - x_accel_hyst = round((accel_old - int(x_accel)) / layer_spread) - y_accel_hyst = round((accel_old - int(y_accel)) / layer_spread) - x_accel_start = round(round((accel_old - x_accel_hyst)/50)*50) - y_accel_start = round(round((accel_old - y_accel_hyst)/50)*50) -======= + data[len(data)-1] = m201_limit_old + "\n" + m205_jerk_old + "\n" + data[len(data)-1] return data - elif not constant_change: + elif type_of_change == "gradual_change": layer_spread = end_index - start_index if accel_old >= int(x_accel): x_accel_hyst = round((accel_old - int(x_accel)) / layer_spread) @@ -326,28 +280,20 @@ class LimitXYAccelJerk(Script): y_accel_start = round(round((accel_old - y_accel_hyst)/25)*25) else: y_accel_start = round(round((y_accel_hyst + accel_old)/25)*25) ->>>>>>> Stashed changes - M201_limit_new = "M201 X" + str(x_accel_start) + " Y" + str(y_accel_start) + m201_limit_new = "M201 X" + str(x_accel_start) + " Y" + str(y_accel_start) #Add Accel limit and new Jerk at start layer------------------------------------------------------------- layer = data[start_index] lines = layer.split("\n") for index, line in enumerate(lines): if lines[index].startswith(";LAYER:"): - lines.insert(index+1,M201_limit_new) + lines.insert(index+1,m201_limit_new) if self.getSettingValueByKey("jerk_enable"): - lines.insert(index+2,M205_jerk_new) + lines.insert(index+2,m205_jerk_new) data[start_index] = "\n".join(lines) break for num in range(start_index + 1, end_index,1): layer = data[num] lines = layer.split("\n") -<<<<<<< Updated upstream - x_accel_start -= x_accel_hyst - if x_accel_start < int(x_accel): x_accel_start = int(x_accel) - y_accel_start -= y_accel_hyst - if y_accel_start < int(y_accel): y_accel_start = int(y_accel) - M201_limit_new = "M201 X" + str(round(round(x_accel_start/50)*50)) + " Y" + str(round(round(y_accel_start/50)*50)) -======= if accel_old >= int(x_accel): x_accel_start -= x_accel_hyst if x_accel_start < int(x_accel): x_accel_start = int(x_accel) @@ -360,21 +306,21 @@ class LimitXYAccelJerk(Script): else: y_accel_start += y_accel_hyst if y_accel_start > int(y_accel): y_accel_start = int(y_accel) - M201_limit_new = "M201 X" + str(round(round(x_accel_start/25)*25)) + " Y" + str(round(round(y_accel_start/25)*25)) ->>>>>>> Stashed changes + m201_limit_new = "M201 X" + str(round(round(x_accel_start/25)*25)) + " Y" + str(round(round(y_accel_start/25)*25)) for index, line in enumerate(lines): if line.startswith(";LAYER:"): - lines.insert(index+1, M201_limit_new) + lines.insert(index+1, m201_limit_new) continue data[num] = "\n".join(lines) - #Alter any existing jerk lines. Accel lines can be ignored----------------------------------- + + #Alter any existing jerk lines. Accel lines can be ignored--------------- if self.getSettingValueByKey("jerk_enable"): for num in range(start_index,len(data)-1,1): layer = data[num] lines = layer.split("\n") for index, line in enumerate(lines): if line.startswith("M205"): - lines[index] = re.sub(M205_jerk_pattern, M205_jerk_new, line) + lines[index] = re.sub(m205_jerk_pattern, m205_jerk_new, line) data[num] = "\n".join(lines) - data[len(data)-1] = M201_limit_old + "\n" + M205_jerk_old + "\n" + data[len(data)-1] + data[len(data)-1] = m201_limit_old + "\n" + m205_jerk_old + "\n" + data[len(data)-1] return data \ No newline at end of file From 2f2b88fd24355c2c8c8b5ab84d718ef4f8945401 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 15:25:32 +0200 Subject: [PATCH 071/118] Use the source_folder as a rootfor materials Contributes to CURA-10951 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 35c683f5dc..25209af26c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -376,7 +376,7 @@ class CuraConan(ConanFile): # Copy materials (flat) rmdir(self, os.path.join(self.source_folder, "resources", "materials")) fdm_materials = self.dependencies["fdm_materials"].cpp_info - copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) + copy(self, "*", fdm_materials.resdirs[0], self.source_folder) # Copy internal resources if self.options.internal: From d3809f8bd7def1cfdcc0f7b5163df109c755cbdf Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 16:18:47 +0200 Subject: [PATCH 072/118] Still a header only Contributes to CURA-10951 --- conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conanfile.py b/conanfile.py index c1646fb558..ac1aebde3b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -522,6 +522,8 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV self.runenv_info.append_path("PYTHONPATH", os.path.join(self.source_folder, "plugins")) def package_id(self): + self.info.clear() + # The following options shouldn't be used to determine the hash, since these are only used to set the CuraVersion.py # which will als be generated by the deploy method during the `conan install cura/5.1.0@_/_` del self.info.options.enterprise From 015e6352130ff289a9949a75b3c7c704e6158b62 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 29 Aug 2023 22:46:35 +0200 Subject: [PATCH 073/118] Engine-plugins wouldn't always close. ... because the code to terminate them wasn't always called. Especially annoying on Windows, since the sub-program could aparently become a zomboid after termination of the main one(s). I guess this is still part of the still open CURA-10475 'branch' in a way? There is no other ticket that fits at the moment. --- .../CuraEngineBackend/CuraEngineBackend.py | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 2577d227cc..e64fb49191 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -200,14 +200,23 @@ class CuraEngineBackend(QObject, Backend): It assigns unique ports to each plugin to avoid conflicts. :return: """ + self.stopPlugins() + backend_plugins = CuraApplication.getInstance().getBackendPlugins() + for backend_plugin in backend_plugins: + # Set the port to prevent plugins from using the same one. + if backend_plugin.getPort() < 1: + backend_plugin.setPort(self._last_backend_plugin_port) + self._last_backend_plugin_port += 1 + backend_plugin.start() + + def stopPlugins(self) -> None: + """ + Ensure that all backend plugins will be terminated. + """ backend_plugins = CuraApplication.getInstance().getBackendPlugins() for backend_plugin in backend_plugins: if backend_plugin.isRunning(): backend_plugin.stop() - # Set the port to prevent plugins from using the same one. - backend_plugin.setPort(self._last_backend_plugin_port) - self._last_backend_plugin_port += 1 - backend_plugin.start() def _resetLastSliceTimeStats(self) -> None: self._time_start_process = None @@ -396,6 +405,8 @@ class CuraEngineBackend(QObject, Backend): if self._start_slice_job is not None: self._start_slice_job.cancel() + self.stopPlugins() + self.slicingCancelled.emit() self.processingProgress.emit(0) Logger.log("d", "Attempting to kill the engine process") @@ -795,6 +806,8 @@ class CuraEngineBackend(QObject, Backend): :param message: The protobuf message signalling that slicing is finished. """ + self.stopPlugins() + self.setState(BackendState.Done) self.processingProgress.emit(1.0) self._time_end_slice = time() @@ -1009,7 +1022,6 @@ class CuraEngineBackend(QObject, Backend): We should reset our state and start listening for new connections. """ - if not self._restart: if self._process: # type: ignore return_code = self._process.wait() @@ -1020,6 +1032,7 @@ class CuraEngineBackend(QObject, Backend): self.stopSlicing() else: Logger.log("d", "Backend finished slicing. Resetting process and socket.") + self.stopPlugins() self._process = None # type: ignore def _reportBackendError(self, _message_id: str, _action_id: str) -> None: From 0c9d802ab0a0bc43029ebc4e3987797e86de72f7 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Tue, 29 Aug 2023 23:19:13 +0200 Subject: [PATCH 074/118] use gcc-13 seems to be available for 20.04 as well: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test Contribute to CURA-10866 --- .github/workflows/linux.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5a18199e3c..9d534a2d1f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -124,18 +124,11 @@ jobs: chmod +x $GITHUB_WORKSPACE/appimagetool echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV - - name: Install GCC-12 on ubuntu-22.04 - if: ${{ startsWith(inputs.operating_system, 'ubuntu-22.04') }} + - name: Install GCC-13 run: | - sudo apt install g++-12 gcc-12 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 - - - name: Use GCC-10 on ubuntu-20.04 - if: ${{ startsWith(inputs.operating_system, 'ubuntu-20.04') }} - run: | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 + sudo apt install g++-13 gcc-13 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - name: Create the default Conan profile run: conan profile new default --detect --force From eeb3050e08f2bbd606e4d7cd71d9e1d381a85f1b Mon Sep 17 00:00:00 2001 From: jellespijker Date: Wed, 30 Aug 2023 10:44:28 +0200 Subject: [PATCH 075/118] Change the order of plugin deploy Contributes to CURA-10951 --- conanfile.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/conanfile.py b/conanfile.py index ac1aebde3b..b61a8e0251 100644 --- a/conanfile.py +++ b/conanfile.py @@ -352,8 +352,7 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) - copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True, excludes = ".gitignore") curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) @@ -417,20 +416,19 @@ class CuraConan(ConanFile): copy(self, "CuraEngine.exe", curaengine.bindirs[0], str(self._base_dir), keep_path = False) copy(self, "CuraEngine", curaengine.bindirs[0], str(self._base_dir), keep_path = False) - # Copy the external plugins that we want to bundle with Cura - curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) - copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - # Copy resources of Cura (keep folder structure) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.bindirs[0]), str(self._base_dir), keep_path = False) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.libdirs[0]), str(self._site_packages.joinpath("cura")), keep_path = True) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[0]), str(self._share_dir.joinpath("cura", "resources")), keep_path = True) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[1]), str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + # Copy the external plugins that we want to bundle with Cura + curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info + copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True, excludes = ".gitignore") + curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) + copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + # Copy materials (flat) fdm_materials = self.dependencies["fdm_materials"].cpp_info copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) From 0210b06fbb8179c38cd597e54566b72ad9dcafde Mon Sep 17 00:00:00 2001 From: jellespijker Date: Wed, 30 Aug 2023 10:51:53 +0200 Subject: [PATCH 076/118] Pyinstaller package directories from the instal directory Contributes to CURA-10951 --- conandata.yml | 4 ++++ conanfile.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conandata.yml b/conandata.yml index efbb7f8349..28179cecd9 100644 --- a/conandata.yml +++ b/conandata.yml @@ -19,6 +19,10 @@ pyinstaller: package: "cura" src: "plugins" dst: "share/cura/plugins" + curaengine_gradual_flow_plugin: + root: "." + src: "share/cura/plugins/CuraEngineGradualFlow" + dst: "share/cura/plugins/CuraEngineGradualFlow" cura_resources: package: "cura" src: "resources" diff --git a/conanfile.py b/conanfile.py index b61a8e0251..d459cdabb6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -210,8 +210,8 @@ class CuraConan(ConanFile): src_path = os.path.join(self.source_folder, data["src"]) else: src_path = os.path.join(self.deps_cpp_info[data["package"]].rootpath, data["src"]) - elif "root" in data: # get the paths relative from the sourcefolder - src_path = os.path.join(self.source_folder, data["root"], data["src"]) + elif "root" in data: # get the paths relative from the install folder + src_path = os.path.join(self.install_folder, data["root"], data["src"]) else: continue if Path(src_path).exists(): From 4517364eb3a3d258e9b572da92aaf2137c5173cf Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 30 Aug 2023 11:31:14 +0200 Subject: [PATCH 077/118] Copy the bundled external package info Contributes to CURA-10951 --- .gitignore | 1 + conanfile.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 90171b3561..8fe6978fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,4 @@ Ultimaker-Cura.spec /printer-linter/src/printerlinter.egg-info/ /resources/qml/Dialogs/AboutDialogVersionsList.qml /plugins/CuraEngineGradualFlow +/resources/bundled_packages/bundled_*.json diff --git a/conanfile.py b/conanfile.py index d459cdabb6..a68a649228 100644 --- a/conanfile.py +++ b/conanfile.py @@ -353,6 +353,7 @@ class CuraConan(ConanFile): rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True, excludes = ".gitignore") + copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) @@ -425,6 +426,7 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True, excludes = ".gitignore") + copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) From c30c403a651e0009958683ea2e123d8eddd56d69 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 30 Aug 2023 13:04:01 +0200 Subject: [PATCH 078/118] Don't exclude Contributes to CURA-10951 --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index a68a649228..d1d3399ed1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -352,7 +352,7 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True, excludes = ".gitignore") + copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) @@ -425,7 +425,7 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True, excludes = ".gitignore") + copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) From c62e392c81274b4609791ee20f3296eab742b15d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 30 Aug 2023 13:09:22 +0200 Subject: [PATCH 079/118] use Windows slashes on Windows Contributes to CURA-10951 --- conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index d1d3399ed1..0728a1c337 100644 --- a/conanfile.py +++ b/conanfile.py @@ -222,7 +222,9 @@ class CuraConan(ConanFile): if "package" in binary: # get the paths from conan package src_path = os.path.join(self.deps_cpp_info[binary["package"]].rootpath, binary["src"]) elif "root" in binary: # get the paths relative from the sourcefolder - src_path = os.path.join(self.source_folder, binary["root"], binary["src"]) + src_path = str(self.source_path.joinpath(binary["root"], binary["src"]).as_posix()) + if self.settings.os == "Windows": + src_path = src_path.replace("\\", "\\\\") else: continue if not Path(src_path).exists(): From 2d389a6819700f8bd9c7025d1dfd2ccbd286e46a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 30 Aug 2023 16:51:56 +0200 Subject: [PATCH 080/118] Windows packaging Contributes to CURA-10951 --- conandata.yml | 4 ++++ conanfile.py | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/conandata.yml b/conandata.yml index 28179cecd9..df87ba2113 100644 --- a/conandata.yml +++ b/conandata.yml @@ -23,6 +23,10 @@ pyinstaller: root: "." src: "share/cura/plugins/CuraEngineGradualFlow" dst: "share/cura/plugins/CuraEngineGradualFlow" + curaengine_gradual_flow_plugin_resources: + root: "." + src: "share/cura/resources/bundled_packages" + dst: "share/cura/resources/bundled_packages" cura_resources: package: "cura" src: "resources" diff --git a/conanfile.py b/conanfile.py index 0728a1c337..40d8aabe54 100644 --- a/conanfile.py +++ b/conanfile.py @@ -222,7 +222,7 @@ class CuraConan(ConanFile): if "package" in binary: # get the paths from conan package src_path = os.path.join(self.deps_cpp_info[binary["package"]].rootpath, binary["src"]) elif "root" in binary: # get the paths relative from the sourcefolder - src_path = str(self.source_path.joinpath(binary["root"], binary["src"]).as_posix()) + src_path = str(self.source_path.joinpath(binary["root"], binary["src"])) if self.settings.os == "Windows": src_path = src_path.replace("\\", "\\\\") else: @@ -354,7 +354,8 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) @@ -427,8 +428,9 @@ class CuraConan(ConanFile): # Copy the external plugins that we want to bundle with Cura curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("resources", "bundled_packages")), keep_path = False) + copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) + copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "resources", "bundled_packages")), keep_path = False) curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) From fc1135d9198e487067e0491c8a7576a1bfc04d02 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 31 Aug 2023 05:56:46 +0200 Subject: [PATCH 081/118] Use CURA-10475 engine conan package Contributes to CURA-10951 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index a06cd9a8e9..9004658c29 100644 --- a/conanfile.py +++ b/conanfile.py @@ -303,7 +303,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.82.0") self.requires("pyarcus/(latest)@ultimaker/cura_10951") - self.requires("curaengine/(latest)@ultimaker/cura_10446") + self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/(latest)@ultimaker/cura_10951") self.requires("pynest2d/(latest)@ultimaker/cura_10951") self.requires("uranium/(latest)@ultimaker/cura_10475") From f2948338aee1926000dabf69c003f3ea3028a45d Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 31 Aug 2023 06:01:16 +0200 Subject: [PATCH 082/118] Use shared curaengine_grpc_definitions Although not a direct dependency of Cura, still need to define it here, such that we can set it as shared for all dependencies. Needed to overcome the issues with glibc and static compiling of the gradual flow plugin on ubuntu 20.04 with gcc-13 Contributes to CURA-10951 --- conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conanfile.py b/conanfile.py index 041fd2b9b1..a401c8fe2f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -296,6 +296,7 @@ class CuraConan(ConanFile): self.options["pynest2d"].shared = True self.options["cpython"].shared = True self.options["boost"].header_only = True + self.options["curaengine_grpc_definitions"].shared = True def validate(self): version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) @@ -304,6 +305,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.82.0") + self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/(latest)@ultimaker/cura_10951") From f958d69f1cb4206c40bc4b2e3f8d71462b9a5ef3 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 31 Aug 2023 06:17:15 +0200 Subject: [PATCH 083/118] Override zlib version to 1.2.13 fixes incompatible mismatch in versions between pyarcus and protobuf Contributes to CURA-10951 --- conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conanfile.py b/conanfile.py index a401c8fe2f..ca84990cf5 100644 --- a/conanfile.py +++ b/conanfile.py @@ -306,6 +306,7 @@ class CuraConan(ConanFile): def requirements(self): self.requires("boost/1.82.0") self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") + self.requires("zlib/1.2.13") self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/cura_10475") self.requires("pysavitar/(latest)@ultimaker/cura_10951") From 5cf2ecc66606684dc7f88205e3b21847536fce5f Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 31 Aug 2023 08:40:11 +0200 Subject: [PATCH 084/118] Only use shared grpc defs on Linux Contributes to CURA-10951 --- conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index ca84990cf5..902e5b2837 100644 --- a/conanfile.py +++ b/conanfile.py @@ -296,7 +296,8 @@ class CuraConan(ConanFile): self.options["pynest2d"].shared = True self.options["cpython"].shared = True self.options["boost"].header_only = True - self.options["curaengine_grpc_definitions"].shared = True + if self.settings.os == "Linux": + self.options["curaengine_grpc_definitions"].shared = True def validate(self): version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) From 59ce5a6c496bc61557418fc00a989c478f5a62ee Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 1 Sep 2023 07:37:34 +0200 Subject: [PATCH 085/118] Don't build on linux-legacy Contributes CURA-10951 --- .github/workflows/conan-package-create.yml | 2 +- .github/workflows/installers.yml | 11 ----------- .github/workflows/linux.yml | 5 +---- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/conan-package-create.yml b/.github/workflows/conan-package-create.yml index e8329fa7b1..18e2600e1d 100644 --- a/.github/workflows/conan-package-create.yml +++ b/.github/workflows/conan-package-create.yml @@ -119,7 +119,7 @@ jobs: sudo apt upgrade sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config flex bison -y - - name: Install GCC-132 on ubuntu + - name: Install GCC-13 on ubuntu if: ${{ startsWith(inputs.runs_on, 'ubuntu') }} run: | sudo apt install g++-13 gcc-13 -y diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index ead3b7a87a..ed7c1cd069 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -48,17 +48,6 @@ jobs: operating_system: ubuntu-22.04 secrets: inherit - linux-legacy-installer: - uses: ./.github/workflows/linux.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: ubuntu-20.04 - secrets: inherit - macos-installer: uses: ./.github/workflows/macos.yml with: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2e15584299..833d52c06e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -179,10 +179,7 @@ jobs: run: | import os enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - if "${{ inputs.operating_system }}" == "ubuntu-22.04": - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-${{ inputs.architecture }}" - else: - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-${{ inputs.architecture }}" + installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-${{ inputs.architecture }}" output_env = os.environ["GITHUB_OUTPUT"] content = "" if os.path.exists(output_env): From e5aab096e939ac1744d8384661e1b2a5d2002978 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 1 Sep 2023 07:51:52 +0200 Subject: [PATCH 086/118] Add AppImage-builder and dependencies Contributes CURA-10951 --- .github/workflows/linux.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 833d52c06e..f1b627cb75 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -119,10 +119,20 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt update sudo apt upgrade - sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y + sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync -y + + # Get the AppImage tool wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool chmod +x $GITHUB_WORKSPACE/appimagetool echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV + + # Get the AppImage builder + wget --no-check-certificate --quiet -O $GITHUB_WORKSPACE/appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage + chmod +x appimage-builder-x86_64.AppImage + echo "APPIMAGEBUILDER_LOCATION=$GITHUB_WORKSPACE/appimage-builder-x86_64.AppImage" >> $GITHUB_ENV + + # Make sure these tools can be found on the path + echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - name: Install GCC-13 run: | From 7fbd716bb47260cac534f53daea1215f01d5cc60 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 05:11:51 +0200 Subject: [PATCH 087/118] Bundling the Gradualflow plugin This commit simplifies the deploy method in conanfile.py by reducing the number of lines of code and refactor the handling of the Gradualflow plugin in the deploy method. In conandata.yml, the paths for the Gradualflow plugin resources have been adjusted for correct deployment. This update aims to fix the pyinstaller deployment failures associated with the Gradualflow plugin. It resolves the CURA-10951 tracking issue. Contributes CURA-10951 --- conandata.yml | 14 +++---- conanfile.py | 112 ++++++++++++++++---------------------------------- 2 files changed, 42 insertions(+), 84 deletions(-) diff --git a/conandata.yml b/conandata.yml index df87ba2113..1bdd4f824a 100644 --- a/conandata.yml +++ b/conandata.yml @@ -20,13 +20,13 @@ pyinstaller: src: "plugins" dst: "share/cura/plugins" curaengine_gradual_flow_plugin: - root: "." - src: "share/cura/plugins/CuraEngineGradualFlow" - dst: "share/cura/plugins/CuraEngineGradualFlow" - curaengine_gradual_flow_plugin_resources: - root: "." - src: "share/cura/resources/bundled_packages" - dst: "share/cura/resources/bundled_packages" + package: "curaengine_plugin_gradual_flow" + src: "res/plugins/CuraEngineGradualFlow" + dst: "share/cura/plugins/CuraEngineGradualFlow" + curaengine_gradual_flow_plugin_bundled: + package: "curaengine_plugin_gradual_flow" + src: "res/bundled_packages" + dst: "share/cura/resources/bundled_packages" cura_resources: package: "cura" src: "resources" diff --git a/conanfile.py b/conanfile.py index 902e5b2837..16dff0b93c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -4,7 +4,7 @@ from pathlib import Path from jinja2 import Template from conan import ConanFile -from conan.tools.files import copy, rmdir, save, mkdir +from conan.tools.files import copy, rmdir, save, mkdir, rm from conan.tools.microsoft import unix_path from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv from conan.tools.scm import Version @@ -21,12 +21,11 @@ class CuraConan(ConanFile): description = "3D printer / slicing GUI built on top of the Uranium framework" topics = ("conan", "python", "pyqt6", "qt", "qml", "3d-printing", "slicer") build_policy = "missing" - exports = "LICENSE*", "UltiMaker-Cura.spec.jinja", "CuraVersion.py.jinja", "AboutDialogVersionsList.qml.jinja" + exports = "LICENSE*", "*.jinja" settings = "os", "compiler", "build_type", "arch" # FIXME: Remove specific branch once merged to main - python_requires = "umbase/[>=0.1.7]@ultimaker/stable", "translationextractor/[>=2.1.1]@ultimaker/stable" - python_requires_extend = "umbase.UMBaseConanfile" + python_requires = "translationextractor/[>=2.1.1]@ultimaker/stable" options = { "enterprise": ["True", "False", "true", "false"], # Workaround for GH Action passing boolean as lowercase string @@ -359,36 +358,35 @@ class CuraConan(ConanFile): rmdir(self,str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow"))) curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) + ext = ".exe" if self.settings.os == "Windows" else "" + copy(self, f"curaengine_plugin_gradual_flow{ext}", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "CuraEngineGradualFlow")), keep_path = True) - copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) - curaengine_plugin_gradual_flow_binary_path = self.source_path.joinpath("plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) - copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) + copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[1], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) - # Copy resources of cura_binary_data - cura_binary_data = self.dependencies["cura_binary_data"].cpp_info - copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) - copy(self, "*", cura_binary_data.resdirs[1], str(self._share_dir.joinpath("uranium")), keep_path = True) - if self.settings.os == "Windows": - copy(self, "*", cura_binary_data.resdirs[2], str(self._share_dir.joinpath("windows")), keep_path = True) + # Copy resources of cura_binary_data + cura_binary_data = self.dependencies["cura_binary_data"].cpp_info + copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) + copy(self, "*", cura_binary_data.resdirs[1], str(self._share_dir.joinpath("uranium")), keep_path = True) + if self.settings.os == "Windows": + copy(self, "*", cura_binary_data.resdirs[2], str(self._share_dir.joinpath("windows")), keep_path = True) - for dependency in self.dependencies.host.values(): - for bindir in dependency.cpp_info.bindirs: - copy(self, "*.dll", bindir, str(self._site_packages), keep_path = False) - for libdir in dependency.cpp_info.libdirs: - copy(self, "*.pyd", libdir, str(self._site_packages), keep_path = False) - copy(self, "*.pyi", libdir, str(self._site_packages), keep_path = False) - copy(self, "*.dylib", libdir, str(self._base_dir.joinpath("lib")), keep_path = False) + for dependency in self.dependencies.host.values(): + for bindir in dependency.cpp_info.bindirs: + copy(self, "*.dll", bindir, str(self._site_packages), keep_path = False) + for libdir in dependency.cpp_info.libdirs: + copy(self, "*.pyd", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.pyi", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.dylib", libdir, str(self._base_dir.joinpath("lib")), keep_path = False) - # Copy materials (flat) - rmdir(self, os.path.join(self.source_folder, "resources", "materials")) - fdm_materials = self.dependencies["fdm_materials"].cpp_info - copy(self, "*", fdm_materials.resdirs[0], self.source_folder) + # Copy materials (flat) + rmdir(self, os.path.join(self.source_folder, "resources", "materials")) + fdm_materials = self.dependencies["fdm_materials"].cpp_info + copy(self, "*", fdm_materials.resdirs[0], self.source_folder) - # Copy internal resources - if self.options.internal: - cura_private_data = self.dependencies["cura_private_data"].cpp_info - copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) + # Copy internal resources + if self.options.internal: + cura_private_data = self.dependencies["cura_private_data"].cpp_info + copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) if self.options.devtools: entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements")) @@ -419,65 +417,18 @@ class CuraConan(ConanFile): self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) def deploy(self): - # Copy CuraEngine.exe to bindirs of Virtual Python Environment - curaengine = self.dependencies["curaengine"].cpp_info - copy(self, "CuraEngine.exe", curaengine.bindirs[0], str(self._base_dir), keep_path = False) - copy(self, "CuraEngine", curaengine.bindirs[0], str(self._base_dir), keep_path = False) - - # Copy resources of Cura (keep folder structure) + # Copy resources of Cura (keep folder structure) needed by pyinstaller to determine the module structure copy(self, "*", os.path.join(self.package_folder, self.cpp_info.bindirs[0]), str(self._base_dir), keep_path = False) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.libdirs[0]), str(self._site_packages.joinpath("cura")), keep_path = True) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[0]), str(self._share_dir.joinpath("cura", "resources")), keep_path = True) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[1]), str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - # Copy the external plugins that we want to bundle with Cura - curaengine_plugin_gradual_flow = self.dependencies["curaengine_plugin_gradual_flow"].cpp_info - copy(self, "*.py", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - copy(self, "*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "plugins")), keep_path = True) - copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[0], str(self._share_dir.joinpath("cura", "resources", "bundled_packages")), keep_path = False) - curaengine_plugin_gradual_flow_binary_path = self._share_dir.joinpath("cura", "plugins", "CuraEngineGradualFlow", {"armv8": "arm64"}.get(str(self.settings.arch), str(self.settings.arch)), {"Macos": "Darwin"}.get(str(self.settings.os), str(self.settings.os))) - copy(self, "curaengine_plugin_gradual_flow.exe", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - copy(self, "curaengine_plugin_gradual_flow", curaengine_plugin_gradual_flow.bindirs[0], curaengine_plugin_gradual_flow_binary_path, keep_path = False) - - # Copy materials (flat) - fdm_materials = self.dependencies["fdm_materials"].cpp_info - copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) - - # Copy internal resources - if self.options.internal: - cura_private_data = self.dependencies["cura_private_data"].cpp_info - copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) - # Copy resources of Uranium (keep folder structure) uranium = self.dependencies["uranium"].cpp_info copy(self, "*", uranium.resdirs[0], str(self._share_dir.joinpath("uranium", "resources")), keep_path = True) copy(self, "*", uranium.resdirs[1], str(self._share_dir.joinpath("uranium", "plugins")), keep_path = True) copy(self, "*", uranium.libdirs[0], str(self._site_packages.joinpath("UM")), keep_path = True) - # TODO: figure out if this is still needed - copy(self, "*", os.path.join(uranium.libdirs[0], "Qt", "qml", "UM"), str(self._site_packages.joinpath("PyQt6", "Qt6", "qml", "UM")), keep_path = True) - - # Copy resources of cura_binary_data - cura_binary_data = self.dependencies["cura_binary_data"].cpp_info - copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) - copy(self, "*", cura_binary_data.resdirs[1], str(self._share_dir.joinpath("uranium")), keep_path = True) - if self.settings.os == "Windows": - copy(self, "*", cura_binary_data.resdirs[2], str(self._share_dir.joinpath("windows")), keep_path = True) - - for dependency in self.dependencies.host.values(): - for bindir in dependency.cpp_info.bindirs: - copy(self, "*.dll", bindir, str(self._site_packages), keep_path = False) - for libdir in dependency.cpp_info.libdirs: - copy(self, "*.pyd", libdir, str(self._site_packages), keep_path = False) - copy(self, "*.pyi", libdir, str(self._site_packages), keep_path = False) - copy(self, "*.dylib", libdir, str(self._base_dir.joinpath("lib")), keep_path = False) - - # Copy packaging scripts - copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[2]), str(self._base_dir.joinpath("packaging")), keep_path = True) - - # Copy requirements.txt's - copy(self, "*.txt", os.path.join(self.package_folder, self.cpp_info.resdirs[-1]), str(self._base_dir.joinpath("pip_requirements")), keep_path = False) - # Generate the GitHub Action version info Environment version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) cura_version = Version(version) @@ -517,6 +468,13 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV copy(self, "requirement*.txt", src = self.source_folder, dst = os.path.join(self.package_folder, self.cpp.package.resdirs[-1])) copy(self, "*", src = os.path.join(self.source_folder, "packaging"), dst = os.path.join(self.package_folder, self.cpp.package.resdirs[2])) + # Remove the CuraEngineGradualFlow plugin from the package + rmdir(self, os.path.join(self.package_folder, self.cpp.package.resdirs[1], "CuraEngineGradualFlow")) + rm(self, "bundled_*.json", os.path.join(self.package_folder, self.cpp.package.resdirs[0], "bundled_packages"), recursive = False) + + # Remove the fdm_materials from the package + rmdir(self, os.path.join(self.package_folder, self.cpp.package.resdirs[0], "materials")) + def package_info(self): self.user_info.pip_requirements = "requirements.txt" self.user_info.pip_requirements_git = "requirements-ultimaker.txt" From b5fbcce33fba131c9cb57eaafb5f2eac0433946e Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 05:13:21 +0200 Subject: [PATCH 088/118] Add AppImage builder configs and scripts Added the configuration file `AppImageBuilder.yml.jinja`, the Python script `create_appimage.py`, and the shell script `entrypoint.sh.jinja` for AppImage building and packaging. These additions would enable the Cura application to be built into a single, standalone, executables file for Linux users, improving software deployment and distribution. Contributes CURA-10951 --- .../AppImageBuilder.yml.jinja | 90 +++++++++++++++++ packaging/AppImage-builder/create_appimage.py | 99 +++++++++++++++++++ .../AppImage-builder/entrypoint.sh.jinja | 8 ++ 3 files changed, 197 insertions(+) create mode 100644 packaging/AppImage-builder/AppImageBuilder.yml.jinja create mode 100644 packaging/AppImage-builder/create_appimage.py create mode 100644 packaging/AppImage-builder/entrypoint.sh.jinja diff --git a/packaging/AppImage-builder/AppImageBuilder.yml.jinja b/packaging/AppImage-builder/AppImageBuilder.yml.jinja new file mode 100644 index 0000000000..cb446af520 --- /dev/null +++ b/packaging/AppImage-builder/AppImageBuilder.yml.jinja @@ -0,0 +1,90 @@ +version: 1 + +AppDir: + path: {{ app_dir }} + app_info: + id: com.ultimaker.cura + name: UltiMaker-Cura + icon: {{ icon }} + version: {{ version }} + exec: entrypoint.sh + exec_args: $@ + apt: + arch: + - amd64 + allow_unauthenticated: true + sources: + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy main restricted + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy-updates main restricted + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy universe + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy-updates universe + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy multiverse + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy-updates multiverse + - sourceline: deb http://nl.archive.ubuntu.com/ubuntu/ jammy-backports main restricted + universe multiverse + - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security main restricted + - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security universe + - sourceline: deb http://security.ubuntu.com/ubuntu jammy-security multiverse + - sourceline: deb https://releases.jfrog.io/artifactory/jfrog-debs xenial contrib + - sourceline: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main + - sourceline: deb https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/ + jammy main + - sourceline: deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ jammy + main + - sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/ms-teams stable + main + - sourceline: deb https://ppa.launchpadcontent.net/ppa-verse/cling/ubuntu/ jammy + main + - sourceline: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable + main + - sourceline: deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x + jammy main + - sourceline: deb [arch=amd64 signed-by=/usr/share/keyrings/transip-stack.gpg] + https://mirror.transip.net/stack/software/deb/Ubuntu_22.04/ ./ + - sourceline: deb http://repository.spotify.com stable non-free + - sourceline: deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code + stable main + - sourceline: deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie + main + include: + - libc6:amd64 + - xdg-desktop-portal-kde:amd64 + files: + include: [] + exclude: + - usr/share/man + - usr/share/doc/*/README.* + - usr/share/doc/*/changelog.* + - usr/share/doc/*/NEWS.* + - usr/share/doc/*/TODO.* + runtime: + env: + PYTHONPATH: "$APPDIR" + QT_PLUGIN_PATH: "$APPDIR/qt/plugins" + QML2_IMPORT_PATH: "$APPDIR/qt/qml" + QT_QPA_PLATFORMTHEME: xdgdesktopportal + test: + fedora-30: + image: appimagecrafters/tests-env:fedora-30 + command: ./AppRun + use_host_x: True + debian-stable: + image: appimagecrafters/tests-env:debian-stable + command: ./AppRun + use_host_x: True + archlinux-latest: + image: appimagecrafters/tests-env:archlinux-latest + command: ./AppRun + use_host_x: True + centos-7: + image: appimagecrafters/tests-env:centos-7 + command: ./AppRun + use_host_x: True + ubuntu-xenial: + image: appimagecrafters/tests-env:ubuntu-xenial + command: ./AppRun + use_host_x: True +AppImage: + arch: {{ arch }} + file_name: {{ file_name }} + update-information: guess diff --git a/packaging/AppImage-builder/create_appimage.py b/packaging/AppImage-builder/create_appimage.py new file mode 100644 index 0000000000..33d13ee5ad --- /dev/null +++ b/packaging/AppImage-builder/create_appimage.py @@ -0,0 +1,99 @@ +# Copyright (c) 2023 UltiMaker +# Cura is released under the terms of the LGPLv3 or higher. + + +import argparse # Command line arguments parsing and help. +from jinja2 import Template +import os # Finding installation directory. +import os.path # Finding files. +import shutil # Copying files. +import stat # For setting file permissions. +import subprocess # For calling system commands. + +def build_appimage(dist_path, version, appimage_filename): + """ + Creates an AppImage file from the build artefacts created so far. + """ + generate_appimage_builder_config(dist_path, version, appimage_filename) + generate_appimage_entrypoint(dist_path) + copy_files(dist_path) + + try: + os.remove(os.path.join(dist_path, appimage_filename)) # Ensure any old file is removed, if it exists. + except FileNotFoundError: + pass # If it didn't exist, that's even better. + create_appimage(dist_path, appimage_filename) + sign_appimage(dist_path, appimage_filename) + + +def generate_appimage_builder_config(dist_path, version, appimage_filename): + with open(os.path.join(dist_path, "AppImageBuilder.yml.jinja"), "r") as appimage_builder_file: + appimage_builder = appimage_builder_file.read() + + template = Template(appimage_builder) + appimage_builder = template.render(app_dir = dist_path, + icon = os.path.join("..", "icons", "cura-icon_256x256.png"), + version = version, + arch = "x86_64", + file_name = appimage_filename) + + with open(os.path.join(dist_path, "AppImageBuilder.yml"), "w") as appimage_builder_file: + appimage_builder_file.write(appimage_builder) + + +def generate_appimage_entrypoint(dist_path): + with open(os.path.join(dist_path, "entrypoint.sh.jinja"), "r") as entrypoint_file: + entrypoint = entrypoint_file.read() + + template = Template(entrypoint) + entrypoint = template.render(executable = "UltiMaker-Cura") + + with open(os.path.join(dist_path, "entrypoint.sh"), "w") as entrypoint_file: + entrypoint_file.write(entrypoint) + +def copy_files(dist_path): + """ + Copy metadata files for the metadata of the AppImage. + """ + copied_files = { + os.path.join("..", "icons", "cura-icon.svg"): os.path.join("usr", "share", "icons", "hicolor", "scalable", "apps", "cura-icon.svg"), + os.path.join("..", "icons", "cura-icon_64x64.png"): os.path.join("usr", "share", "icons", "hicolor", "64x64", "apps", "cura-icon.png"), + os.path.join("..", "icons", "cura-icon_128x128.png"): os.path.join("usr", "share", "icons", "hicolor", "128x128", "apps", "cura-icon.png"), + os.path.join("..", "icons", "cura-icon_256x256.png"): os.path.join("usr", "share", "icons", "hicolor", "256x256", "apps", "cura-icon.png"), + os.path.join("..", "icons", "cura-icon_256x256.png"): "cura-icon.png", + "entrypoint.sh": "entrypoint.sh" + } + + # TODO: openssl.cnf ??? + + packaging_dir = os.path.dirname(__file__) + for source, dest in copied_files.items(): + dest_file_path = os.path.join(dist_path, dest) + os.makedirs(os.path.dirname(dest_file_path), exist_ok=True) + shutil.copyfile(os.path.join(packaging_dir, source), dest_file_path) + + # Ensure that entrypoint.sh has the proper permissions: 755 (user reads, writes and executes, group reads and executes, world reads and executes). + os.chmod(os.path.join(dist_path, "entrypoint.sh"), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + +def create_appimage(dist_path, appimage_filename): + appimage_path = os.path.join(dist_path, "..", appimage_filename) + appimagetool = os.getenv("APPIMAGETOOL_LOCATION", "appimagetool") + command = [appimagetool, "--appimage-extract-and-run", f"{dist_path}/", appimage_path] + result = subprocess.call(command) + if result != 0: + raise RuntimeError(f"The AppImageTool command returned non-zero: {result}") + +def sign_appimage(dist_path, appimage_filename): + appimage_path = os.path.join(dist_path, "..", appimage_filename) + command = ["gpg", "--yes", "--armor", "--detach-sig", appimage_path] + result = subprocess.call(command) + if result != 0: + raise RuntimeError(f"The GPG command returned non-zero: {result}") + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description = "Create AppImages of Cura.") + parser.add_argument("dist_path", type=str, help="Path to where PyInstaller installed the distribution of Cura.") + parser.add_argument("version", type=str, help="Full version number of Cura (e.g. '5.1.0-beta')") + parser.add_argument("filename", type = str, help = "Filename of the AppImage (e.g. 'UltiMaker-Cura-5.1.0-beta-Linux-X64.AppImage')") + args = parser.parse_args() + build_appimage(args.dist_path, args.version, args.filename) diff --git a/packaging/AppImage-builder/entrypoint.sh.jinja b/packaging/AppImage-builder/entrypoint.sh.jinja new file mode 100644 index 0000000000..6ff63e6c63 --- /dev/null +++ b/packaging/AppImage-builder/entrypoint.sh.jinja @@ -0,0 +1,8 @@ +#!/bin/bash + +BIN=`basename "$ARGV0" .AppImage` +if [ -f ${APPDIR}/$BIN ]; then + ${APPDIR}/$BIN "$@" +else + ${APPDIR}/{{ executable }} "$@" +fi; \ No newline at end of file From f1df7f67d5326ce5f0d09ad5f0a254df970d61e9 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 05:20:34 +0200 Subject: [PATCH 089/118] deploy packaging scripts Contributes CURA-10951 --- conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conanfile.py b/conanfile.py index 16dff0b93c..083f2b43f6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -417,6 +417,8 @@ class CuraConan(ConanFile): self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) def deploy(self): + copy(self, "*", os.path.join(self.package_folder, self.cpp.package.resdirs[2]), os.path.join(self.install_folder, "packaging"), keep_path = True) + # Copy resources of Cura (keep folder structure) needed by pyinstaller to determine the module structure copy(self, "*", os.path.join(self.package_folder, self.cpp_info.bindirs[0]), str(self._base_dir), keep_path = False) copy(self, "*", os.path.join(self.package_folder, self.cpp_info.libdirs[0]), str(self._site_packages.joinpath("cura")), keep_path = True) From c5e38211165390692f93cba70b832b182ed2e766 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 06:12:47 +0200 Subject: [PATCH 090/118] Fix the AppImage-builder scripts Contributes CURA-10951 --- .github/workflows/linux.yml | 2 +- .../AppImageBuilder.yml.jinja | 2 +- packaging/AppImage-builder/create_appimage.py | 37 ++++++++++++------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f1b627cb75..520687d748 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -245,7 +245,7 @@ jobs: - name: Create the Linux AppImage (Bash) run: | - python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage" + python ../cura_inst/packaging/AppImage-builder/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage" chmod +x "${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage" working-directory: dist diff --git a/packaging/AppImage-builder/AppImageBuilder.yml.jinja b/packaging/AppImage-builder/AppImageBuilder.yml.jinja index cb446af520..270279af3b 100644 --- a/packaging/AppImage-builder/AppImageBuilder.yml.jinja +++ b/packaging/AppImage-builder/AppImageBuilder.yml.jinja @@ -7,7 +7,7 @@ AppDir: name: UltiMaker-Cura icon: {{ icon }} version: {{ version }} - exec: entrypoint.sh + exec: UltiMaker-Cura exec_args: $@ apt: arch: diff --git a/packaging/AppImage-builder/create_appimage.py b/packaging/AppImage-builder/create_appimage.py index 33d13ee5ad..03f13279e2 100644 --- a/packaging/AppImage-builder/create_appimage.py +++ b/packaging/AppImage-builder/create_appimage.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. +from pathlib import Path import argparse # Command line arguments parsing and help. from jinja2 import Template import os # Finding installation directory. @@ -10,6 +11,7 @@ import shutil # Copying files. import stat # For setting file permissions. import subprocess # For calling system commands. + def build_appimage(dist_path, version, appimage_filename): """ Creates an AppImage file from the build artefacts created so far. @@ -27,37 +29,38 @@ def build_appimage(dist_path, version, appimage_filename): def generate_appimage_builder_config(dist_path, version, appimage_filename): - with open(os.path.join(dist_path, "AppImageBuilder.yml.jinja"), "r") as appimage_builder_file: + with open(os.path.join(Path(__file__).parent, "AppImageBuilder.yml.jinja"), "r") as appimage_builder_file: appimage_builder = appimage_builder_file.read() template = Template(appimage_builder) - appimage_builder = template.render(app_dir = dist_path, - icon = os.path.join("..", "icons", "cura-icon_256x256.png"), + appimage_builder = template.render(app_dir = "./AppDir", + icon = "cura-icon.png", version = version, arch = "x86_64", file_name = appimage_filename) - with open(os.path.join(dist_path, "AppImageBuilder.yml"), "w") as appimage_builder_file: + with open(os.path.join(Path(__file__).parent, "AppImageBuilder.yml"), "w") as appimage_builder_file: appimage_builder_file.write(appimage_builder) def generate_appimage_entrypoint(dist_path): - with open(os.path.join(dist_path, "entrypoint.sh.jinja"), "r") as entrypoint_file: + with open(os.path.join(Path(__file__).parent, "entrypoint.sh.jinja"), "r") as entrypoint_file: entrypoint = entrypoint_file.read() template = Template(entrypoint) entrypoint = template.render(executable = "UltiMaker-Cura") - with open(os.path.join(dist_path, "entrypoint.sh"), "w") as entrypoint_file: + with open(os.path.join(Path(__file__).parent, "entrypoint.sh"), "w") as entrypoint_file: entrypoint_file.write(entrypoint) + def copy_files(dist_path): """ Copy metadata files for the metadata of the AppImage. """ copied_files = { - os.path.join("..", "icons", "cura-icon.svg"): os.path.join("usr", "share", "icons", "hicolor", "scalable", "apps", "cura-icon.svg"), - os.path.join("..", "icons", "cura-icon_64x64.png"): os.path.join("usr", "share", "icons", "hicolor", "64x64", "apps", "cura-icon.png"), + os.path.join("..", "icons", "cura-icon.svg"): os.path.join("usr", "share", "icons", "hicolor", "scalable", "apps", "cura-icon.svg"), + os.path.join("..", "icons", "cura-icon_64x64.png"): os.path.join("usr", "share", "icons", "hicolor", "64x64", "apps", "cura-icon.png"), os.path.join("..", "icons", "cura-icon_128x128.png"): os.path.join("usr", "share", "icons", "hicolor", "128x128", "apps", "cura-icon.png"), os.path.join("..", "icons", "cura-icon_256x256.png"): os.path.join("usr", "share", "icons", "hicolor", "256x256", "apps", "cura-icon.png"), os.path.join("..", "icons", "cura-icon_256x256.png"): "cura-icon.png", @@ -69,20 +72,25 @@ def copy_files(dist_path): packaging_dir = os.path.dirname(__file__) for source, dest in copied_files.items(): dest_file_path = os.path.join(dist_path, dest) - os.makedirs(os.path.dirname(dest_file_path), exist_ok=True) + os.makedirs(os.path.dirname(dest_file_path), exist_ok = True) shutil.copyfile(os.path.join(packaging_dir, source), dest_file_path) # Ensure that entrypoint.sh has the proper permissions: 755 (user reads, writes and executes, group reads and executes, world reads and executes). os.chmod(os.path.join(dist_path, "entrypoint.sh"), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + def create_appimage(dist_path, appimage_filename): - appimage_path = os.path.join(dist_path, "..", appimage_filename) - appimagetool = os.getenv("APPIMAGETOOL_LOCATION", "appimagetool") - command = [appimagetool, "--appimage-extract-and-run", f"{dist_path}/", appimage_path] + try: + os.rename(dist_path, "AppDir") + except OSError: + pass + appimagetool = os.getenv("APPIMAGEBUILDER_LOCATION", "appimage-builder-x86_64.AppImage") + command = [appimagetool, "--recipe", os.path.join(Path(__file__).parent, "AppImageBuilder.yml")] result = subprocess.call(command) if result != 0: raise RuntimeError(f"The AppImageTool command returned non-zero: {result}") + def sign_appimage(dist_path, appimage_filename): appimage_path = os.path.join(dist_path, "..", appimage_filename) command = ["gpg", "--yes", "--armor", "--detach-sig", appimage_path] @@ -90,10 +98,11 @@ def sign_appimage(dist_path, appimage_filename): if result != 0: raise RuntimeError(f"The GPG command returned non-zero: {result}") + if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Create AppImages of Cura.") - parser.add_argument("dist_path", type=str, help="Path to where PyInstaller installed the distribution of Cura.") - parser.add_argument("version", type=str, help="Full version number of Cura (e.g. '5.1.0-beta')") + parser.add_argument("dist_path", type = str, help = "Path to where PyInstaller installed the distribution of Cura.") + parser.add_argument("version", type = str, help = "Full version number of Cura (e.g. '5.1.0-beta')") parser.add_argument("filename", type = str, help = "Filename of the AppImage (e.g. 'UltiMaker-Cura-5.1.0-beta-Linux-X64.AppImage')") args = parser.parse_args() build_appimage(args.dist_path, args.version, args.filename) From e558b11ebdab3b9db70e6c133c3b0637612c5eb4 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 06:32:06 +0200 Subject: [PATCH 091/118] Minor fixes Contributes CURA-10951 --- packaging/AppImage-builder/create_appimage.py | 63 +++++++++---------- .../AppImage-builder/entrypoint.sh.jinja | 8 --- 2 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 packaging/AppImage-builder/entrypoint.sh.jinja diff --git a/packaging/AppImage-builder/create_appimage.py b/packaging/AppImage-builder/create_appimage.py index 03f13279e2..a91ac04139 100644 --- a/packaging/AppImage-builder/create_appimage.py +++ b/packaging/AppImage-builder/create_appimage.py @@ -1,15 +1,35 @@ # Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. +import argparse +import os +import shutil +import subprocess from pathlib import Path -import argparse # Command line arguments parsing and help. + from jinja2 import Template -import os # Finding installation directory. -import os.path # Finding files. -import shutil # Copying files. -import stat # For setting file permissions. -import subprocess # For calling system commands. + + +def prepare_workspace(dist_path, appimage_filename): + """ + Prepare the workspace for building the AppImage. + :param dist_path: Path to the distribution of Cura created with pyinstaller. + :param appimage_filename: name of the AppImage file. + :return: + """ + if not os.path.exists(dist_path): + raise RuntimeError(f"The dist_path {dist_path} does not exist.") + + if os.path.exists(os.path.join(dist_path, appimage_filename)): + os.remove(os.path.join(dist_path, appimage_filename)) + + if not os.path.exists("AppDir"): + shutil.move(dist_path, "AppDir") + else: + print(f"AppDir already exists, assuming it is already prepared.") + + copy_files("AppDir") def build_appimage(dist_path, version, appimage_filename): @@ -17,14 +37,7 @@ def build_appimage(dist_path, version, appimage_filename): Creates an AppImage file from the build artefacts created so far. """ generate_appimage_builder_config(dist_path, version, appimage_filename) - generate_appimage_entrypoint(dist_path) - copy_files(dist_path) - - try: - os.remove(os.path.join(dist_path, appimage_filename)) # Ensure any old file is removed, if it exists. - except FileNotFoundError: - pass # If it didn't exist, that's even better. - create_appimage(dist_path, appimage_filename) + create_appimage() sign_appimage(dist_path, appimage_filename) @@ -43,17 +56,6 @@ def generate_appimage_builder_config(dist_path, version, appimage_filename): appimage_builder_file.write(appimage_builder) -def generate_appimage_entrypoint(dist_path): - with open(os.path.join(Path(__file__).parent, "entrypoint.sh.jinja"), "r") as entrypoint_file: - entrypoint = entrypoint_file.read() - - template = Template(entrypoint) - entrypoint = template.render(executable = "UltiMaker-Cura") - - with open(os.path.join(Path(__file__).parent, "entrypoint.sh"), "w") as entrypoint_file: - entrypoint_file.write(entrypoint) - - def copy_files(dist_path): """ Copy metadata files for the metadata of the AppImage. @@ -64,7 +66,6 @@ def copy_files(dist_path): os.path.join("..", "icons", "cura-icon_128x128.png"): os.path.join("usr", "share", "icons", "hicolor", "128x128", "apps", "cura-icon.png"), os.path.join("..", "icons", "cura-icon_256x256.png"): os.path.join("usr", "share", "icons", "hicolor", "256x256", "apps", "cura-icon.png"), os.path.join("..", "icons", "cura-icon_256x256.png"): "cura-icon.png", - "entrypoint.sh": "entrypoint.sh" } # TODO: openssl.cnf ??? @@ -75,15 +76,8 @@ def copy_files(dist_path): os.makedirs(os.path.dirname(dest_file_path), exist_ok = True) shutil.copyfile(os.path.join(packaging_dir, source), dest_file_path) - # Ensure that entrypoint.sh has the proper permissions: 755 (user reads, writes and executes, group reads and executes, world reads and executes). - os.chmod(os.path.join(dist_path, "entrypoint.sh"), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) - -def create_appimage(dist_path, appimage_filename): - try: - os.rename(dist_path, "AppDir") - except OSError: - pass +def create_appimage(): appimagetool = os.getenv("APPIMAGEBUILDER_LOCATION", "appimage-builder-x86_64.AppImage") command = [appimagetool, "--recipe", os.path.join(Path(__file__).parent, "AppImageBuilder.yml")] result = subprocess.call(command) @@ -105,4 +99,5 @@ if __name__ == "__main__": parser.add_argument("version", type = str, help = "Full version number of Cura (e.g. '5.1.0-beta')") parser.add_argument("filename", type = str, help = "Filename of the AppImage (e.g. 'UltiMaker-Cura-5.1.0-beta-Linux-X64.AppImage')") args = parser.parse_args() + prepare_workspace(args.dist_path, args.filename) build_appimage(args.dist_path, args.version, args.filename) diff --git a/packaging/AppImage-builder/entrypoint.sh.jinja b/packaging/AppImage-builder/entrypoint.sh.jinja deleted file mode 100644 index 6ff63e6c63..0000000000 --- a/packaging/AppImage-builder/entrypoint.sh.jinja +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -BIN=`basename "$ARGV0" .AppImage` -if [ -f ${APPDIR}/$BIN ]; then - ${APPDIR}/$BIN "$@" -else - ${APPDIR}/{{ executable }} "$@" -fi; \ No newline at end of file From c29fcd7dcea9af355e1340d45f16e96667684590 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 07:24:14 +0200 Subject: [PATCH 092/118] Skip the AppImage test Contributes CURA-10951 --- packaging/AppImage-builder/create_appimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/AppImage-builder/create_appimage.py b/packaging/AppImage-builder/create_appimage.py index a91ac04139..2e5284eaad 100644 --- a/packaging/AppImage-builder/create_appimage.py +++ b/packaging/AppImage-builder/create_appimage.py @@ -79,7 +79,7 @@ def copy_files(dist_path): def create_appimage(): appimagetool = os.getenv("APPIMAGEBUILDER_LOCATION", "appimage-builder-x86_64.AppImage") - command = [appimagetool, "--recipe", os.path.join(Path(__file__).parent, "AppImageBuilder.yml")] + command = [appimagetool, "--recipe", os.path.join(Path(__file__).parent, "AppImageBuilder.yml"), "--skip-test"] result = subprocess.call(command) if result != 0: raise RuntimeError(f"The AppImageTool command returned non-zero: {result}") From 7eedcac62fb6d5b5dd6101be3a495698c173e948 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Sep 2023 08:37:24 +0200 Subject: [PATCH 093/118] Add includes for apt packages Based on: https://github.com/AppImageCrafters/appimage-builder/blob/main/recipes/hello-world-qt6/AppImageBuilder.yml Contributes CURA-10951 --- .../AppImageBuilder.yml.jinja | 57 ++++++++++++++++++- packaging/AppImage-builder/create_appimage.py | 3 +- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/packaging/AppImage-builder/AppImageBuilder.yml.jinja b/packaging/AppImage-builder/AppImageBuilder.yml.jinja index 270279af3b..fd8b4e6485 100644 --- a/packaging/AppImage-builder/AppImageBuilder.yml.jinja +++ b/packaging/AppImage-builder/AppImageBuilder.yml.jinja @@ -4,7 +4,7 @@ AppDir: path: {{ app_dir }} app_info: id: com.ultimaker.cura - name: UltiMaker-Cura + name: UltiMaker Cura icon: {{ icon }} version: {{ version }} exec: UltiMaker-Cura @@ -47,8 +47,58 @@ AppDir: - sourceline: deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main include: - - libc6:amd64 - - xdg-desktop-portal-kde:amd64 + - libc6:amd64 + - xdg-desktop-portal-kde:amd64 + - libcap2:amd64 + - libcom-err2:amd64 + - libdbus-1-3:amd64 + - libgpg-error0:amd64 + - libgtk-3-common + - libkeyutils1:amd64 + - libllvm13 + - liblzma5:amd64 + - libpcre3:amd64 + - libqt6gui6 + - libqt6qml6 + - libqt6qmlworkerscript6 + - libqt6quick6 + - libselinux1:amd64 + - libtinfo6:amd64 + - qml6-module-qtqml-workerscript:amd64 + - qml6-module-qtquick:amd64 + - qt6-gtk-platformtheme:amd64 + - qt6-qpa-plugins:amd64 + # x11 + - libx11-6 + - libx11-xcb1 + - libxcb1 + - libxcb-render0 + - libxcb-xfixes0 + - libxcb-shape0 + - libxcb-dri2-0 + - libxcb-shm0 + - libxcb-glx0 + - libxcb-present0 + - libxcb-dri3-0 + # graphic libraries interface (safe graphics bundle including drivers, acceleration may not work in some systems) + - libglvnd0 + - libglx0 + - libglapi-mesa + - libgl1 + - libegl1 + - libgbm1 + - libdrm2 + - libglx-mesa0 + - libgl1-amber-dri + - libgl1-mesa-dri + - mesa-utils + - libgl1-mesa-glx + - libdrm-amdgpu1 + - libdrm-nouveau2 + exclude: + - hicolor-icon-theme + - adwaita-icon-theme + - humanity-icon-theme files: include: [] exclude: @@ -59,6 +109,7 @@ AppDir: - usr/share/doc/*/TODO.* runtime: env: + APPDIR_LIBRARY_PATH: "$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders" PYTHONPATH: "$APPDIR" QT_PLUGIN_PATH: "$APPDIR/qt/plugins" QML2_IMPORT_PATH: "$APPDIR/qt/qml" diff --git a/packaging/AppImage-builder/create_appimage.py b/packaging/AppImage-builder/create_appimage.py index 2e5284eaad..819ec0b766 100644 --- a/packaging/AppImage-builder/create_appimage.py +++ b/packaging/AppImage-builder/create_appimage.py @@ -86,8 +86,7 @@ def create_appimage(): def sign_appimage(dist_path, appimage_filename): - appimage_path = os.path.join(dist_path, "..", appimage_filename) - command = ["gpg", "--yes", "--armor", "--detach-sig", appimage_path] + command = ["gpg", "--yes", "--armor", "--detach-sig", appimage_filename] result = subprocess.call(command) if result != 0: raise RuntimeError(f"The GPG command returned non-zero: {result}") From 2bc3079af594e6334887a08ab78d093c99fc93cc Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 6 Sep 2023 11:38:54 +0200 Subject: [PATCH 094/118] Only exclude Cura and CuraEngine still ship other executables Contributes to CURA-10951 --- packaging/msi/ExcludeComponents.xslt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packaging/msi/ExcludeComponents.xslt b/packaging/msi/ExcludeComponents.xslt index b964484922..dc782e2035 100644 --- a/packaging/msi/ExcludeComponents.xslt +++ b/packaging/msi/ExcludeComponents.xslt @@ -20,10 +20,15 @@ ...but we can use this longer `substring` expression instead (see https://github.com/wixtoolset/issues/issues/5609 ) --> + /> + @@ -32,6 +37,7 @@ - - + + + \ No newline at end of file From 71dc8e22a6ed7bb0d9b740711b46915d1ea761af Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Fri, 1 Sep 2023 11:11:09 +0200 Subject: [PATCH 095/118] Allow objects to be placed near border Issue before was the following: when placing objects within a grid cell there is a margin around the object. This margin comes from both the integer rounding of the cell and the defined min distance between objects. When trying to place object near the buildplate border we marked any cell that is not fully within the buildplate area as an invalid cell to place objects in. This was however too strict; there is the aforementioned margin around the object, and if only this margin would be outside the buildplate it is perfectly fine to place object in that cell. CURA-7951 --- cura/Arranging/GridArrange.py | 100 ++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/cura/Arranging/GridArrange.py b/cura/Arranging/GridArrange.py index 493c81b27c..4caf472b5d 100644 --- a/cura/Arranging/GridArrange.py +++ b/cura/Arranging/GridArrange.py @@ -1,11 +1,13 @@ import math -from typing import List, TYPE_CHECKING, Tuple, Set +from typing import List, TYPE_CHECKING, Tuple, Set, Union if TYPE_CHECKING: from UM.Scene.SceneNode import SceneNode from cura.BuildVolume import BuildVolume from UM.Application import Application +from UM.Math.AxisAlignedBox import AxisAlignedBox +from UM.Math.Polygon import Polygon from UM.Math.Vector import Vector from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation from UM.Operations.GroupedOperation import GroupedOperation @@ -34,10 +36,18 @@ class GridArrange(Arranger): self._grid_width += self._margin_x self._grid_height += self._margin_y - # Round up the grid size to the nearest cm + # Round up the grid size to the nearest cm, this assures that new objects will + # be placed on integer offsets from each other grid_precision = 10 # 1cm - self._grid_width = math.ceil(self._grid_width / grid_precision) * grid_precision - self._grid_height = math.ceil(self._grid_height / grid_precision) * grid_precision + rounded_grid_width = math.ceil(self._grid_width / grid_precision) * grid_precision + rounded_grid_height = math.ceil(self._grid_height / grid_precision) * grid_precision + + # The space added by the "grid precision rounding up" of the grid size + self._grid_round_margin_x = rounded_grid_width - self._grid_width + self._grid_round_margin_y = rounded_grid_height - self._grid_height + + self._grid_width = rounded_grid_width + self._grid_height = rounded_grid_height self._offset_x = 0 self._offset_y = 0 @@ -56,10 +66,9 @@ class GridArrange(Arranger): self._fixed_nodes_grid_ids = self._fixed_nodes_grid_ids.union( self._intersectingGridIdxInclusive(node.getBoundingBox())) - #grid indexes that are in disallowed area + # grid indexes that are in disallowed area for polygon in self._build_volume.getDisallowedAreas(): - self._fixed_nodes_grid_ids = self._fixed_nodes_grid_ids.union( - self._getIntersectingGridIdForPolygon(polygon)) + self._fixed_nodes_grid_ids = self._fixed_nodes_grid_ids.union(self._intersectingGridIdxInclusive(polygon)) self._build_plate_grid_ids = self._intersectingGridIdxExclusive(self._build_volume_bounding_box) @@ -240,51 +249,58 @@ class GridArrange(Arranger): return TranslateOperation(node, Vector(delta_x, 0, delta_y)) - def _getGridCornerPoints(self, bounding_box: "BoundingVolume") -> Tuple[float, float, float, float]: - coord_x1 = bounding_box.left - coord_x2 = bounding_box.right - coord_y1 = bounding_box.back - coord_y2 = bounding_box.front + def _getGridCornerPoints( + self, + bounds: Union[AxisAlignedBox, Polygon], + *, + margin_x: float = 0.0, + margin_y: float = 0.0 + ) -> Tuple[float, float, float, float]: + if isinstance(bounds, AxisAlignedBox): + coord_x1 = bounds.left - margin_x + coord_x2 = bounds.right + margin_x + coord_y1 = bounds.back - margin_y + coord_y2 = bounds.front + margin_y + elif isinstance(bounds, Polygon): + coord_x1 = float('inf') + coord_y1 = float('inf') + coord_x2 = float('-inf') + coord_y2 = float('-inf') + for x, y in bounds.getPoints(): + coord_x1 = min(coord_x1, x) + coord_y1 = min(coord_y1, y) + coord_x2 = max(coord_x2, x) + coord_y2 = max(coord_y2, y) + else: + raise TypeError("bounds must be either an AxisAlignedBox or a Polygon") + + coord_x1 -= margin_x + coord_x2 += margin_x + coord_y1 -= margin_y + coord_y2 += margin_y + grid_x1, grid_y1 = self._coordSpaceToGridSpace(coord_x1, coord_y1) grid_x2, grid_y2 = self._coordSpaceToGridSpace(coord_x2, coord_y2) return grid_x1, grid_y1, grid_x2, grid_y2 - def _getIntersectingGridIdForPolygon(self, polygon)-> Set[Tuple[int, int]]: - # (x0, y0) - # | - # v - # ┌─────────────┐ - # │ │ - # │ │ - # └─────────────┘ < (x1, y1) - x0 = float('inf') - y0 = float('inf') - x1 = float('-inf') - y1 = float('-inf') - grid_idx = set() - for [x, y] in polygon.getPoints(): - x0 = min(x0, x) - y0 = min(y0, y) - x1 = max(x1, x) - y1 = max(y1, y) - grid_x1, grid_y1 = self._coordSpaceToGridSpace(x0, y0) - grid_x2, grid_y2 = self._coordSpaceToGridSpace(x1, y1) - - for grid_x in range(math.floor(grid_x1), math.ceil(grid_x2)): - for grid_y in range(math.floor(grid_y1), math.ceil(grid_y2)): - grid_idx.add((grid_x, grid_y)) - return grid_idx - - def _intersectingGridIdxInclusive(self, bounding_box: "BoundingVolume") -> Set[Tuple[int, int]]: - grid_x1, grid_y1, grid_x2, grid_y2 = self._getGridCornerPoints(bounding_box) + def _intersectingGridIdxInclusive(self, bounds: Union[AxisAlignedBox, Polygon]) -> Set[Tuple[int, int]]: + grid_x1, grid_y1, grid_x2, grid_y2 = self._getGridCornerPoints( + bounds, + margin_x=-(self._margin_x + self._grid_round_margin_x) * 0.5, + margin_y=-(self._margin_y + self._grid_round_margin_y) * 0.5, + ) grid_idx = set() for grid_x in range(math.floor(grid_x1), math.ceil(grid_x2)): for grid_y in range(math.floor(grid_y1), math.ceil(grid_y2)): grid_idx.add((grid_x, grid_y)) return grid_idx - def _intersectingGridIdxExclusive(self, bounding_box: "BoundingVolume") -> Set[Tuple[int, int]]: - grid_x1, grid_y1, grid_x2, grid_y2 = self._getGridCornerPoints(bounding_box) + def _intersectingGridIdxExclusive(self, bounds: Union[AxisAlignedBox, Polygon]) -> Set[Tuple[int, int]]: + grid_x1, grid_y1, grid_x2, grid_y2 = self._getGridCornerPoints( + bounds, + margin_x=(self._margin_x + self._grid_round_margin_x) * 0.5, + margin_y=(self._margin_y + self._grid_round_margin_y) * 0.5, + ) grid_idx = set() for grid_x in range(math.ceil(grid_x1), math.floor(grid_x2)): for grid_y in range(math.ceil(grid_y1), math.floor(grid_y2)): From c7356ccb4ae30ff21685ccdf2b77a6bc72f2af0c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 6 Sep 2023 21:17:15 +0200 Subject: [PATCH 096/118] Pass 'all' exceptions. part of CURA-10942 --- plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py index b47a5876d8..43aceb7793 100644 --- a/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py +++ b/plugins/PostProcessingPlugin/scripts/LimitXYAccelJerk.py @@ -256,7 +256,7 @@ class LimitXYAccelJerk(Script): lines.insert(len(lines)-2,m205_jerk_old) data[end_index-1] = "\n".join(lines) except: - all + pass else: data[len(data)-1] = m201_limit_old + "\n" + m205_jerk_old + "\n" + data[len(data)-1] return data From 5765f398a3b9f7ad652f865b10065ca72f237bf7 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 13:03:56 +0200 Subject: [PATCH 097/118] Add clarifying comments: Why .sh 'on' Windows? part of CURA-9494 --- .github/workflows/windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5535f5f44f..f6de818eb4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -256,6 +256,7 @@ jobs: dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe retention-days: 5 + # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - name: Write the run info shell: python run: | @@ -263,6 +264,7 @@ jobs: with open("run_info.sh", "w") as f: f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - name: Upload the run info uses: actions/upload-artifact@v3 with: From 13af77b4f6a97862fc528c2c04ccae7d9ce67f9c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 20:34:54 +0200 Subject: [PATCH 098/118] Nightlies workflow: Enable skipping OS's part of CURA-9494 --- .github/workflows/installers.yml | 208 +++++++++++++++++++++---------- 1 file changed, 144 insertions(+), 64 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 96b67a0541..6a139b0b45 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -29,6 +29,11 @@ on: default: false required: true type: boolean + os_list: + description: 'List of OS(-variant)s to build for' + default: "windows, linux-modern, linux-legacy, macos-x64, macos-arm64" + required: true + type: string schedule: # Daily at 5:20 CET - cron: '20 4 * * *' @@ -40,59 +45,74 @@ env: jobs: windows-installer: - uses: ./.github/workflows/windows.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: windows-2022 - secrets: inherit + steps: + - name: Build Windows installer + if: ${{ contains(inputs.os_list, "windows") }} + uses: ./.github/workflows/windows.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: windows-2022 + secrets: inherit linux-modern-installer: - uses: ./.github/workflows/linux.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: ubuntu-22.04 - secrets: inherit + steps: + - name: Build (modern) Linux installer + if: ${{ contains(inputs.os_list, "linux-modern") }} + uses: ./.github/workflows/linux.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: ubuntu-22.04 + secrets: inherit linux-legacy-installer: - uses: ./.github/workflows/linux.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: ubuntu-20.04 - secrets: inherit + steps: + - name: Build (legacy) Linux installer + if: ${{ contains(inputs.os_list, "linux-legacy") }} + uses: ./.github/workflows/linux.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: ubuntu-20.04 + secrets: inherit macos-installer: - uses: ./.github/workflows/macos.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: macos-11.0 - secrets: inherit + steps: + - name: Build MacOS installer for Intel chips + if: ${{ contains(inputs.os_list, "macos-x64") }} + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: macos-11.0 + secrets: inherit macos-arm-installer: - uses: ./.github/workflows/macos.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: ARM64 - operating_system: self-hosted - secrets: inherit + steps: + - name: Build MacOS installer for ARM chips + if: ${{ contains(inputs.os_list, "macos-arm64") }} + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: ARM64 + operating_system: self-hosted + secrets: inherit # Run and update nightly release when the nightly input is set to true or if the schedule is triggered update-nightly-release: @@ -119,14 +139,20 @@ jobs: import os import datetime enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" - linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" - mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" - mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" - mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" - win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + os_list = [x.strip() for x in "${{ inputs.os_list }}".split(",")] + if "linux-modern" in os_list: + linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" + if "linux-legacy" in os_list: + linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" + if "macos-x64" in os_list: + mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + if "macos-arm64" in os_list: + mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + if "windows" in os_list: + win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) output_env = os.environ["GITHUB_OUTPUT"] @@ -136,84 +162,139 @@ jobs: content = f.read() with open(output_env, "w") as f: f.write(content) - f.writelines(f"LINUX_MODERN={linux_modern}\n") - f.writelines(f"LINUX_LEGACY={linux_legacy}\n") - f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") - f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") - f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") - f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") - f.writelines(f"WIN_MSI={win_msi}\n") - f.writelines(f"WIN_EXE={win_exe}\n") + if "linux-modern" in os_list: + f.writelines(f"LINUX_MODERN={linux_modern}\n") + if "linux-legacy" in os_list: + f.writelines(f"LINUX_LEGACY={linux_legacy}\n") + if "macos-x64" in os_list: + f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") + f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") + if "macos-arm64" in os_list: + f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") + f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") + if "windows" in os_list: + f.writelines(f"WIN_MSI={win_msi}\n") + f.writelines(f"WIN_EXE={win_exe}\n") f.writelines(f"NIGHTLY_NAME={nightly_name}\n") f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts + if: ${{ contains(inputs.os_list, "linux-modern") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts + if: ${{ contains(inputs.os_list, "linux-legacy") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage path: installers - name: Download mac x64 dmg installer jobs artifacts + if: ${{ contains(inputs.os_list, "macos-x64") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg path: installers - name: Download mac x64 pkg installer jobs artifacts + if: ${{ contains(inputs.os_list, "macos-x64") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg path: installers - name: Download mac arm dmg installer jobs artifacts + if: ${{ contains(inputs.os_list, "macos-arm64") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg path: installers - name: Download mac arm pkg installer jobs artifacts + if: ${{ contains(inputs.os_list, "macos-arm64") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg path: installers - name: Download win msi installer jobs artifacts + if: ${{ contains(inputs.os_list, "windows") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts + if: ${{ contains(inputs.os_list, "windows") }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers - - name: Rename installers to nightlies + - name: Rename Linux (modern) installer to nightlies + if: ${{ contains(inputs.os_list, "linux-modern") }} run: | mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage + + - name: Rename Linux (legacy) installer to nightlies + if: ${{ contains(inputs.os_list, "linux-legacy") }} + run: | mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage + + - name: Rename MacOS (X64) installers to nightlies + if: ${{ contains(inputs.os_list, "macos-x64") }} + run: | mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg + + - name: Rename MacOS (ARM-64) installers to nightlies + if: ${{ contains(inputs.os_list, "macos-arm64") }} + run: | mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg + + - name: Rename Windows installers to nightlies + if: ${{ contains(inputs.os_list, "windows") }} + run: | mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - - name: Update nightly release + - name: Update nightly release for Linux (modern) + if: ${{ contains(inputs.os_list, "linux-modern") }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update nightly release for Linux (legacy) + if: ${{ contains(inputs.os_list, "linux-legacy") }} + run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update nightly release for MacOS (X64) + if: ${{ contains(inputs.os_list, "macos-x64") }} + run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update nightly release for MacOS (ARM-64) + if: ${{ contains(inputs.os_list, "macos-arm64") }} + run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update nightly release for Windows + if: ${{ contains(inputs.os_list, "windows") }} + run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber env: @@ -224,4 +305,3 @@ jobs: gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - From a35ce3d65221ef0788c8e6af8c7bae67e855ec0f Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 20:48:33 +0200 Subject: [PATCH 099/118] Use single quotes or 'if' doesn't work. part of CURA-9494 --- .github/workflows/installers.yml | 66 ++++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 6a139b0b45..02b10e496b 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -47,7 +47,7 @@ jobs: windows-installer: steps: - name: Build Windows installer - if: ${{ contains(inputs.os_list, "windows") }} + if: ${{ contains(inputs.os_list, 'windows') }} uses: ./.github/workflows/windows.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -61,7 +61,7 @@ jobs: linux-modern-installer: steps: - name: Build (modern) Linux installer - if: ${{ contains(inputs.os_list, "linux-modern") }} + if: ${{ contains(inputs.os_list, 'linux-modern') }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -75,7 +75,7 @@ jobs: linux-legacy-installer: steps: - name: Build (legacy) Linux installer - if: ${{ contains(inputs.os_list, "linux-legacy") }} + if: ${{ contains(inputs.os_list, 'linux-legacy') }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -89,7 +89,7 @@ jobs: macos-installer: steps: - name: Build MacOS installer for Intel chips - if: ${{ contains(inputs.os_list, "macos-x64") }} + if: ${{ contains(inputs.os_list, 'macos-x64') }} uses: ./.github/workflows/macos.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -103,7 +103,7 @@ jobs: macos-arm-installer: steps: - name: Build MacOS installer for ARM chips - if: ${{ contains(inputs.os_list, "macos-arm64") }} + if: ${{ contains(inputs.os_list, 'macos-arm64') }} uses: ./.github/workflows/macos.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -140,17 +140,17 @@ jobs: import datetime enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" os_list = [x.strip() for x in "${{ inputs.os_list }}".split(",")] - if "linux-modern" in os_list: + if 'linux-modern' in os_list: linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" - if "linux-legacy" in os_list: + if 'linux-legacy' in os_list: linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" - if "macos-x64" in os_list: + if 'macos-x64' in os_list: mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" - if "macos-arm64" in os_list: + if 'macos-arm64' in os_list: mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - if "windows" in os_list: + if 'windows' in os_list: win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] @@ -162,122 +162,122 @@ jobs: content = f.read() with open(output_env, "w") as f: f.write(content) - if "linux-modern" in os_list: + if 'linux-modern' in os_list: f.writelines(f"LINUX_MODERN={linux_modern}\n") - if "linux-legacy" in os_list: + if 'linux-legacy' in os_list: f.writelines(f"LINUX_LEGACY={linux_legacy}\n") - if "macos-x64" in os_list: + if 'macos-x64' in os_list: f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") - if "macos-arm64" in os_list: + if 'macos-arm64' in os_list: f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") - if "windows" in os_list: + if 'windows' in os_list: f.writelines(f"WIN_MSI={win_msi}\n") f.writelines(f"WIN_EXE={win_exe}\n") f.writelines(f"NIGHTLY_NAME={nightly_name}\n") f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts - if: ${{ contains(inputs.os_list, "linux-modern") }} + if: ${{ contains(inputs.os_list, 'linux-modern') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts - if: ${{ contains(inputs.os_list, "linux-legacy") }} + if: ${{ contains(inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage path: installers - name: Download mac x64 dmg installer jobs artifacts - if: ${{ contains(inputs.os_list, "macos-x64") }} + if: ${{ contains(inputs.os_list, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg path: installers - name: Download mac x64 pkg installer jobs artifacts - if: ${{ contains(inputs.os_list, "macos-x64") }} + if: ${{ contains(inputs.os_list, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg path: installers - name: Download mac arm dmg installer jobs artifacts - if: ${{ contains(inputs.os_list, "macos-arm64") }} + if: ${{ contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg path: installers - name: Download mac arm pkg installer jobs artifacts - if: ${{ contains(inputs.os_list, "macos-arm64") }} + if: ${{ contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg path: installers - name: Download win msi installer jobs artifacts - if: ${{ contains(inputs.os_list, "windows") }} + if: ${{ contains(inputs.os_list, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts - if: ${{ contains(inputs.os_list, "windows") }} + if: ${{ contains(inputs.os_list, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers - name: Rename Linux (modern) installer to nightlies - if: ${{ contains(inputs.os_list, "linux-modern") }} + if: ${{ contains(inputs.os_list, 'linux-modern') }} run: | mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage - name: Rename Linux (legacy) installer to nightlies - if: ${{ contains(inputs.os_list, "linux-legacy") }} + if: ${{ contains(inputs.os_list, 'linux-legacy') }} run: | mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage - name: Rename MacOS (X64) installers to nightlies - if: ${{ contains(inputs.os_list, "macos-x64") }} + if: ${{ contains(inputs.os_list, 'macos-x64') }} run: | mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg - name: Rename MacOS (ARM-64) installers to nightlies - if: ${{ contains(inputs.os_list, "macos-arm64") }} + if: ${{ contains(inputs.os_list, 'macos-arm64') }} run: | mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - name: Rename Windows installers to nightlies - if: ${{ contains(inputs.os_list, "windows") }} + if: ${{ contains(inputs.os_list, 'windows') }} run: | mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - name: Update nightly release for Linux (modern) - if: ${{ contains(inputs.os_list, "linux-modern") }} + if: ${{ contains(inputs.os_list, 'linux-modern') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Linux (legacy) - if: ${{ contains(inputs.os_list, "linux-legacy") }} + if: ${{ contains(inputs.os_list, 'linux-legacy') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (X64) - if: ${{ contains(inputs.os_list, "macos-x64") }} + if: ${{ contains(inputs.os_list, 'macos-x64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber @@ -285,7 +285,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (ARM-64) - if: ${{ contains(inputs.os_list, "macos-arm64") }} + if: ${{ contains(inputs.os_list, 'macos-arm64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber @@ -293,7 +293,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Windows - if: ${{ contains(inputs.os_list, "windows") }} + if: ${{ contains(inputs.os_list, 'windows') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber From 566fdfce1c75a75b360c92414ffe2d22468299f9 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 20:51:56 +0200 Subject: [PATCH 100/118] Whitespace can be important. part of CURA-9494 --- .github/workflows/installers.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 02b10e496b..766c174ed1 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -56,7 +56,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: windows-2022 - secrets: inherit + secrets: inherit linux-modern-installer: steps: @@ -70,7 +70,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: ubuntu-22.04 - secrets: inherit + secrets: inherit linux-legacy-installer: steps: @@ -84,7 +84,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: ubuntu-20.04 - secrets: inherit + secrets: inherit macos-installer: steps: @@ -98,7 +98,7 @@ jobs: staging: ${{ inputs.staging }} architecture: X64 operating_system: macos-11.0 - secrets: inherit + secrets: inherit macos-arm-installer: steps: @@ -112,7 +112,7 @@ jobs: staging: ${{ inputs.staging }} architecture: ARM64 operating_system: self-hosted - secrets: inherit + secrets: inherit # Run and update nightly release when the nightly input is set to true or if the schedule is triggered update-nightly-release: From e9fe6b9831324b65815817fa548772260398843e Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 21:10:46 +0200 Subject: [PATCH 101/118] Partial revert of unneeded code. It doesn't work out this way, and, due to the if-clause further on, it should work even if the 'need's aren't all met. part of CURA-9494 --- .github/workflows/installers.yml | 100 ++++++++++++++----------------- 1 file changed, 45 insertions(+), 55 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 766c174ed1..2fc4b76d41 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -45,73 +45,63 @@ env: jobs: windows-installer: - steps: - - name: Build Windows installer - if: ${{ contains(inputs.os_list, 'windows') }} - uses: ./.github/workflows/windows.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: windows-2022 + if: ${{ contains(inputs.os_list, 'windows') }} + uses: ./.github/workflows/windows.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: windows-2022 secrets: inherit linux-modern-installer: - steps: - - name: Build (modern) Linux installer - if: ${{ contains(inputs.os_list, 'linux-modern') }} - uses: ./.github/workflows/linux.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: ubuntu-22.04 + if: ${{ contains(inputs.os_list, 'linux-modern') }} + uses: ./.github/workflows/linux.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: ubuntu-22.04 secrets: inherit linux-legacy-installer: - steps: - - name: Build (legacy) Linux installer - if: ${{ contains(inputs.os_list, 'linux-legacy') }} - uses: ./.github/workflows/linux.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: ubuntu-20.04 + if: ${{ contains(inputs.os_list, 'linux-legacy') }} + uses: ./.github/workflows/linux.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: ubuntu-20.04 secrets: inherit macos-installer: - steps: - - name: Build MacOS installer for Intel chips - if: ${{ contains(inputs.os_list, 'macos-x64') }} - uses: ./.github/workflows/macos.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: X64 - operating_system: macos-11.0 + if: ${{ contains(inputs.os_list, 'macos-x64') }} + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: X64 + operating_system: macos-11.0 secrets: inherit macos-arm-installer: - steps: - - name: Build MacOS installer for ARM chips - if: ${{ contains(inputs.os_list, 'macos-arm64') }} - uses: ./.github/workflows/macos.yml - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} - architecture: ARM64 - operating_system: self-hosted + if: ${{ contains(inputs.os_list, 'macos-arm64') }} + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + architecture: ARM64 + operating_system: self-hosted secrets: inherit # Run and update nightly release when the nightly input is set to true or if the schedule is triggered From e1f2424f0ecc69c443d7ddebcc8f45f40dadcdaf Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 22:15:30 +0200 Subject: [PATCH 102/118] Should run nightly part even if some OS is skipped. part of CURA-9494 --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 2fc4b76d41..3b77fa7697 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -106,7 +106,7 @@ jobs: # Run and update nightly release when the nightly input is set to true or if the schedule is triggered update-nightly-release: - if: ${{ inputs.nightly || github.event_name == 'schedule' }} + if: ${{ always() && (! cancelled()) && contains(needs.*.result, 'success') && (! contains(needs.*.result, 'failure')) && (inputs.nightly || github.event_name == 'schedule') }} runs-on: ubuntu-latest needs: [ windows-installer, linux-modern-installer, linux-legacy-installer, macos-installer, macos-arm-installer ] steps: From 13962a563e514d26975fa6c4765a864b7ec82bca Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 7 Sep 2023 22:38:11 +0200 Subject: [PATCH 103/118] Make sure there is at least one run-info. part of CURA-9494 --- .github/workflows/installers.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 3b77fa7697..4ebea0660b 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -113,11 +113,26 @@ jobs: - name: Checkout uses: actions/checkout@v3 + # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. + - name: Download the run info + if: ${{ contains(inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: macos-run-info + - name: Download the run info II + if: ${{ contains(inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} + uses: actions/download-artifact@v2 + with: + name: linux-run-info + + - name: Download the run info III + if: ${{ contains(inputs.os_list, 'windows') }} + uses: actions/download-artifact@v2 + with: + name: windows-run-info + - name: Set the run info as environment variables run: | . run_info.sh From bb57220756b56b2c2820765eb5b0898440d819a5 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 8 Sep 2023 08:07:34 +0200 Subject: [PATCH 104/118] Fix scheduled build. ... but skip mac for now. Try out in about 15 minutes, after that I'll put it back to 5 o'clock. related to CURA-9494 --- .github/workflows/installers.yml | 45 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 4ebea0660b..2ec2f3ed13 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -36,7 +36,7 @@ on: type: string schedule: # Daily at 5:20 CET - - cron: '20 4 * * *' + - cron: '23 4 * * *' env: CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} @@ -45,7 +45,7 @@ env: jobs: windows-installer: - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: ./.github/workflows/windows.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -57,7 +57,7 @@ jobs: secrets: inherit linux-modern-installer: - if: ${{ contains(inputs.os_list, 'linux-modern') }} + if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -69,7 +69,7 @@ jobs: secrets: inherit linux-legacy-installer: - if: ${{ contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ inputs.cura_conan_version }} @@ -122,13 +122,13 @@ jobs: name: macos-run-info - name: Download the run info II - if: ${{ contains(inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} uses: actions/download-artifact@v2 with: name: linux-run-info - name: Download the run info III - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: actions/download-artifact@v2 with: name: windows-run-info @@ -145,9 +145,10 @@ jobs: import datetime enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" os_list = [x.strip() for x in "${{ inputs.os_list }}".split(",")] - if 'linux-modern' in os_list: + scheduled = "${{ github.event_name == 'schedule' }}" == "true" + if 'linux-modern' in os_list or scheduled: linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" - if 'linux-legacy' in os_list: + if 'linux-legacy' in os_list or scheduled: linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" if 'macos-x64' in os_list: mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" @@ -155,7 +156,7 @@ jobs: if 'macos-arm64' in os_list: mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - if 'windows' in os_list: + if 'windows' in os_list or scheduled: win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] @@ -167,9 +168,9 @@ jobs: content = f.read() with open(output_env, "w") as f: f.write(content) - if 'linux-modern' in os_list: + if 'linux-modern' in os_list or scheduled: f.writelines(f"LINUX_MODERN={linux_modern}\n") - if 'linux-legacy' in os_list: + if 'linux-legacy' in os_list or scheduled: f.writelines(f"LINUX_LEGACY={linux_legacy}\n") if 'macos-x64' in os_list: f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") @@ -177,21 +178,21 @@ jobs: if 'macos-arm64' in os_list: f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") - if 'windows' in os_list: + if 'windows' in os_list or scheduled: f.writelines(f"WIN_MSI={win_msi}\n") f.writelines(f"WIN_EXE={win_exe}\n") f.writelines(f"NIGHTLY_NAME={nightly_name}\n") f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts - if: ${{ contains(inputs.os_list, 'linux-modern') }} + if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts - if: ${{ contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule'}} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage @@ -226,26 +227,26 @@ jobs: path: installers - name: Download win msi installer jobs artifacts - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers - name: Rename Linux (modern) installer to nightlies - if: ${{ contains(inputs.os_list, 'linux-modern') }} + if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} run: | mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage - name: Rename Linux (legacy) installer to nightlies - if: ${{ contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} run: | mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage @@ -262,20 +263,20 @@ jobs: mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - name: Rename Windows installers to nightlies - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} run: | mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - name: Update nightly release for Linux (modern) - if: ${{ contains(inputs.os_list, 'linux-modern') }} + if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Linux (legacy) - if: ${{ contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber env: @@ -298,7 +299,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Windows - if: ${{ contains(inputs.os_list, 'windows') }} + if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber From e3f8c8d2ae3eedee81ce3ca0fd521a206a30fb4c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 8 Sep 2023 08:54:33 +0200 Subject: [PATCH 105/118] Put scheduled build back to early morning. --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 2ec2f3ed13..8f9f5690aa 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -36,7 +36,7 @@ on: type: string schedule: # Daily at 5:20 CET - - cron: '23 4 * * *' + - cron: '20 4 * * *' env: CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} From 2de0a9711ae82f942967a2c335c6a99715740832 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 8 Sep 2023 22:52:41 +0200 Subject: [PATCH 106/118] Require packages from main branches instead of from CURA-10915. --- conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 083f2b43f6..aff8805b62 100644 --- a/conanfile.py +++ b/conanfile.py @@ -307,11 +307,11 @@ class CuraConan(ConanFile): self.requires("boost/1.82.0") self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") self.requires("zlib/1.2.13") - self.requires("pyarcus/(latest)@ultimaker/cura_10951") + self.requires("pyarcus/(latest)@ultimaker/testing") self.requires("curaengine/(latest)@ultimaker/cura_10475") - self.requires("pysavitar/(latest)@ultimaker/cura_10951") - self.requires("pynest2d/(latest)@ultimaker/cura_10951") - self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/cura_10951") + self.requires("pysavitar/(latest)@ultimaker/testing") + self.requires("pynest2d/(latest)@ultimaker/testing") + self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/testing") self.requires("uranium/(latest)@ultimaker/cura_10475") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") From 038a8358b11072aad3ae47c3a0c3b0e95973d688 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 08:23:43 +0200 Subject: [PATCH 107/118] Pin pyArcus, pySavitar and pynestd2d to released 5.3.0 Contributes CURA-10951 and CURA-10475 --- conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index aff8805b62..341bc488b0 100644 --- a/conanfile.py +++ b/conanfile.py @@ -307,10 +307,10 @@ class CuraConan(ConanFile): self.requires("boost/1.82.0") self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") self.requires("zlib/1.2.13") - self.requires("pyarcus/(latest)@ultimaker/testing") + self.requires("pyarcus/5.3.0") self.requires("curaengine/(latest)@ultimaker/cura_10475") - self.requires("pysavitar/(latest)@ultimaker/testing") - self.requires("pynest2d/(latest)@ultimaker/testing") + self.requires("pysavitar/5.3.0") + self.requires("pynest2d/5.3.0") self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/testing") self.requires("uranium/(latest)@ultimaker/cura_10475") self.requires("cura_binary_data/(latest)@ultimaker/testing") From 553ce41d0158dfc7081a7c722156e02087f3f72c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:01:11 +0200 Subject: [PATCH 108/118] Use default values for nightlies Contributes to CURA-10998 --- .github/workflows/installers.yml | 104 ++++++++++++++++--------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 8f9f5690aa..79e97df79c 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -39,67 +39,69 @@ on: - cron: '20 4 * * *' env: - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} + CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }} + CONAN_ARGS: ${{ inputs.conan_args || '' }} + ENTERPRISE: ${{ inputs.enterprise || false }} + STAGING: ${{ inputs.staging || false }} + OS_LIST: ${{ inputs.os_list || 'windows, linux-modern, linux-legacy, macos-x64, macos-arm64' }} jobs: windows-installer: - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'windows') || github.event_name == 'schedule' }} uses: ./.github/workflows/windows.yml with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} + cura_conan_version: ${{ env.CURA_CONAN_VERSION }} + conan_args: ${{ env.CONAN_ARGS }} + enterprise: ${{ env.ENTERPRISE }} + staging: ${{ env.STAGING }} architecture: X64 operating_system: windows-2022 secrets: inherit linux-modern-installer: - if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-modern') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} + cura_conan_version: ${{ env.CURA_CONAN_VERSION }} + conan_args: ${{ env.CONAN_ARGS }} + enterprise: ${{ env.ENTERPRISE }} + staging: ${{ env.STAGING }} architecture: X64 operating_system: ubuntu-22.04 secrets: inherit linux-legacy-installer: - if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-legacy') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} + cura_conan_version: ${{ env.CURA_CONAN_VERSION }} + conan_args: ${{ env.CONAN_ARGS }} + enterprise: ${{ env.ENTERPRISE }} + staging: ${{ env.STAGING }} architecture: X64 operating_system: ubuntu-20.04 secrets: inherit macos-installer: - if: ${{ contains(inputs.os_list, 'macos-x64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} + cura_conan_version: ${{ env.CURA_CONAN_VERSION }} + conan_args: ${{ env.CONAN_ARGS }} + enterprise: ${{ env.ENTERPRISE }} + staging: ${{ env.STAGING }} architecture: X64 operating_system: macos-11.0 secrets: inherit macos-arm-installer: - if: ${{ contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-arm64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise }} - staging: ${{ inputs.staging }} + cura_conan_version: ${{ env.CURA_CONAN_VERSION }} + conan_args: ${{ env.CONAN_ARGS }} + enterprise: ${{ env.ENTERPRISE }} + staging: ${{ env.STAGING }} architecture: ARM64 operating_system: self-hosted secrets: inherit @@ -116,19 +118,19 @@ jobs: # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. - name: Download the run info - if: ${{ contains(inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: macos-run-info - name: Download the run info II - if: ${{ contains(inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} + if: contains(env.OS_LIST, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: linux-run-info - name: Download the run info III - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: contains(env.OS_LIST, windows') }} uses: actions/download-artifact@v2 with: name: windows-run-info @@ -143,8 +145,8 @@ jobs: run: | import os import datetime - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - os_list = [x.strip() for x in "${{ inputs.os_list }}".split(",")] + enterprise = "-Enterprise" if "${{ env.ENTERPRISE }}" == "true" else "" + os_list = [x.strip() for x in "${{ env.OS_LIST }}".split(",")] scheduled = "${{ github.event_name == 'schedule' }}" == "true" if 'linux-modern' in os_list or scheduled: linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64" @@ -185,105 +187,105 @@ jobs: f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts - if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-modern') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts - if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule'}} + if: ${{ contains(env.OS_LIST, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage path: installers - name: Download mac x64 dmg installer jobs artifacts - if: ${{ contains(inputs.os_list, 'macos-x64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg path: installers - name: Download mac x64 pkg installer jobs artifacts - if: ${{ contains(inputs.os_list, 'macos-x64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg path: installers - name: Download mac arm dmg installer jobs artifacts - if: ${{ contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg path: installers - name: Download mac arm pkg installer jobs artifacts - if: ${{ contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg path: installers - name: Download win msi installer jobs artifacts - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers - name: Rename Linux (modern) installer to nightlies - if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-modern') }} run: | mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage - name: Rename Linux (legacy) installer to nightlies - if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-legacy') }} run: | mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage - name: Rename MacOS (X64) installers to nightlies - if: ${{ contains(inputs.os_list, 'macos-x64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') }} run: | mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg - name: Rename MacOS (ARM-64) installers to nightlies - if: ${{ contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-arm64') }} run: | mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - name: Rename Windows installers to nightlies - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'windows') }} run: | mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - name: Update nightly release for Linux (modern) - if: ${{ contains(inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-modern') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Linux (legacy) - if: ${{ contains(inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'linux-legacy') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (X64) - if: ${{ contains(inputs.os_list, 'macos-x64') }} + if: ${{ contains(env.OS_LIST, 'macos-x64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber @@ -291,7 +293,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (ARM-64) - if: ${{ contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(env.OS_LIST, 'macos-arm64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber @@ -299,7 +301,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Windows - if: ${{ contains(inputs.os_list, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(env.OS_LIST, 'windows') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber From 965a30775d56106353482d59d82780105bb8b177 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:07:09 +0200 Subject: [PATCH 109/118] Use `github.event.inputs` Contributes to CURA-10998 --- .github/workflows/installers.yml | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 79e97df79c..ce69f15528 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -47,7 +47,7 @@ env: jobs: windows-installer: - if: ${{ contains(env.OS_LIST, 'windows') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: ./.github/workflows/windows.yml with: cura_conan_version: ${{ env.CURA_CONAN_VERSION }} @@ -59,7 +59,7 @@ jobs: secrets: inherit linux-modern-installer: - if: ${{ contains(env.OS_LIST, 'linux-modern') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ env.CURA_CONAN_VERSION }} @@ -71,7 +71,7 @@ jobs: secrets: inherit linux-legacy-installer: - if: ${{ contains(env.OS_LIST, 'linux-legacy') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: cura_conan_version: ${{ env.CURA_CONAN_VERSION }} @@ -83,7 +83,7 @@ jobs: secrets: inherit macos-installer: - if: ${{ contains(env.OS_LIST, 'macos-x64') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: cura_conan_version: ${{ env.CURA_CONAN_VERSION }} @@ -95,7 +95,7 @@ jobs: secrets: inherit macos-arm-installer: - if: ${{ contains(env.OS_LIST, 'macos-arm64') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: cura_conan_version: ${{ env.CURA_CONAN_VERSION }} @@ -118,19 +118,19 @@ jobs: # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. - name: Download the run info - if: ${{ contains(env.OS_LIST, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: macos-run-info - name: Download the run info II - if: contains(env.OS_LIST, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} + if: contains(github.event.inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: linux-run-info - name: Download the run info III - if: contains(env.OS_LIST, windows') }} + if: contains(github.event.inputs.os_list, windows') }} uses: actions/download-artifact@v2 with: name: windows-run-info @@ -187,105 +187,105 @@ jobs: f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") - name: Download linux modern installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'linux-modern') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage path: installers - name: Download linux legacy installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'linux-legacy') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage path: installers - name: Download mac x64 dmg installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'macos-x64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg path: installers - name: Download mac x64 pkg installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'macos-x64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg path: installers - name: Download mac arm dmg installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg path: installers - name: Download mac arm pkg installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg path: installers - name: Download win msi installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'windows') }} + if: ${{ contains(github.event.inputs.os_list, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_MSI }}-msi path: installers - name: Download win exe installer jobs artifacts - if: ${{ contains(env.OS_LIST, 'windows') }} + if: ${{ contains(github.event.inputs.os_list, 'windows') }} uses: actions/download-artifact@v2 with: name: ${{ steps.filename.outputs.WIN_EXE }}-exe path: installers - name: Rename Linux (modern) installer to nightlies - if: ${{ contains(env.OS_LIST, 'linux-modern') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} run: | mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage - name: Rename Linux (legacy) installer to nightlies - if: ${{ contains(env.OS_LIST, 'linux-legacy') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-legacy') }} run: | mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage - name: Rename MacOS (X64) installers to nightlies - if: ${{ contains(env.OS_LIST, 'macos-x64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} run: | mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg - name: Rename MacOS (ARM-64) installers to nightlies - if: ${{ contains(env.OS_LIST, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} run: | mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - name: Rename Windows installers to nightlies - if: ${{ contains(env.OS_LIST, 'windows') }} + if: ${{ contains(github.event.inputs.os_list, 'windows') }} run: | mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - name: Update nightly release for Linux (modern) - if: ${{ contains(env.OS_LIST, 'linux-modern') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Linux (legacy) - if: ${{ contains(env.OS_LIST, 'linux-legacy') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-legacy') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (X64) - if: ${{ contains(env.OS_LIST, 'macos-x64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber @@ -293,7 +293,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for MacOS (ARM-64) - if: ${{ contains(env.OS_LIST, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber @@ -301,7 +301,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update nightly release for Windows - if: ${{ contains(env.OS_LIST, 'windows') }} + if: ${{ contains(github.event.inputs.os_list, 'windows') }} run: | gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber From e586fca22e504a4388309b67a428c19138348afe Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:08:33 +0200 Subject: [PATCH 110/118] Use `github.event.inputs` Contributes to CURA-10998 --- .github/workflows/installers.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index ce69f15528..28f4dab0f7 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -50,10 +50,10 @@ jobs: if: ${{ contains(github.event.inputs.os_list, 'windows') || github.event_name == 'schedule' }} uses: ./.github/workflows/windows.yml with: - cura_conan_version: ${{ env.CURA_CONAN_VERSION }} - conan_args: ${{ env.CONAN_ARGS }} - enterprise: ${{ env.ENTERPRISE }} - staging: ${{ env.STAGING }} + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.CONAN_ARGS }} + enterprise: ${{ github.event.inputs.ENTERPRISE }} + staging: ${{ github.event.inputs.STAGING }} architecture: X64 operating_system: windows-2022 secrets: inherit From c9bc1963e4cd6b47c2f074222accf2710cca3b27 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:11:21 +0200 Subject: [PATCH 111/118] Use `github.event.inputs` Contributes to CURA-10998 --- .github/workflows/installers.yml | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 28f4dab0f7..7208df4426 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -51,9 +51,9 @@ jobs: uses: ./.github/workflows/windows.yml with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} - conan_args: ${{ github.event.inputs.CONAN_ARGS }} - enterprise: ${{ github.event.inputs.ENTERPRISE }} - staging: ${{ github.event.inputs.STAGING }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise }} + staging: ${{ github.event.inputs.staging }} architecture: X64 operating_system: windows-2022 secrets: inherit @@ -62,10 +62,10 @@ jobs: if: ${{ contains(github.event.inputs.os_list, 'linux-modern') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: - cura_conan_version: ${{ env.CURA_CONAN_VERSION }} - conan_args: ${{ env.CONAN_ARGS }} - enterprise: ${{ env.ENTERPRISE }} - staging: ${{ env.STAGING }} + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise }} + staging: ${{ github.event.inputs.staging }} architecture: X64 operating_system: ubuntu-22.04 secrets: inherit @@ -74,10 +74,10 @@ jobs: if: ${{ contains(github.event.inputs.os_list, 'linux-legacy') || github.event_name == 'schedule' }} uses: ./.github/workflows/linux.yml with: - cura_conan_version: ${{ env.CURA_CONAN_VERSION }} - conan_args: ${{ env.CONAN_ARGS }} - enterprise: ${{ env.ENTERPRISE }} - staging: ${{ env.STAGING }} + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise }} + staging: ${{ github.event.inputs.staging }} architecture: X64 operating_system: ubuntu-20.04 secrets: inherit @@ -86,10 +86,10 @@ jobs: if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: - cura_conan_version: ${{ env.CURA_CONAN_VERSION }} - conan_args: ${{ env.CONAN_ARGS }} - enterprise: ${{ env.ENTERPRISE }} - staging: ${{ env.STAGING }} + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise }} + staging: ${{ github.event.inputs.staging }} architecture: X64 operating_system: macos-11.0 secrets: inherit @@ -98,10 +98,10 @@ jobs: if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') || github.event_name == 'schedule' }} uses: ./.github/workflows/macos.yml with: - cura_conan_version: ${{ env.CURA_CONAN_VERSION }} - conan_args: ${{ env.CONAN_ARGS }} - enterprise: ${{ env.ENTERPRISE }} - staging: ${{ env.STAGING }} + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise }} + staging: ${{ github.event.inputs.staging }} architecture: ARM64 operating_system: self-hosted secrets: inherit From 4c8f8c8a00214d00820789e9dd1784b3807c5397 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:12:48 +0200 Subject: [PATCH 112/118] fixed missing start of context Contributes to CURA-10998 --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 7208df4426..403f8f9cb4 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -124,7 +124,7 @@ jobs: name: macos-run-info - name: Download the run info II - if: contains(github.event.inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: linux-run-info From d1e4e018b9b3a70ae38e5f976eabcd540b60a50f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:13:54 +0200 Subject: [PATCH 113/118] fixed missing start of context Contributes to CURA-10998 --- .github/workflows/installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 403f8f9cb4..ca7455678a 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -130,7 +130,7 @@ jobs: name: linux-run-info - name: Download the run info III - if: contains(github.event.inputs.os_list, windows') }} + if: ${{ contains(github.event.inputs.os_list, windows') }} uses: actions/download-artifact@v2 with: name: windows-run-info From 7a3d852d41b45a4c6d551f6bf75be3bc7c1c9d6d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:18:32 +0200 Subject: [PATCH 114/118] fixed syntax erros Contributes to CURA-10998 --- .github/workflows/installers.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index ca7455678a..d7dc34c735 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -118,19 +118,19 @@ jobs: # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. - name: Download the run info - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} + if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} uses: actions/download-artifact@v2 with: name: macos-run-info - name: Download the run info II - if: ${{ contains(github.event.inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} + if: ${{ contains(github.event.inputs.os_list, 'linux-modern') || contains(inputs.os_list, 'linux-legacy') }} uses: actions/download-artifact@v2 with: name: linux-run-info - name: Download the run info III - if: ${{ contains(github.event.inputs.os_list, windows') }} + if: ${{ contains(github.event.inputs.os_list, 'windows') }} uses: actions/download-artifact@v2 with: name: windows-run-info From 312c2a5bb292783d99b4167b773d2f4d285ba1c5 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 10:20:43 +0200 Subject: [PATCH 115/118] github.event.inputs are strings Contributes to CURA-10998 --- .github/workflows/installers.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index d7dc34c735..93fa12c43e 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -52,8 +52,8 @@ jobs: with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise }} - staging: ${{ github.event.inputs.staging }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} architecture: X64 operating_system: windows-2022 secrets: inherit @@ -64,8 +64,8 @@ jobs: with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise }} - staging: ${{ github.event.inputs.staging }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} architecture: X64 operating_system: ubuntu-22.04 secrets: inherit @@ -76,8 +76,8 @@ jobs: with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise }} - staging: ${{ github.event.inputs.staging }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} architecture: X64 operating_system: ubuntu-20.04 secrets: inherit @@ -88,8 +88,8 @@ jobs: with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise }} - staging: ${{ github.event.inputs.staging }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} architecture: X64 operating_system: macos-11.0 secrets: inherit @@ -100,8 +100,8 @@ jobs: with: cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise }} - staging: ${{ github.event.inputs.staging }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} architecture: ARM64 operating_system: self-hosted secrets: inherit From 8126b9a6f641f56a3b9606f2bd3ab784e5d5ae7a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 12:24:37 +0200 Subject: [PATCH 116/118] Use testing package from Uranium and CuraEngine Contributes to CURA-10475 and CURA-10591 --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 341bc488b0..315e494daf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -308,11 +308,11 @@ class CuraConan(ConanFile): self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") self.requires("zlib/1.2.13") self.requires("pyarcus/5.3.0") - self.requires("curaengine/(latest)@ultimaker/cura_10475") + self.requires("curaengine/(latest)@ultimaker/testing") self.requires("pysavitar/5.3.0") self.requires("pynest2d/5.3.0") self.requires("curaengine_plugin_gradual_flow/(latest)@ultimaker/testing") - self.requires("uranium/(latest)@ultimaker/cura_10475") + self.requires("uranium/(latest)@ultimaker/testing") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") if self.options.internal: From 69bdcfa52f9df1546cc85ca6ff2457293f8b831c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 13:29:02 +0200 Subject: [PATCH 117/118] Simplified All Installer workflow No need to make exceptions in this workflow for different OSes it's called the **All** Installer for a reason. If people need a specific OS installer run the linux, macos or windows installer itself. Added a time-out to the macos workflow if the self-hosted isn't online. Moved the ARM64 jobs to the end and added an `always()` condition to the update of the release, such that the GH hosted runners will at least update. Add missing download for MacOS X64 Contributes to CURA-10475 and CURA-10591 --- .github/workflows/installers.yml | 462 ++++++++++++------------- .github/workflows/linux.yml | 29 +- .github/workflows/macos.yml | 565 ++++++++++++++++--------------- .github/workflows/windows.yml | 551 +++++++++++++++--------------- 4 files changed, 782 insertions(+), 825 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index e2875ba5a3..9c528b4643 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -2,279 +2,233 @@ name: All installers run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - nightly: - description: 'Upload to nightly release' - default: false - required: true - type: boolean - os_list: - description: 'List of OS(-variant)s to build for' - default: "windows, linux`, macos-x64, macos-arm64" - required: true - type: string - schedule: - # Daily at 5:20 CET - - cron: '20 4 * * *' + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + nightly: + description: 'Upload to nightly release' + default: false + required: true + type: boolean + + schedule: + # Daily at 5:20 CET + - cron: '20 4 * * *' env: - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }} - CONAN_ARGS: ${{ inputs.conan_args || '' }} - ENTERPRISE: ${{ inputs.enterprise || false }} - STAGING: ${{ inputs.staging || false }} - OS_LIST: ${{ inputs.os_list || 'windows, linux, macos-x64, macos-arm64' }} + CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }} + CONAN_ARGS: ${{ inputs.conan_args || '' }} + ENTERPRISE: ${{ inputs.enterprise || false }} + STAGING: ${{ inputs.staging || false }} jobs: - windows-installer: - if: ${{ contains(github.event.inputs.os_list, 'windows') || github.event_name == 'schedule' }} - uses: ./.github/workflows/windows.yml + windows-installer: + uses: ./.github/workflows/windows.yml + with: + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} + architecture: X64 + operating_system: windows-2022 + secrets: inherit + + linux-installer: + uses: ./.github/workflows/linux.yml + with: + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} + architecture: X64 + operating_system: ubuntu-22.04 + secrets: inherit + + macos-installer: + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} + architecture: X64 + operating_system: macos-11.0 + secrets: inherit + + macos-arm-installer: + uses: ./.github/workflows/macos.yml + with: + cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} + conan_args: ${{ github.event.inputs.conan_args }} + enterprise: ${{ github.event.inputs.enterprise == 'true' }} + staging: ${{ github.event.inputs.staging == 'true' }} + architecture: ARM64 + operating_system: self-hosted + secrets: inherit + + # Run and update nightly release when the nightly input is set to true or if the schedule is triggered + update-nightly-release: + if: ${{ always() && (! cancelled()) && contains(needs.*.result, 'success') && (! contains(needs.*.result, 'failure')) && (inputs.nightly || github.event_name == 'schedule') }} + runs-on: ubuntu-latest + needs: [ windows-installer, linux-installer, macos-installer, macos-arm-installer ] + steps: + - name: Checkout + uses: actions/checkout@v3 + + # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. + + - name: Download the run info + uses: actions/download-artifact@v2 with: - cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} - conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise == 'true' }} - staging: ${{ github.event.inputs.staging == 'true' }} - architecture: X64 - operating_system: windows-2022 - secrets: inherit + name: linux-run-info - linux-modern-installer: - if: ${{ contains(github.event.inputs.os_list, 'linux') || github.event_name == 'schedule' }} - uses: ./.github/workflows/linux.yml + - name: Set the run info as environment variables + run: | + . run_info.sh + + - name: Output the name file name and extension + id: filename + shell: python + run: | + import os + import datetime + enterprise = "-Enterprise" if "${{ github.event.inputs.enterprise }}" == "true" else "" + linux = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" + mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" + mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" + win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" + nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] + nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"LINUX={linux}\n") + f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") + f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") + f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") + f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") + f.writelines(f"WIN_MSI={win_msi}\n") + f.writelines(f"WIN_EXE={win_exe}\n") + f.writelines(f"NIGHTLY_NAME={nightly_name}\n") + f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") + + - name: Download linux installer jobs artifacts + uses: actions/download-artifact@v2 with: - cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} - conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise == 'true' }} - staging: ${{ github.event.inputs.staging == 'true' }} - architecture: X64 - operating_system: ubuntu-22.04 - secrets: inherit + name: ${{ steps.filename.outputs.LINUX }}-AppImage + path: installers - macos-installer: - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || github.event_name == 'schedule' }} - uses: ./.github/workflows/macos.yml + - name: Rename Linux installer to nightlies + run: | + mv installers/${{ steps.filename.outputs.LINUX }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage + + - name: Update nightly release for Linux + run: | + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Download win msi installer jobs artifacts + uses: actions/download-artifact@v2 with: - cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} - conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise == 'true' }} - staging: ${{ github.event.inputs.staging == 'true' }} - architecture: X64 - operating_system: macos-11.0 - secrets: inherit + name: ${{ steps.filename.outputs.WIN_MSI }}-msi + path: installers - macos-arm-installer: - if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') || github.event_name == 'schedule' }} - uses: ./.github/workflows/macos.yml + - name: Download win exe installer jobs artifacts + uses: actions/download-artifact@v2 with: - cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} - conan_args: ${{ github.event.inputs.conan_args }} - enterprise: ${{ github.event.inputs.enterprise == 'true' }} - staging: ${{ github.event.inputs.staging == 'true' }} - architecture: ARM64 - operating_system: self-hosted - secrets: inherit + name: ${{ steps.filename.outputs.WIN_EXE }}-exe + path: installers - # Run and update nightly release when the nightly input is set to true or if the schedule is triggered - update-nightly-release: - if: ${{ always() && (! cancelled()) && contains(needs.*.result, 'success') && (! contains(needs.*.result, 'failure')) && (inputs.nightly || github.event_name == 'schedule') }} - runs-on: ubuntu-latest - needs: [ windows-installer, linux-installer, macos-installer, macos-arm-installer ] - steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Rename Windows installers to nightlies + run: | + mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi + mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. + - name: Update nightly release for Windows + run: | + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Download the run info - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }} - uses: actions/download-artifact@v2 - with: - name: macos-run-info + - name: Download MacOS (X64) dmg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg + path: installers - - name: Download the run info II - if: ${{ contains(github.event.inputs.os_list, 'linux') }} - uses: actions/download-artifact@v2 - with: - name: linux-run-info + - name: Download MacOS (X64) pkg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg + path: installers - - name: Download the run info III - if: ${{ contains(github.event.inputs.os_list, 'windows') }} - uses: actions/download-artifact@v2 - with: - name: windows-run-info + - name: Rename MacOS (X64) installers to nightlies + run: | + mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg + mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg - - name: Set the run info as environment variables - run: | - . run_info.sh + - name: Update nightly release for MacOS (X64) + run: | + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - import datetime - enterprise = "-Enterprise" if "${{ env.ENTERPRISE }}" == "true" else "" - os_list = [x.strip() for x in "${{ env.OS_LIST }}".split(",")] - scheduled = "${{ github.event_name == 'schedule' }}" == "true" - if 'linux-modern' in os_list or scheduled: - linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64" - if 'macos-x64' in os_list: - mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" - mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64" - if 'macos-arm64' in os_list: - mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64" - if 'windows' in os_list or scheduled: - win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" - win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" - nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0] - nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - if 'linux-modern' in os_list or scheduled: - f.writelines(f"LINUX_MODERN={linux_modern}\n") - if 'macos-x64' in os_list: - f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n") - f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n") - if 'macos-arm64' in os_list: - f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n") - f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") - if 'windows' in os_list or scheduled: - f.writelines(f"WIN_MSI={win_msi}\n") - f.writelines(f"WIN_EXE={win_exe}\n") - f.writelines(f"NIGHTLY_NAME={nightly_name}\n") - f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") + - name: Download MacOS (ARM-64) dmg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg + path: installers - - name: Download linux modern installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage - path: installers + - name: Download acOS (ARM-64) pkg installer jobs artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg + path: installers - - name: Download mac x64 dmg installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg - path: installers + - name: Rename MacOS (ARM-64) installers to nightlies + run: | + mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg + mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - - name: Download mac x64 pkg installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg - path: installers + - name: Update nightly release for MacOS (ARM-64) + run: | + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber + gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Download mac arm dmg installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg - path: installers - - - name: Download mac arm pkg installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg - path: installers - - - name: Download win msi installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'windows') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.WIN_MSI }}-msi - path: installers - - - name: Download win exe installer jobs artifacts - if: ${{ contains(github.event.inputs.os_list, 'windows') }} - uses: actions/download-artifact@v2 - with: - name: ${{ steps.filename.outputs.WIN_EXE }}-exe - path: installers - - - name: Rename Linux (modern) installer to nightlies - if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} - run: | - mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage - - - name: Rename MacOS (X64) installers to nightlies - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} - run: | - mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg - mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg - - - name: Rename MacOS (ARM-64) installers to nightlies - if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} - run: | - mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg - mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg - - - name: Rename Windows installers to nightlies - if: ${{ contains(github.event.inputs.os_list, 'windows') }} - run: | - mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi - mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe - - - name: Update nightly release for Linux (modern) - if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }} - run: | - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update nightly release for MacOS (X64) - if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} - run: | - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update nightly release for MacOS (ARM-64) - if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') }} - run: | - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update nightly release for Windows - if: ${{ contains(github.event.inputs.os_list, 'windows') }} - run: | - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber - gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update nightly release description (with date) - run: | - gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update nightly release description (with date) + if: always() + run: | + gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 375d753006..13fc7eefc2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,7 +38,7 @@ on: type: choice options: - ubuntu-22.04 - - ubuntu-20.04 + workflow_call: inputs: cura_conan_version: @@ -82,6 +82,7 @@ env: jobs: cura-installer-create: + timeout-minutes: 30 runs-on: ${{ inputs.operating_system }} steps: @@ -257,19 +258,19 @@ jobs: dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage retention-days: 5 - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: linux-run-info - path: | - run_info.sh - retention-days: 5 + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: linux-run-info + path: | + run_info.sh + retention-days: 5 notify-export: if: ${{ always() }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3667705952..e8423caba7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,293 +2,294 @@ name: Macos Installer run-name: ${{ inputs.cura_conan_version }} for Macos-${{ inputs.architecture }} by @${{ github.actor }} on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: choice - options: - - X64 - - ARM64 - operating_system: - description: 'OS' - required: true - default: 'macos-11' - type: choice - options: - - self-hosted - - macos-11 - - macos-12 - workflow_call: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: string - operating_system: - description: 'OS' - required: true - default: 'macos-11' - type: string + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: choice + options: + - X64 + - ARM64 + operating_system: + description: 'OS' + required: true + default: 'macos-11' + type: choice + options: + - self-hosted + - macos-11 + - macos-12 + workflow_call: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: string + operating_system: + description: 'OS' + required: true + default: 'macos-11' + type: string env: - CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }} - MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }} - MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }} - MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }} - MACOS_CERT_INSTALLER_P12: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} - MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }} - MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }} - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} + CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} + CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} + CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }} + MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }} + MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }} + MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }} + MACOS_CERT_INSTALLER_P12: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} + MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }} + MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }} + CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} + ENTERPRISE: ${{ inputs.enterprise }} + STAGING: ${{ inputs.staging }} jobs: - cura-installer-create: - runs-on: ${{ inputs.operating_system }} + cura-installer-create: + timeout-minutes: 30 + runs-on: ${{ inputs.operating_system }} - outputs: - INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} + outputs: + INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} - steps: - - name: Checkout - uses: actions/checkout@v3 + steps: + - name: Checkout + uses: actions/checkout@v3 - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - - name: Cache Conan local repository packages (Bash) - uses: actions/cache@v3 - with: - path: | - $HOME/.conan/data - $HOME/.conan/conan_download_cache - key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache - - - name: Install MacOS system requirements - run: brew install cmake autoconf automake ninja create-dmg - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Remove Macos keychain (Bash) - run: security delete-keychain signing_temp.keychain || true - - - name: Configure Macos keychain Developer Cert(Bash) - id: macos-keychain-developer-cert - uses: apple-actions/import-codesign-certs@v1 - with: - keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} - p12-file-base64: ${{ secrets.MACOS_CERT_P12 }} - p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - - name: Configure Macos keychain Installer Cert (Bash) - id: macos-keychain-installer-cert - uses: apple-actions/import-codesign-certs@v1 - with: - keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} - create-keychain: false # keychain is created in previous use of action. - p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} - p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Use Conan download cache (Bash) - run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" - - - name: Create the Packages (Bash) - run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json" - - - name: Upload the Package(s) - if: always() - run: | - conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (bash) - run: | - . ./cura_inst/bin/activate_github_actions_env.sh - . ./cura_inst/bin/activate_github_actions_version_env.sh - - - name: Unlock Macos keychain (Bash) - run: security unlock -p $TEMP_KEYCHAIN_PASSWORD signing_temp.keychain - env: - TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain-developer-cert.outputs.keychain-password }} - - # FIXME: This is a workaround to ensure that we use and pack a shared library for OpenSSL 1.1.1l. We currently compile - # OpenSSL statically for CPython, but our Python Dependenies (such as PyQt6) require a shared library. - # Because Conan won't allow for building the same library with two different options (easily) we need to install it explicitly - # and do a manual copy to the VirtualEnv, such that Pyinstaller can find it. - - name: Install OpenSSL shared - run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy - - - name: Copy OpenSSL shared (Bash) - run: | - cp ./openssl/lib/*.so* ./cura_inst/bin/ || true - cp ./openssl/lib/*.dylib* ./cura_inst/bin/ || true - - - name: Create the Cura dist - run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-${{ inputs.architecture }}" - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") - - - name: Summarize the used Conan dependencies - shell: python - run: | - import os - import json - from pathlib import Path - - conan_install_info_path = Path("cura_inst/conan_install_info.json") - conan_info = {"installed": []} - if os.path.exists(conan_install_info_path): - with open(conan_install_info_path, "r") as f: - conan_info = json.load(f) - sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]]) - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") - f.writelines("## Conan packages:\n") - for dep in sorted_deps: - f.writelines(f"`{dep}`\n") - - - name: Summarize the used Python modules - shell: python - run: | - import os - import pkg_resources - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("## Python modules:\n") - for package in pkg_resources.working_set: - f.writelines(f"`{package.key}/{package.version}`\n") - - - name: Create the Macos dmg (Bash) - run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ steps.filename.outputs.INSTALLER_FILENAME }}" --build_dmg --build_pkg --app_name "$CURA_APP_NAME" - working-directory: dist - - - name: Upload the dmg - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-dmg - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.dmg - retention-days: 5 - - - name: Upload the pkg - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-pkg - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.pkg - retention-days: 5 - - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: macos-run-info - path: | - run_info.sh - retention-days: 5 - - - notify-export: - if: ${{ always() }} - needs: [ cura-installer-create ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main + - name: Setup Python and pip + uses: actions/setup-python@v4 with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "Create the Cura distributions" - success_body: "Installers for ${{ inputs.cura_conan_version }}" - failure_title: "Failed to create the Cura distributions" - failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit + python-version: '3.10.x' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements-conan-package.txt + + - name: Install Python requirements for runner + run: pip install -r .github/workflows/requirements-conan-package.txt + + - name: Cache Conan local repository packages (Bash) + uses: actions/cache@v3 + with: + path: | + $HOME/.conan/data + $HOME/.conan/conan_download_cache + key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache + + - name: Install MacOS system requirements + run: brew install cmake autoconf automake ninja create-dmg + + - name: Create the default Conan profile + run: conan profile new default --detect --force + + - name: Remove Macos keychain (Bash) + run: security delete-keychain signing_temp.keychain || true + + - name: Configure Macos keychain Developer Cert(Bash) + id: macos-keychain-developer-cert + uses: apple-actions/import-codesign-certs@v1 + with: + keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} + p12-file-base64: ${{ secrets.MACOS_CERT_P12 }} + p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} + + - name: Configure Macos keychain Installer Cert (Bash) + id: macos-keychain-installer-cert + uses: apple-actions/import-codesign-certs@v1 + with: + keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} + create-keychain: false # keychain is created in previous use of action. + p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} + p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} + + - name: Get Conan configuration + run: | + conan config install https://github.com/Ultimaker/conan-config.git + conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" + + - name: Use Conan download cache (Bash) + run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" + + - name: Create the Packages (Bash) + run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json" + + - name: Upload the Package(s) + if: always() + run: | + conan upload "*" -r cura --all -c + + - name: Set Environment variables for Cura (bash) + run: | + . ./cura_inst/bin/activate_github_actions_env.sh + . ./cura_inst/bin/activate_github_actions_version_env.sh + + - name: Unlock Macos keychain (Bash) + run: security unlock -p $TEMP_KEYCHAIN_PASSWORD signing_temp.keychain + env: + TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain-developer-cert.outputs.keychain-password }} + + # FIXME: This is a workaround to ensure that we use and pack a shared library for OpenSSL 1.1.1l. We currently compile + # OpenSSL statically for CPython, but our Python Dependenies (such as PyQt6) require a shared library. + # Because Conan won't allow for building the same library with two different options (easily) we need to install it explicitly + # and do a manual copy to the VirtualEnv, such that Pyinstaller can find it. + - name: Install OpenSSL shared + run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy + + - name: Copy OpenSSL shared (Bash) + run: | + cp ./openssl/lib/*.so* ./cura_inst/bin/ || true + cp ./openssl/lib/*.dylib* ./cura_inst/bin/ || true + + - name: Create the Cura dist + run: pyinstaller ./cura_inst/UltiMaker-Cura.spec + + - name: Output the name file name and extension + id: filename + shell: python + run: | + import os + enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" + installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-${{ inputs.architecture }}" + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") + + - name: Summarize the used Conan dependencies + shell: python + run: | + import os + import json + from pathlib import Path + + conan_install_info_path = Path("cura_inst/conan_install_info.json") + conan_info = {"installed": []} + if os.path.exists(conan_install_info_path): + with open(conan_install_info_path, "r") as f: + conan_info = json.load(f) + sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]]) + + summary_env = os.environ["GITHUB_STEP_SUMMARY"] + content = "" + if os.path.exists(summary_env): + with open(summary_env, "r") as f: + content = f.read() + + with open(summary_env, "w") as f: + f.write(content) + f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") + f.writelines("## Conan packages:\n") + for dep in sorted_deps: + f.writelines(f"`{dep}`\n") + + - name: Summarize the used Python modules + shell: python + run: | + import os + import pkg_resources + summary_env = os.environ["GITHUB_STEP_SUMMARY"] + content = "" + if os.path.exists(summary_env): + with open(summary_env, "r") as f: + content = f.read() + + with open(summary_env, "w") as f: + f.write(content) + f.writelines("## Python modules:\n") + for package in pkg_resources.working_set: + f.writelines(f"`{package.key}/{package.version}`\n") + + - name: Create the Macos dmg (Bash) + run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ steps.filename.outputs.INSTALLER_FILENAME }}" --build_dmg --build_pkg --app_name "$CURA_APP_NAME" + working-directory: dist + + - name: Upload the dmg + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-dmg + path: | + dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.dmg + retention-days: 5 + + - name: Upload the pkg + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-pkg + path: | + dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.pkg + retention-days: 5 + + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: macos-run-info + path: | + run_info.sh + retention-days: 5 + + + notify-export: + if: ${{ always() }} + needs: [ cura-installer-create ] + + uses: ultimaker/cura/.github/workflows/notify.yml@main + with: + success: ${{ contains(join(needs.*.result, ','), 'success') }} + success_title: "Create the Cura distributions" + success_body: "Installers for ${{ inputs.cura_conan_version }}" + failure_title: "Failed to create the Cura distributions" + failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" + secrets: inherit diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f6de818eb4..333e47e589 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,286 +2,287 @@ name: Windows Installer run-name: ${{ inputs.cura_conan_version }} for Windows-${{ inputs.architecture }} by @${{ github.actor }} on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: choice - options: - - X64 - operating_system: - description: 'OS' - required: true - default: 'windows-2022' - type: choice - options: - - windows-2022 - workflow_call: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: string - operating_system: - description: 'OS' - required: true - default: 'windows-2022' - type: string + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: choice + options: + - X64 + operating_system: + description: 'OS' + required: true + default: 'windows-2022' + type: choice + options: + - windows-2022 + workflow_call: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: string + operating_system: + description: 'OS' + required: true + default: 'windows-2022' + type: string env: - CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} - WIN_CERT_INSTALLER_CER: ${{ secrets.WIN_CERT_INSTALLER_CER }} - WIN_CERT_INSTALLER_CER_PASS: ${{ secrets.WIN_CERT_INSTALLER_CER_PASS }} - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} + CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} + CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} + WIN_CERT_INSTALLER_CER: ${{ secrets.WIN_CERT_INSTALLER_CER }} + WIN_CERT_INSTALLER_CER_PASS: ${{ secrets.WIN_CERT_INSTALLER_CER_PASS }} + CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} + ENTERPRISE: ${{ inputs.enterprise }} + STAGING: ${{ inputs.staging }} jobs: - cura-installer-create: - runs-on: ${{ inputs.operating_system }} + cura-installer-create: + timeout-minutes: 30 + runs-on: ${{ inputs.operating_system }} - outputs: - INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} + outputs: + INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} - steps: - - name: Checkout - uses: actions/checkout@v3 + steps: + - name: Checkout + uses: actions/checkout@v3 - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - - name: Cache Conan local repository packages (Powershell) - uses: actions/cache@v3 - with: - path: | - C:\Users\runneradmin\.conan\data - C:\.conan - C:\Users\runneradmin\.conan\conan_download_cache - key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Use Conan download cache (Powershell) - run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache" - - - name: Create the Packages (Powershell) - run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING --json "cura_inst/conan_install_info.json" - - - name: Upload the Package(s) - if: always() - run: | - conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (Powershell) - run: | - echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - .\cura_inst\Scripts\activate_github_actions_env.ps1 - .\cura_inst\Scripts\activate_github_actions_version_env.ps1 - - - name: Install OpenSSL shared - run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy - - - name: Copy OpenSSL shared (Powershell) - run: | - cp openssl/bin/*.dll ./cura_inst/Scripts/ - cp openssl/lib/*.lib ./cura_inst/Lib/ - - - name: Create the Cura dist - run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-${{ inputs.architecture }}" - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") - - - name: Summarize the used Conan dependencies - shell: python - run: | - import os - import json - from pathlib import Path - - conan_install_info_path = Path("cura_inst/conan_install_info.json") - conan_info = {"installed": []} - if os.path.exists(conan_install_info_path): - with open(conan_install_info_path, "r") as f: - conan_info = json.load(f) - sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]]) - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") - f.writelines("## Conan packages:\n") - for dep in sorted_deps: - f.writelines(f"`{dep}`\n") - - - name: Summarize the used Python modules - shell: python - run: | - import os - import pkg_resources - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("## Python modules:\n") - for package in pkg_resources.working_set: - f.writelines(f"`{package.key}/{package.version}`\n") - - - name: Create PFX certificate from BASE64_PFX_CONTENT secret - id: create-pfx - env: - PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }} - run: | - $pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; - $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); - Set-Content $pfxPath -Value $encodedBytes -AsByteStream; - echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT; - - - name: Create the Windows msi installer (Powershell) - run: | - python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" "$Env:CURA_APP_NAME" - working-directory: dist - - - name: Sign the Windows msi installer (Powershell) - env: - PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} - run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" - working-directory: dist - - - name: Create the Windows exe installer (Powershell) - run: | - python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" - working-directory: dist - - - name: Sign the Windows exe installer (Powershell) - env: - PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} - run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" - working-directory: dist - - - name: Upload the msi - uses: actions/upload-artifact@v3 - with: - name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-msi - path: | - dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.msi - retention-days: 5 - - - name: Upload the exe - uses: actions/upload-artifact@v3 - with: - name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-exe - path: | - dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe - retention-days: 5 - - # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: windows-run-info - path: | - run_info.sh - retention-days: 5 - - notify-export: - if: ${{ always() }} - needs: [ cura-installer-create ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main + - name: Setup Python and pip + uses: actions/setup-python@v4 with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "Create the Cura distributions" - success_body: "Installers for ${{ inputs.cura_conan_version }}" - failure_title: "Failed to create the Cura distributions" - failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit + python-version: '3.10.x' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements-conan-package.txt + + - name: Install Python requirements for runner + run: pip install -r .github/workflows/requirements-conan-package.txt + + - name: Cache Conan local repository packages (Powershell) + uses: actions/cache@v3 + with: + path: | + C:\Users\runneradmin\.conan\data + C:\.conan + C:\Users\runneradmin\.conan\conan_download_cache + key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache + + - name: Create the default Conan profile + run: conan profile new default --detect --force + + - name: Get Conan configuration + run: | + conan config install https://github.com/Ultimaker/conan-config.git + conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" + + - name: Use Conan download cache (Powershell) + run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache" + + - name: Create the Packages (Powershell) + run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING --json "cura_inst/conan_install_info.json" + + - name: Upload the Package(s) + if: always() + run: | + conan upload "*" -r cura --all -c + + - name: Set Environment variables for Cura (Powershell) + run: | + echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + .\cura_inst\Scripts\activate_github_actions_env.ps1 + .\cura_inst\Scripts\activate_github_actions_version_env.ps1 + + - name: Install OpenSSL shared + run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy + + - name: Copy OpenSSL shared (Powershell) + run: | + cp openssl/bin/*.dll ./cura_inst/Scripts/ + cp openssl/lib/*.lib ./cura_inst/Lib/ + + - name: Create the Cura dist + run: pyinstaller ./cura_inst/UltiMaker-Cura.spec + + - name: Output the name file name and extension + id: filename + shell: python + run: | + import os + enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" + installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-${{ inputs.architecture }}" + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") + + - name: Summarize the used Conan dependencies + shell: python + run: | + import os + import json + from pathlib import Path + + conan_install_info_path = Path("cura_inst/conan_install_info.json") + conan_info = {"installed": []} + if os.path.exists(conan_install_info_path): + with open(conan_install_info_path, "r") as f: + conan_info = json.load(f) + sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]]) + + summary_env = os.environ["GITHUB_STEP_SUMMARY"] + content = "" + if os.path.exists(summary_env): + with open(summary_env, "r") as f: + content = f.read() + + with open(summary_env, "w") as f: + f.write(content) + f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") + f.writelines("## Conan packages:\n") + for dep in sorted_deps: + f.writelines(f"`{dep}`\n") + + - name: Summarize the used Python modules + shell: python + run: | + import os + import pkg_resources + summary_env = os.environ["GITHUB_STEP_SUMMARY"] + content = "" + if os.path.exists(summary_env): + with open(summary_env, "r") as f: + content = f.read() + + with open(summary_env, "w") as f: + f.write(content) + f.writelines("## Python modules:\n") + for package in pkg_resources.working_set: + f.writelines(f"`{package.key}/{package.version}`\n") + + - name: Create PFX certificate from BASE64_PFX_CONTENT secret + id: create-pfx + env: + PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }} + run: | + $pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; + $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); + Set-Content $pfxPath -Value $encodedBytes -AsByteStream; + echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT; + + - name: Create the Windows msi installer (Powershell) + run: | + python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" "$Env:CURA_APP_NAME" + working-directory: dist + + - name: Sign the Windows msi installer (Powershell) + env: + PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} + run: | + & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" + working-directory: dist + + - name: Create the Windows exe installer (Powershell) + run: | + python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" + working-directory: dist + + - name: Sign the Windows exe installer (Powershell) + env: + PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} + run: | + & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" + working-directory: dist + + - name: Upload the msi + uses: actions/upload-artifact@v3 + with: + name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-msi + path: | + dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.msi + retention-days: 5 + + - name: Upload the exe + uses: actions/upload-artifact@v3 + with: + name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-exe + path: | + dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe + retention-days: 5 + + # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. + - name: Write the run info + shell: python + run: | + import os + with open("run_info.sh", "w") as f: + f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') + + # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. + - name: Upload the run info + uses: actions/upload-artifact@v3 + with: + name: windows-run-info + path: | + run_info.sh + retention-days: 5 + + notify-export: + if: ${{ always() }} + needs: [ cura-installer-create ] + + uses: ultimaker/cura/.github/workflows/notify.yml@main + with: + success: ${{ contains(join(needs.*.result, ','), 'success') }} + success_title: "Create the Cura distributions" + success_body: "Installers for ${{ inputs.cura_conan_version }}" + failure_title: "Failed to create the Cura distributions" + failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" + secrets: inherit From 86aaaf4677eb6dce812612dbc76116b6a009e57d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Sep 2023 15:29:55 +0200 Subject: [PATCH 118/118] Removed time-outs They will cancel running jobs not idle waiting Contributes to CURA-10475 and CURA-10591 --- .github/workflows/linux.yml | 1 - .github/workflows/macos.yml | 1 - .github/workflows/windows.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 13fc7eefc2..8b2f30e3ac 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -82,7 +82,6 @@ env: jobs: cura-installer-create: - timeout-minutes: 30 runs-on: ${{ inputs.operating_system }} steps: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e8423caba7..de3415f93b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -90,7 +90,6 @@ env: jobs: cura-installer-create: - timeout-minutes: 30 runs-on: ${{ inputs.operating_system }} outputs: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 333e47e589..9c9775cae7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -82,7 +82,6 @@ env: jobs: cura-installer-create: - timeout-minutes: 30 runs-on: ${{ inputs.operating_system }} outputs: