From c6b8664c8e276413445ed25d3a8957101143c006 Mon Sep 17 00:00:00 2001 From: Maciej Lisiewski Date: Sat, 17 May 2025 17:36:39 +0200 Subject: [PATCH 1/4] Fix building with cmake 4.x on Arch (#9644) * Fix CMAKE version check to only apply to Windows * Treat arch-based distros as arch when building * Fix cmake policy version issue on Arch * Remove duplicate cmake minimum version check * Move cmake 4.x compatibility fix to BuildLinux.sh --- BuildLinux.sh | 6 ++++++ CMakeLists.txt | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/BuildLinux.sh b/BuildLinux.sh index 382bdac733..8d0fab87ab 100755 --- a/BuildLinux.sh +++ b/BuildLinux.sh @@ -84,6 +84,10 @@ then exit 0 fi + +# cmake 4.x compatibility workaround +export CMAKE_POLICY_VERSION_MINIMUM=3.5 + DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"') DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"') # Check for direct distribution match to Ubuntu/Debian @@ -92,6 +96,8 @@ if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ]; th # Check if distribution is Debian/Ubuntu-like based on ID_LIKE elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]]; then DISTRIBUTION="debian" +elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]]; then + DISTRIBUTION="arch" fi if [ ! -f ./linux.d/${DISTRIBUTION} ] then diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b228b067b..2ff06e0c25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.13) # Verify that your CMake version is exactly 3.31.x series or lower on windows -if(${CMAKE_VERSION} VERSION_LESS "3.13" OR ${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") - message(FATAL_ERROR "Only CMake versions between 3.13.x and 3.31.x is supported. Detected version: ${CMAKE_VERSION}") +if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") ) + message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}") endif() if (WIN32) @@ -44,7 +44,7 @@ You can do this in Environment Variables settings. endif() endif() endif () - + if (APPLE) # if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3 if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) @@ -354,7 +354,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP add_compile_options(-Wno-unknown-pragmas) endif() - # Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI + # Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0) add_compile_options(-gz=zstd) endif() @@ -492,7 +492,7 @@ endif() function(slic3r_remap_configs targets from_Cfg to_Cfg) if(MSVC) string(TOUPPER ${from_Cfg} from_CFG) - + foreach(tgt ${targets}) if(TARGET ${tgt}) set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg}) @@ -619,7 +619,7 @@ add_custom_target(gettext_make_pot COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost -f "${BBL_L18N_DIR}/list.txt" -o "${BBL_L18N_DIR}/OrcaSlicer.pot" - COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR} + COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generate pot file from strings in the source tree" ) @@ -779,7 +779,7 @@ function(orcaslicer_copy_dlls target config postfix output_dlls) PARENT_SCOPE ) - + endfunction() @@ -819,7 +819,7 @@ endif() if (WIN32) install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources") set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) - include(InstallRequiredSystemLibraries) + include(InstallRequiredSystemLibraries) install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".") elseif (SLIC3R_FHS) # CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share) From 00277ac4b0b33133b5190af4b05df33a58094d76 Mon Sep 17 00:00:00 2001 From: Myles Berueda Date: Sun, 18 May 2025 22:30:20 -1000 Subject: [PATCH 2/4] fix(coreone): adds printer structure (#9679) --- .../profiles/Prusa/machine/Prusa CORE One HF 0.4 nozzle.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/profiles/Prusa/machine/Prusa CORE One HF 0.4 nozzle.json b/resources/profiles/Prusa/machine/Prusa CORE One HF 0.4 nozzle.json index f3b07cbfff..2bfa205bf7 100644 --- a/resources/profiles/Prusa/machine/Prusa CORE One HF 0.4 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa CORE One HF 0.4 nozzle.json @@ -13,6 +13,7 @@ "extruder_clearance_height_to_rod": "33", "extruder_clearance_radius": "75", "from": "system", + "printer_structure": "corexy", "gcode_flavor": "marlin2", "host_type": "prusalink", "inherits": "fdm_machine_common", From 09d309ee9c1430b4bf299e6396d7ef82950ef707 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sun, 25 May 2025 00:06:07 +0800 Subject: [PATCH 3/4] Make sure `filament_id` is not longer than 8 chars if the filament can be set in AMS (#9574) Make sure `filament_id` is not longer than 8 chars if the filament is compatiable with AMS --- .../filament/AliZ/AliZ PETG-CF @base.json | 2 +- .../filament/AliZ/AliZ PETG-Metal @base.json | 2 +- .../filament/base/fdm_filament_sbs.json | 2 +- scripts/orca_extra_profile_check.py | 40 +++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-CF @base.json b/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-CF @base.json index 83da3ae163..9097bd1407 100644 --- a/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-CF @base.json +++ b/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-CF @base.json @@ -2,7 +2,7 @@ "type": "filament", "name": "AliZ PETG-CF @base", "inherits": "AliZ PETG @base", - "filament_id": "AliZ001-1", + "filament_id": "AZ01-1", "from": "system", "instantiation": "false", "fan_cooling_layer_time": [ diff --git a/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-Metal @base.json b/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-Metal @base.json index 978b4495b3..564552fc5f 100644 --- a/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-Metal @base.json +++ b/resources/profiles/OrcaFilamentLibrary/filament/AliZ/AliZ PETG-Metal @base.json @@ -2,7 +2,7 @@ "type": "filament", "name": "AliZ PETG-Metal @base", "inherits": "AliZ PETG @base", - "filament_id": "AliZ001-2", + "filament_id": "AZ01-2", "from": "system", "instantiation": "false", "fan_cooling_layer_time": [ diff --git a/resources/profiles/OrcaFilamentLibrary/filament/base/fdm_filament_sbs.json b/resources/profiles/OrcaFilamentLibrary/filament/base/fdm_filament_sbs.json index 02634084a0..d7e74a8a37 100644 --- a/resources/profiles/OrcaFilamentLibrary/filament/base/fdm_filament_sbs.json +++ b/resources/profiles/OrcaFilamentLibrary/filament/base/fdm_filament_sbs.json @@ -4,7 +4,7 @@ "inherits": "fdm_filament_common", "from": "system", "instantiation": "false", - "filament_id": "OGFLSBS99", + "filament_id": "OFLSBS99", "fan_cooling_layer_time": [ "100" ], diff --git a/scripts/orca_extra_profile_check.py b/scripts/orca_extra_profile_check.py index 7ebba70592..893ebeb9c2 100644 --- a/scripts/orca_extra_profile_check.py +++ b/scripts/orca_extra_profile_check.py @@ -232,6 +232,44 @@ def check_filament_name_consistency(profiles_dir, vendor_name): return error_count +def check_filament_id(vendor, vendor_folder): + """ + Make sure filament_id is not longer than 8 characters, otherwise AMS won't work properly + """ + if vendor not in ('BBL', 'OrcaFilamentLibrary'): + return 0 + + error = 0 + vendor_path = Path(vendor_folder) + if not vendor_path.exists(): + return 0 + + # Use rglob to recursively find .json files. + for file_path in vendor_path.rglob("*.json"): + try: + with open(file_path, 'r', encoding='UTF-8') as fp: + # Use custom hook to detect duplicates. + data = json.load(fp, object_pairs_hook=no_duplicates_object_pairs_hook) + except ValueError as ve: + print(f"Duplicate key error in {file_path}: {ve}") + error += 1 + continue + except Exception as e: + print(f"Error processing {file_path}: {e}") + error += 1 + continue + + if 'filament_id' not in data: + continue + + filament_id = data['filament_id'] + + if len(filament_id) > 8: + error += 1 + print(f"Filament id too long \"{filament_id}\": {file_path}") + + return error + def main(): print("Checking profiles ...") parser = argparse.ArgumentParser(description="Check profiles for issues") @@ -251,12 +289,14 @@ def main(): if args.check_materials: errors_found += check_machine_default_materials(profiles_dir, args.vendor) errors_found += check_filament_name_consistency(profiles_dir, args.vendor) + errors_found += check_filament_id(args.vendor, profiles_dir / args.vendor / "filament") checked_vendor_count += 1 else: for vendor_dir in profiles_dir.iterdir(): if not vendor_dir.is_dir(): continue errors_found += check_filament_name_consistency(profiles_dir, vendor_dir.name) + errors_found += check_filament_id(vendor_dir.name, vendor_dir / "filament") # skip "OrcaFilamentLibrary" folder if vendor_dir.name == "OrcaFilamentLibrary": continue From 4545132a0dd055421a3b8c95706990cd4d18f7a1 Mon Sep 17 00:00:00 2001 From: lodriguez Date: Sat, 24 May 2025 18:45:12 +0200 Subject: [PATCH 4/4] Fix deferred URL not cleared properly (#9711) * Fix deferred URL not cleared properly ensure the deferred URL is fully cleared after use * cleared properly in load_url too --- src/slic3r/GUI/PrinterWebView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/PrinterWebView.cpp b/src/slic3r/GUI/PrinterWebView.cpp index 86d89e1192..0af6a1c0af 100644 --- a/src/slic3r/GUI/PrinterWebView.cpp +++ b/src/slic3r/GUI/PrinterWebView.cpp @@ -79,7 +79,7 @@ void PrinterWebView::load_url(wxString& url, wxString apikey) m_apikey_sent = false; if (this->IsShown()) { - m_url_deferred = *wxEmptyString; + m_url_deferred.clear(); m_browser->LoadURL(url); } else { m_url_deferred = url; @@ -92,7 +92,7 @@ bool PrinterWebView::Show(bool show) { if (show && !m_url_deferred.empty()) { m_browser->LoadURL(m_url_deferred); - m_url_deferred = *wxEmptyString; + m_url_deferred.clear(); } return wxPanel::Show(show); }