Skip to content

Commit 9abfbad

Browse files
committed
Merge branch 'release-1130' into HEAD
1 parent 0353092 commit 9abfbad

1,520 files changed

Lines changed: 143836 additions & 19247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,15 @@ tagcmmid
5050
maxcmmid
5151
resources/i18n/*/*.*
5252
__pycache__
53-
/customized
53+
/customized
54+
/cmmid
55+
/docs/cmake_structure.md
56+
/docs/filament_parameters_validation.md
57+
/docs/gcode_output_post_process_notes_summary.md
58+
/docs/i18n_walkthrough.md
59+
/docs/learning_checklist.md
60+
/docs/learning_highlights.md
61+
/docs/multimaterial_others_validation_design.md
62+
/docs/printer_parameters_validation.md
63+
/docs/printer_settings_ui_parameters.md
64+
docs

BuildLinux.sh

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function check_available_memory_and_disk() {
2222
FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}')
2323
MIN_DISK_KB=$((10 * 1024 * 1024))
2424

25-
if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
25+
# if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
26+
if [ ${FREE_MEM_GB} -lt ${MIN_MEM_GB} ]; then
2627
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)"
2728
echo && free -h && echo
2829
exit 2
@@ -43,15 +44,18 @@ function usage() {
4344
echo " -d: build deps (optional)"
4445
echo " -h: this help output"
4546
echo " -i: Generate appimage (optional)"
47+
echo " -e: Generate deb package (optional)"
4648
echo " -r: skip ram and disk checks (low ram compiling)"
4749
echo " -s: build orca-slicer (optional)"
4850
echo " -u: update and build dependencies (optional and need sudo)"
51+
echo " -jN: set number of threads for ninja build (e.g., -j4)"
4952
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
5053
echo " and then './BuildLinux.sh -dsi'"
5154
}
5255

5356
unset name
54-
while getopts ":1bcdghirsu" opt; do
57+
unset NUM_THREADS
58+
while getopts ":1bcdghirsuej:" opt; do
5559
case ${opt} in
5660
1 )
5761
export CMAKE_BUILD_PARALLEL_LEVEL=1
@@ -71,6 +75,9 @@ while getopts ":1bcdghirsu" opt; do
7175
i )
7276
BUILD_IMAGE="1"
7377
;;
78+
e )
79+
BUILD_DEB="1"
80+
;;
7481
r )
7582
SKIP_RAM_CHECK="1"
7683
;;
@@ -80,6 +87,9 @@ while getopts ":1bcdghirsu" opt; do
8087
u )
8188
UPDATE_LIB="1"
8289
;;
90+
j )
91+
NUM_THREADS=${OPTARG}
92+
;;
8393
esac
8494
done
8595

@@ -90,7 +100,9 @@ then
90100
fi
91101

92102
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release)
93-
# treat ubuntu as debian
103+
# 规范化发行版ID(去引号并转小写)
104+
DISTRIBUTION=$(echo ${DISTRIBUTION} | tr -d '"' | tr '[:upper:]' '[:lower:]')
105+
# 将 ubuntu 视为 debian
94106
if [ "${DISTRIBUTION}" == "ubuntu" ]
95107
then
96108
DISTRIBUTION="debian"
@@ -103,6 +115,11 @@ then
103115
DISTRIBUTION="debian2"
104116
fi
105117
fi
118+
# 兼容麒麟系统(Kylin/openKylin),使用专用脚本
119+
if [ "${DISTRIBUTION}" == "kylin" ] || [ "${DISTRIBUTION}" == "openkylin" ]
120+
then
121+
DISTRIBUTION="kylin"
122+
fi
106123
if [ ! -f ./linux.d/${DISTRIBUTION} ]
107124
then
108125
echo "Your distribution does not appear to be currently supported by these build scripts"
@@ -186,9 +203,13 @@ then
186203
${BUILD_ARGS}
187204
echo "done"
188205
echo "Building CrealityPrint ..."
189-
cmake --build build --target CrealityPrint
206+
if [[ -n "${num_threads}" ]]; then
207+
cmake --build build --target CrealityPrint -j${NUM_THREADS}
208+
else
209+
cmake --build build --target CrealityPrint
210+
fi
190211
echo "Building CrealityPrint_profile_validator .."
191-
cmake --build build --target CrealityPrint_profile_validator
212+
#cmake --build build --target CrealityPrint_profile_validator
192213
./run_gettext.sh
193214
echo "done"
194215
fi
@@ -205,6 +226,11 @@ echo "[9/9] Generating Linux app..."
205226
else
206227
${ROOT}/build/src/BuildLinuxImage.sh
207228
fi
229+
if [[ -n "${BUILD_DEB}" ]] && [[ -e ${ROOT}/build/src/BuildLinuxDeb.sh ]]
230+
then
231+
chmod 755 ${ROOT}/build/src/BuildLinuxDeb.sh
232+
${ROOT}/build/src/BuildLinuxDeb.sh
233+
fi
208234
popd
209235
echo "done"
210236
fi

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(DUMPTOOL_USER $ENV{DUMPTOOL_USER})
1212
set(DUMPTOOL_PASS $ENV{DUMPTOOL_PASS})
1313
set(DUMPTOOL_HOST $ENV{DUMPTOOL_HOST})
1414
set(DUMPTOOL_TO $ENV{DUMPTOOL_TO})
15+
set(SLIC3R_BUILD_ID $ENV{BUILD_ID})
1516
if(CX_DEBUG)
1617
add_definitions(-D_DEBUG1=1)
1718
endif()

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"description": "Sets release build type",
4848
"inherits": "x64-release",
4949
"cacheVariables": {
50-
"CMAKE_BUILD_TYPE": "Release",
50+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
5151
"CMAKE_PREFIX_PATH": "${sourceDir}/deps/build/OrcaSlicer_dep/usr/local/",
5252
"CX_DEBUG": "1",
5353
"CMAKE_EXPORT_COMPILE_COMMANDS":"1",

ai_code_check/checkRule.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 一、防止程序崩溃
2+
应重点识别和避免以下经典高风险问题:
3+
- 空指针引用(Null/Uninitialized Pointer Dereference)
4+
- 越界访问(数组/指针/迭代器/下标检查缺失)
5+
- 栈溢出(深递归、巨型栈对象、未控递归)
6+
- 重复释放/错误释放(Double Free、Use-After-Free、野指针)
7+
- 资源泄漏(内存、文件句柄、GDI、套接字等未释放)
8+
- 未初始化/未定义行为(UB:签名溢出、未设定初值使用)
9+
- 异常处理缺失/吞异常(异常未捕获导致崩溃或状态不一致)
10+
- 并发协同问题:
11+
- 数据竞争(Data Race)与条件竞争(Race Condition)
12+
- 死锁/活锁/优先级反转(锁顺序不一致、锁粒度过大)
13+
- 非原子读写、内存可见性问题(缺少 `atomic`/内存栅栏)
14+
- 非法迭代器/游标使用(失效迭代器、迭代中修改容器导致崩溃)
15+
- 线程生命周期与资源管理混乱(线程未 Join/Detach,析构期仍在访问)
16+
- 跨平台/编译器差异导致的未定义行为(结构体对齐、字节序、宏差异)
17+
18+
检查要点(建议):
19+
- 对所有外部/系统/库调用检查返回值与错误码;失败路径应可控。
20+
- 关键路径执行边界检查与空值判断;减少隐式转换的风险。
21+
- 资源/内存采用 RAII 或智能指针管理(C++:`unique_ptr`/`shared_ptr`)。
22+
- 并发使用明确的锁顺序与细粒度锁;避免在锁内做长耗时操作。
23+
- 跨线程共享数据使用 `atomic` 或受控同步原语;避免裸共享可变状态。
24+
- 对递归或深调用栈设置安全边界或改为迭代;避免栈上巨型对象。
25+
- 统一异常策略:明确可抛/不可抛边界,避免跨模块未捕获异常。
26+
27+
# 二、性能问题
28+
29+
应重点识别以下常见性能陷阱:
30+
- 大循环中执行重/阻塞操作(磁盘/网络 IO、数据库访问、睡眠等待)
31+
- 频繁分配/释放内存或创建对象(导致碎片与 GC/分配器压力)
32+
- 重复计算/缺少缓存(相同结果未缓存、重复排序/查找/解析)
33+
- N+1 查询/逐项远程调用(可批量或预取的场景未合并)
34+
- 热路径中的昂贵日志/正则/JSON 解析/字符串拼接
35+
- 不合适的数据结构或复杂度(O(N^2)/嵌套循环可降维为 O(N log N))
36+
- 锁竞争/串行化过多(大范围互斥导致吞吐下降)
37+
- 不必要的拷贝/深拷贝(可用移动语义/引用/视图替代)
38+
- 资源加载过大或频繁(图片/模型/视频流未做懒加载或复用)
39+
- 跨语言/跨进程边界调用过多(序列化/上下文切换开销显著)
40+
41+
优化建议(方向):
42+
- 用分析器(Profiler/火焰图)识别热点;先测量、再优化。
43+
- 在热路径使用缓存/预计算;避免重复解析与转换。
44+
- 选择合适数据结构与算法,关注时间/空间复杂度。
45+
- 降低锁粒度并提高并发度;必要时采用无锁或读写锁方案。
46+
- 批量化 IO/查询;异步化耗时操作并隔离 UI/主线程。
47+
- 合理控制日志等级与频度;避免在热路径进行重字符串操作。
48+
49+
# 三、业务逻辑变更
50+
应重点识别重大业务逻辑变更
51+
- 比如修改判断条件,本来每个平台都要运行的代码被限定为单一平台才执行
52+
- 其他引起业务逻辑大变更的代码
53+
54+
# 四、识别编译问题
55+
应重点识别可能引入编译告警,错误的问题
56+
- 引起新增编译报错的问题

cmake/modules/CheckUos.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 综合检查方法
2+
if(UNIX AND NOT APPLE)
3+
set(IS_UOS FALSE)
4+
5+
# 检查 /etc/os-release
6+
if(EXISTS "/etc/os-release")
7+
file(READ "/etc/os-release" OS_RELEASE)
8+
if(OS_RELEASE MATCHES "NAME=.*UOS" OR OS_RELEASE MATCHES "NAME=.*uos")
9+
set(IS_UOS TRUE)
10+
endif()
11+
endif()
12+
13+
# 检查 /etc/uos-release
14+
if(EXISTS "/etc/uos-release")
15+
set(IS_UOS TRUE)
16+
endif()
17+
18+
# 检查其他可能的标识
19+
execute_process(
20+
COMMAND lsb_release -i -s
21+
OUTPUT_VARIABLE LSB_ID
22+
OUTPUT_STRIP_TRAILING_WHITESPACE
23+
)
24+
if(LSB_ID STREQUAL "UOS" OR LSB_ID STREQUAL "uos")
25+
set(IS_UOS TRUE)
26+
endif()
27+
else()
28+
set(IS_UOS FALSE)
29+
endif()
30+
31+
if(IS_UOS)
32+
message(STATUS "检测到系统是统信 UOS")
33+
# 添加 UOS 特定的配置选项
34+
else()
35+
message(STATUS "当前系统不是统信 UOS")
36+
endif()

cmake/modules/DetectOS.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# function: detect os id
2+
# result: OUTPUT_VAR
3+
# usage eg: detect_os(OS_ID) OS_ID may is uos/deepin/Ubuntu
4+
5+
function(detect_os OUTPUT_VAR)
6+
if(UNIX AND NOT APPLE)
7+
if(EXISTS /etc/os-release)
8+
file(STRINGS /etc/os-release os_release_lines)
9+
set(os_id "")
10+
foreach(line IN LISTS os_release_lines)
11+
if(line MATCHES "^ID=(.*)$")
12+
set(os_id "${CMAKE_MATCH_1}")
13+
endif()
14+
endforeach()
15+
set(${OUTPUT_VAR} "${os_id}" PARENT_SCOPE)
16+
else()
17+
set(${OUTPUT_VAR} "unknown" PARENT_SCOPE)
18+
endif()
19+
else()
20+
set(${OUTPUT_VAR} "non-unix" PARENT_SCOPE)
21+
endif()
22+
endfunction()

deps/Assimp/0001-uos.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 21139104a4e41c4abcf6a6ab57f02f32a8ed5008 Mon Sep 17 00:00:00 2001
2+
From: lisugui <lisugui@creatily.com>
3+
Date: Tue, 4 Nov 2025 14:43:31 +0800
4+
Subject: [PATCH] uos patch
5+
6+
---
7+
contrib/stb/stb_image.h | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git a/contrib/stb/stb_image.h b/contrib/stb/stb_image.h
11+
index a632d54..5594e60 100644
12+
--- a/contrib/stb/stb_image.h
13+
+++ b/contrib/stb/stb_image.h
14+
@@ -827,6 +827,7 @@ static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
15+
s->io.read = NULL;
16+
s->read_from_callbacks = 0;
17+
s->callback_already_read = 0;
18+
+ s->buflen = sizeof(s->buffer_start);
19+
s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;
20+
s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len;
21+
}
22+
--
23+
2.20.1
24+

deps/Assimp/Assimp.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
set(patch_command git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-.patch)
1+
include(${CMAKE_SOURCE_DIR}/../cmake/modules/CheckUos.cmake)
2+
if(IS_UOS)
3+
set(patch_command git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-.patch && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-uos.patch)
4+
else()
5+
set(patch_command git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-.patch)
6+
endif()
27
orcaslicer_add_cmake_project(Assimp
38
URL https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.zip
49
URL_HASH SHA256=795C29716F4AC123B403E53B677E9F32A8605C4A7B2D9904BFAAE3F4053B506D
@@ -11,4 +16,4 @@ orcaslicer_add_cmake_project(Assimp
1116
#add_dependencies(dep_ZLIB)
1217
if (MSVC)
1318
add_debug_dep(dep_Assimp)
14-
endif ()
19+
endif ()

deps/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ endif()
425425
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
426426
list(APPEND _dep_list "dep_metartc")
427427
endif()
428+
429+
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch|loongarch64")
430+
# TODO: Only the rules of uos/deepin under the Loongson architecture
431+
list(REMOVE_ITEM _dep_list dep_BREAKPAD)
432+
endif()
433+
434+
428435
if (MSVC)
429436
# Experimental
430437
#list(APPEND _dep_list "dep_qhull")
@@ -440,7 +447,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
440447
include(ZSTD/ZSTD.cmake)
441448
list(APPEND _dep_list_first "dep_zstd")
442449
endif()
450+
# Include LERC for UOS or LoongArch systems
451+
include(${CMAKE_SOURCE_DIR}/../cmake/modules/CheckUos.cmake)
452+
if(IS_UOS OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch")
453+
include(LERC/lerc.cmake)
454+
if(LERC_FOUND)
455+
list(APPEND _dep_list_first "dep_Lerc")
456+
endif()
457+
endif()
443458
add_custom_target(deps ALL DEPENDS ${_dep_list_first} ${_dep_list} ${_dep_cr_tpms} )
444459

460+
461+
445462
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
446463
# because they seem to generate bogus build files (possibly a bug in ExternalProject).

0 commit comments

Comments
 (0)