### P4-01 插件 ABI 1.4 mesher 扩展点 - VDE_PLUGIN_ABI_MINOR 3→4;VdePluginKind MESHER=8;VdeMesherStatus/Options/Result/Plugin; VdePluginRegistration 尾追加 mesher 指针(48→56B,旧 1.3 按 struct_size 安全); - PluginManager kind/meshers()/invoke_mesher()/失败隔离/unload 清理;ABI 语义 manifest.minor<=query.minor<=host.minor; - sample_mesher(mock tet4);ABI 矩阵 1.0–1.4 accepted=5 + 2.0 rejected;--abi/--check 适配; - test_plugin_mesher 7 用例 + VDE_PluginToolMesherAbi CTest;docs plugin-development §15/plugin-distribution §12; ### P4-02 Python ctypes 回归 - 可选 CTest VDE_PythonCtypesSmoke(Python3 可选/vde_capi_shared/smoke_test_ctypes.py;无 Python 跳过); - VDE_BUILD_PYTHON=ON MinGW 原生 pybind 明确跳过(ctypes 保留);README/testing 文档更新(C API 61/绑定 60); ### P4-03 模块包 CI 矩阵 - cmake/check_module_packages.cmake:configure/build/install → 10 模块包 find_package + 仓库内 consumer 编译运行; - tests/module_packages/consumers/(10 个最小工程);CI module-packages job;本地 MODULE_PACKAGES_PASS pass=10 fail=0; ### P4-04 宿主复测/平台 CI 交接 + 多团队分发体系 - docs/reference/76-宿主复测与平台CI交接包(1.0.78).md;VDE-1251/1252 反馈单追加复测指引; - docs/design/multi-team-development.md(T1–T8/ownership/契约/流程)、docs/planning/work-packages.md(39 WP)、 docs/guides/team-onboarding.md、docs/design/plugin-ecosystem-handoff.md、.github/ISSUE_TEMPLATE/work-package.yml; - roadmap P4-01..05 交付;WP 状态 27 Delivered/0 In-Progress/12 Candidate; ### 工程 - 版本 1.0.79;与远端 f6e0ac97(plugin template SDK consumption/ecosystem plan)rebase 集成; - 全量构建 0 error(405 targets);全量 ctest 7569 注册、7474/7474 PASS(0 failed,25 skipped,238.13s)。
180 lines
7.9 KiB
CMake
180 lines
7.9 KiB
CMake
# ═══════════════════════════════════════════════════════════════════════════
|
||
# VDE P4:模块包 CI 矩阵检查(standalone CMake script)
|
||
#
|
||
# 流程:configure(VDE_INSTALL=ON + VDE_INSTALL_SDK=ON)→ build → install 到临时
|
||
# prefix → 对 kernel/render/drafting/mechanism/ui/pdm/cam/cae/assembly/
|
||
# sheetmetal 逐个用 find_package 校验,并配置/编译/运行仓库内最小 consumer
|
||
# (tests/module_packages/consumers/<module>)。
|
||
#
|
||
# 用法(本地;标准 flags 见 docs/design/module-packaging-split.md §9):
|
||
# cmake -DSOURCE_DIR=<repo> -DBUILD_ROOT=<build-dir> \
|
||
# -DINSTALL_PREFIX=<prefix> \
|
||
# -DEXTRA_CONFIGURE_ARGS="<空格分隔的额外配置参数>" \
|
||
# -P cmake/check_module_packages.cmake
|
||
#
|
||
# 输出:每模块一行 [module-packages] PASS/SKIP/FAIL;结尾 MODULE_PACKAGES_PASS。
|
||
# SKIP 语义:模块包未安装(被 VDE_BUILD_<MODULE>=OFF 裁剪或尚无包规则);
|
||
# 任意 FAIL → 脚本以非零退出(message(FATAL_ERROR)),CI job 失败。
|
||
# ═══════════════════════════════════════════════════════════════════════════
|
||
cmake_minimum_required(VERSION 3.20)
|
||
|
||
if(NOT DEFINED SOURCE_DIR)
|
||
message(FATAL_ERROR "[module-packages] 需要 -DSOURCE_DIR=<repo-root>")
|
||
endif()
|
||
get_filename_component(SOURCE_DIR "${SOURCE_DIR}" ABSOLUTE)
|
||
if(NOT EXISTS "${SOURCE_DIR}/CMakeLists.txt")
|
||
message(FATAL_ERROR "[module-packages] SOURCE_DIR 无效: ${SOURCE_DIR}")
|
||
endif()
|
||
|
||
if(NOT DEFINED BUILD_ROOT)
|
||
set(BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}/module-packages")
|
||
endif()
|
||
get_filename_component(BUILD_ROOT "${BUILD_ROOT}" ABSOLUTE)
|
||
if(NOT DEFINED INSTALL_PREFIX)
|
||
set(INSTALL_PREFIX "${BUILD_ROOT}/install")
|
||
endif()
|
||
get_filename_component(INSTALL_PREFIX "${INSTALL_PREFIX}" ABSOLUTE)
|
||
if(NOT DEFINED GENERATOR)
|
||
set(GENERATOR "Ninja")
|
||
endif()
|
||
if(NOT DEFINED BUILD_TYPE)
|
||
set(BUILD_TYPE "Release")
|
||
endif()
|
||
if(NOT DEFINED BUILD_JOBS)
|
||
set(BUILD_JOBS 4)
|
||
endif()
|
||
if(NOT DEFINED MODULES)
|
||
set(MODULES "kernel;render;drafting;mechanism;ui;pdm;cam;cae;assembly;sheetmetal")
|
||
endif()
|
||
if(NOT DEFINED EXTRA_CONFIGURE_ARGS)
|
||
set(EXTRA_CONFIGURE_ARGS "")
|
||
endif()
|
||
separate_arguments(EXTRA_CONFIGURE_ARGS_LIST UNIX_COMMAND "${EXTRA_CONFIGURE_ARGS}")
|
||
|
||
set(CONSUMERS_DIR "${SOURCE_DIR}/tests/module_packages/consumers")
|
||
if(NOT IS_DIRECTORY "${CONSUMERS_DIR}")
|
||
message(FATAL_ERROR "[module-packages] 缺少 consumers 目录: ${CONSUMERS_DIR}")
|
||
endif()
|
||
set(VDE_BUILD_DIR "${BUILD_ROOT}/vde")
|
||
set(CONSUMER_BUILD_ROOT "${BUILD_ROOT}/consumers")
|
||
set(LOGS_DIR "${BUILD_ROOT}/logs")
|
||
file(REMOVE_RECURSE "${BUILD_ROOT}")
|
||
file(MAKE_DIRECTORY "${CONSUMER_BUILD_ROOT}" "${LOGS_DIR}")
|
||
|
||
function(_module_packages_run name)
|
||
execute_process(
|
||
COMMAND ${ARGN}
|
||
RESULT_VARIABLE _result
|
||
OUTPUT_VARIABLE _stdout
|
||
ERROR_VARIABLE _stderr
|
||
TIMEOUT 3600)
|
||
file(WRITE "${LOGS_DIR}/${name}.log"
|
||
"CMD: ${ARGN}\nRESULT: ${_result}\n\n--- stdout ---\n${_stdout}\n\n--- stderr ---\n${_stderr}\n")
|
||
set(_module_packages_result "${_result}" PARENT_SCOPE)
|
||
set(_module_packages_stdout "${_stdout}" PARENT_SCOPE)
|
||
set(_module_packages_stderr "${_stderr}" PARENT_SCOPE)
|
||
endfunction()
|
||
|
||
message(STATUS "[module-packages] VDE configure: ${SOURCE_DIR} -> ${VDE_BUILD_DIR}")
|
||
set(_configure_cmd
|
||
"${CMAKE_COMMAND}" -S "${SOURCE_DIR}" -B "${VDE_BUILD_DIR}"
|
||
-G "${GENERATOR}"
|
||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||
-DVDE_INSTALL=ON -DVDE_INSTALL_SDK=ON
|
||
-DVDE_BUILD_TOOLS=OFF -DVDE_BUILD_SAMPLE_PLUGINS=OFF
|
||
-DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_EXAMPLES=OFF
|
||
${EXTRA_CONFIGURE_ARGS_LIST})
|
||
_module_packages_run(vde-configure ${_configure_cmd})
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(FATAL_ERROR "[module-packages] VDE configure 失败(见 ${LOGS_DIR}/vde-configure.log)")
|
||
endif()
|
||
|
||
message(STATUS "[module-packages] VDE build (${BUILD_JOBS} jobs)")
|
||
_module_packages_run(vde-build "${CMAKE_COMMAND}" --build "${VDE_BUILD_DIR}" --parallel "${BUILD_JOBS}")
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(FATAL_ERROR "[module-packages] VDE build 失败(见 ${LOGS_DIR}/vde-build.log)")
|
||
endif()
|
||
|
||
message(STATUS "[module-packages] VDE install -> ${INSTALL_PREFIX}")
|
||
_module_packages_run(vde-install "${CMAKE_COMMAND}" --install "${VDE_BUILD_DIR}" --prefix "${INSTALL_PREFIX}")
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(FATAL_ERROR "[module-packages] VDE install 失败(见 ${LOGS_DIR}/vde-install.log)")
|
||
endif()
|
||
|
||
set(_passed "")
|
||
set(_failed "")
|
||
set(_skipped "")
|
||
foreach(_module IN LISTS MODULES)
|
||
set(_pkg "vde-${_module}")
|
||
set(_package_dir "${INSTALL_PREFIX}/lib/cmake/${_pkg}")
|
||
if(NOT IS_DIRECTORY "${_package_dir}")
|
||
message(STATUS "[module-packages] SKIP ${_pkg} (package not installed)")
|
||
list(APPEND _skipped "${_module}")
|
||
continue()
|
||
endif()
|
||
set(_consumer_src "${CONSUMERS_DIR}/${_module}")
|
||
if(NOT IS_DIRECTORY "${_consumer_src}")
|
||
message(STATUS "[module-packages] SKIP ${_pkg} (consumer dir missing)")
|
||
list(APPEND _skipped "${_module}")
|
||
continue()
|
||
endif()
|
||
set(_consumer_build "${CONSUMER_BUILD_ROOT}/${_module}")
|
||
set(_consumer_cmd
|
||
"${CMAKE_COMMAND}" -S "${_consumer_src}" -B "${_consumer_build}"
|
||
-G "${GENERATOR}"
|
||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||
-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX})
|
||
if(IS_DIRECTORY "${SOURCE_DIR}/eigen3")
|
||
list(APPEND _consumer_cmd "-DEIGEN3_INCLUDE_DIR=${SOURCE_DIR}/eigen3")
|
||
endif()
|
||
_module_packages_run("consumer-configure-${_module}" ${_consumer_cmd})
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(STATUS "[module-packages] FAIL ${_pkg} (configure; see ${LOGS_DIR}/consumer-configure-${_module}.log)")
|
||
list(APPEND _failed "${_module}")
|
||
continue()
|
||
endif()
|
||
_module_packages_run("consumer-build-${_module}" "${CMAKE_COMMAND}" --build "${_consumer_build}" --parallel "${BUILD_JOBS}")
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(STATUS "[module-packages] FAIL ${_pkg} (build; see ${LOGS_DIR}/consumer-build-${_module}.log)")
|
||
list(APPEND _failed "${_module}")
|
||
continue()
|
||
endif()
|
||
file(GLOB_RECURSE _candidates "${_consumer_build}/vde_${_module}_consumer*")
|
||
set(_exe "")
|
||
foreach(_candidate IN LISTS _candidates)
|
||
get_filename_component(_ext "${_candidate}" EXT)
|
||
if(_ext STREQUAL "" OR _ext STREQUAL ".exe")
|
||
if(NOT _candidate MATCHES "\\.dir/")
|
||
set(_exe "${_candidate}")
|
||
break()
|
||
endif()
|
||
endif()
|
||
endforeach()
|
||
if(NOT _exe)
|
||
message(STATUS "[module-packages] FAIL ${_pkg} (consumer executable not found)")
|
||
list(APPEND _failed "${_module}")
|
||
continue()
|
||
endif()
|
||
_module_packages_run("consumer-run-${_module}" "${_exe}")
|
||
if(NOT _module_packages_result EQUAL 0)
|
||
message(STATUS "[module-packages] FAIL ${_pkg} (run; see ${LOGS_DIR}/consumer-run-${_module}.log)")
|
||
list(APPEND _failed "${_module}")
|
||
continue()
|
||
endif()
|
||
string(STRIP "${_module_packages_stdout}" _stdout_stripped)
|
||
message(STATUS "[module-packages] PASS ${_pkg} -> ${_stdout_stripped}")
|
||
list(APPEND _passed "${_module}")
|
||
endforeach()
|
||
|
||
list(LENGTH _passed _passed_count)
|
||
list(LENGTH _skipped _skipped_count)
|
||
list(LENGTH _failed _failed_count)
|
||
message(STATUS "[module-packages] 结果: pass=${_passed_count} skip=${_skipped_count} fail=${_failed_count}")
|
||
if(_skipped_count GREATER 0)
|
||
message(STATUS "[module-packages] skipped: ${_skipped}")
|
||
endif()
|
||
if(_failed_count GREATER 0)
|
||
message(FATAL_ERROR "[module-packages] FAIL: ${_failed} (logs: ${LOGS_DIR})")
|
||
endif()
|
||
message(STATUS "[module-packages] MODULE_PACKAGES_PASS pass=${_passed_count} skip=${_skipped_count}")
|