fix(VDE-497): patch 5 upstream source files for MSVC build + exclude 3 incomplete files from CMake
assembly_feature.cpp/fastener_library.cpp/layer_standards.cpp/bom_table.cpp/mesh_quality.cpp fixes + VDE-497.md feedback
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# VDE-497: 上游 main 分支多个源文件破坏性构建失败
|
||||
|
||||
**日期**: 2026-08-05
|
||||
**严重度**: **Critical** (阻断 VDE 集成)
|
||||
**状态**: Open (ViewDesign 侧已 patch 恢复构建)
|
||||
|
||||
---
|
||||
|
||||
## 摘要
|
||||
|
||||
VDE `main` 分支在 26 个上游提交合并后,`vde_brep` 库有 4 个源文件出现编译和链接错误,导致构建中断。ViewDesign 侧不得不对 VDE 源文件进行 patch 并排除 3 个文件才能恢复构建。
|
||||
|
||||
---
|
||||
|
||||
## 影响的源文件
|
||||
|
||||
### 1. `src/brep/assembly_feature.cpp`
|
||||
- **`AABB::size()` 不存在**: 应使用 `extent()` 或 `.diagonal()`。
|
||||
- **错误转义序列**: 字符串中 `+\"...\"` → 应为 `+"..."`
|
||||
- **重复函数定义 (C2084)**: 3 个函数在文件中定义了两次(行 88-128),链接时导致 LNK2005。
|
||||
|
||||
### 2. `src/brep/fastener_library.cpp`
|
||||
- **`BrepModel` 未声明**: 缺少 `#include "vde/brep/brep_boolean.h"`,且应使用 `brep::BrepModel` 而非裸 `BrepModel`。
|
||||
- **重复函数定义**: 2 个函数定义了两次。
|
||||
|
||||
### 3. `src/brep/layer_standards.cpp`
|
||||
- **缺少 `#include "vde/brep/layer_standards.h"`**: 没有包含对应声明头文件。
|
||||
- **缺少命名空间包装**: `namespace vde::brep::layer {}` 包装缺失。
|
||||
- **`initializer_list` 转换失败 (C2679)**: `LayerDefinition` 构造函数调用方式与定义不匹配,导致初始化列表转换失败。从 CMake 构建中排除。
|
||||
|
||||
### 4. `src/brep/bom_table.cpp`
|
||||
- **未声明变量 `part`**: 函数体内引用了不存在的变量。从 CMake 构建中排除。
|
||||
|
||||
### 5. `src/mesh/mesh_quality.cpp`
|
||||
- **`HalfedgeMesh::edge_length` 不存在**: VDE 编译时未找到该成员。
|
||||
- **`ElemQuality` 成员缺失**: `aspect_ratio` 等字段在编译时未定义。从 CMake 构建中排除。
|
||||
|
||||
---
|
||||
|
||||
## 对下游的影响
|
||||
|
||||
- ViewDesign 必须对 VDE `src/CMakeLists.txt` 打 patch 注释掉 3 个源文件才能编译 `vd_geom.dll`
|
||||
- ViewDesign 必须在 `feature_builder_tools.cpp`、`feature_builder.cpp`、`mesh_tools.cpp` 中对 17 处 VDE 调用添加 `#if 0 && VD_HAS_VDE` 守卫以防止 LNK2019
|
||||
- 总计约 28 个 bridge API 的 VDE 路径被临时禁用
|
||||
|
||||
---
|
||||
|
||||
## 建议修复
|
||||
|
||||
1. **CI/CD 守卫**: 确保 main 分支的每个提交通过完整构建验证(`cmake --build . --target ALL_BUILD`)
|
||||
2. **重复定义检测**: 提交前运行 lint 或重复符号扫描
|
||||
3. **逐文件编译**: 在提交前对修改过的每个源文件至少通过单文件编译验证
|
||||
4. **接口完整性**: 新头文件在添加到 CMakeLists.txt 之前验证其实现完成度(如 mesh_quality.h 的 HalfedgeMesh API)
|
||||
|
||||
---
|
||||
|
||||
## ViewDesign 侧 patch 摘要
|
||||
|
||||
```
|
||||
src/brep/assembly_feature.cpp: 4 处修正 (size→extent, escape strings, 3 dup removed)
|
||||
src/brep/fastener_library.cpp: 3 处修正 (#include, BrepModel, 2 dup removed)
|
||||
src/brep/layer_standards.cpp: 2 处修正 (#include, namespace) + CMake 排除
|
||||
src/brep/bom_table.cpp: 1 处修正 (undeclared var) + CMake 排除
|
||||
src/mesh/mesh_quality.cpp: CMake 排除
|
||||
src/CMakeLists.txt: 3 文件注释排除
|
||||
ViewDesign bridge 文件: 17 处 #if 0 && VD_HAS_VDE 守卫
|
||||
```
|
||||
Reference in New Issue
Block a user