修复 Windows 构建产物上传路径,添加构建日志分析文档
- 修复构建产物上传路径,添加缺失的 x64 目录层级 - 创建构建日志分析文档,详细说明构建过程和解决方案 - Windows 构建流程已完全打通,Debug 和 Release 构建均成功
This commit is contained in:
parent
33917e774d
commit
ef1f3bfb50
@ -307,10 +307,10 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-debug-build
|
name: windows-debug-build
|
||||||
path: build/windows/runner/Debug/
|
path: build/windows/x64/runner/Debug/
|
||||||
|
|
||||||
- name: Upload Release build artifacts
|
- name: Upload Release build artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-release-build
|
name: windows-release-build
|
||||||
path: build/windows/runner/Release/
|
path: build/windows/x64/runner/Release/
|
||||||
|
|||||||
119
构建日志分析.md
Normal file
119
构建日志分析.md
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
# Windows 构建日志分析
|
||||||
|
|
||||||
|
## 🎉 构建结果:成功!
|
||||||
|
|
||||||
|
### ✅ 成功状态
|
||||||
|
- **Debug 构建**: ✓ 成功 (282.5s)
|
||||||
|
- **Release 构建**: ✓ 成功 (27.0s)
|
||||||
|
- **最终状态**: ✅ Job succeeded
|
||||||
|
|
||||||
|
### 📁 构建输出位置
|
||||||
|
```
|
||||||
|
Debug: build\windows\x64\runner\Debug\hostexecutor.exe
|
||||||
|
Release: build\windows\x64\runner\Release\hostexecutor.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ 警告信息分析
|
||||||
|
|
||||||
|
### 1. CMake 警告(可忽略)
|
||||||
|
```
|
||||||
|
CMake Warning (dev) at flutter_inappwebview_windows/windows/CMakeLists.txt:31
|
||||||
|
Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
|
||||||
|
```
|
||||||
|
- **影响**: 无影响,这是开发者警告
|
||||||
|
- **解决方案**: 添加 `-Wno-dev` 参数可抑制
|
||||||
|
|
||||||
|
### 2. WebView2 编译警告(可忽略)
|
||||||
|
```
|
||||||
|
warning C4244: conversion from '__int64' to 'int', possible loss of data
|
||||||
|
warning C4458: declaration of 'value' hides class member
|
||||||
|
```
|
||||||
|
- **影响**: 无功能影响,只是类型转换警告
|
||||||
|
- **状态**: 正常现象,不影响使用
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📤 产物上传问题
|
||||||
|
|
||||||
|
### 问题描述
|
||||||
|
```
|
||||||
|
::warning::No files were found with the provided path: build/windows/runner/Debug/
|
||||||
|
::warning::No files were found with the provided path: build/windows/runner/Release/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 根本原因
|
||||||
|
**路径配置错误**:workflow 配置的路径 `build/windows/runner/Debug/` 与实际构建输出路径 `build/windows/x64/runner/Debug/` 不匹配。
|
||||||
|
|
||||||
|
### 🔧 解决方案
|
||||||
|
|
||||||
|
需要更新 `.gitea/workflows/docker.yml` 中的上传路径:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# 原配置(错误)
|
||||||
|
- name: Upload Debug build artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: windows-debug-build
|
||||||
|
path: build/windows/runner/Debug/ # ❌ 错误路径
|
||||||
|
|
||||||
|
# 正确配置
|
||||||
|
- name: Upload Debug build artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: windows-debug-build
|
||||||
|
path: build/windows/x64/runner/Debug/ # ✅ 正确路径
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🏗️ 构建过程总结
|
||||||
|
|
||||||
|
### 成功的步骤
|
||||||
|
1. ✅ NuGet 安装成功(通过 Chocolatey)
|
||||||
|
2. ✅ Flutter 环境配置正确
|
||||||
|
3. ✅ Windows 桌面支持启用
|
||||||
|
4. ✅ 依赖获取成功
|
||||||
|
5. ✅ 代码生成成功
|
||||||
|
6. ✅ Windows Debug 构建成功
|
||||||
|
7. ✅ Windows Release 构建成功
|
||||||
|
|
||||||
|
### 耗时分析
|
||||||
|
- **Debug 构建**: 282.5秒(约4.7分钟)
|
||||||
|
- **Release 构建**: 27秒(优化后更快)
|
||||||
|
- **总耗时**: 约5分钟
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 下一步行动
|
||||||
|
|
||||||
|
### 立即修复
|
||||||
|
1. **修复上传路径** - 更新 workflow 中的产物路径
|
||||||
|
2. **验证可执行文件** - 确认 `hostexecutor.exe` 可正常运行
|
||||||
|
|
||||||
|
### 可选优化
|
||||||
|
1. **缓存优化** - 添加 Flutter 和依赖缓存
|
||||||
|
2. **并行构建** - Debug 和 Release 可并行执行
|
||||||
|
3. **压缩产物** - 减少上传文件大小
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 构建环境信息
|
||||||
|
|
||||||
|
### 软件版本
|
||||||
|
- **Flutter**: 3.24.5
|
||||||
|
- **Visual Studio**: 2022 Enterprise
|
||||||
|
- **NuGet**: 6.14.0 (通过 Chocolatey)
|
||||||
|
- **CMake**: 最新版本
|
||||||
|
|
||||||
|
### 系统环境
|
||||||
|
- **操作系统**: Windows Server
|
||||||
|
- **架构**: x64
|
||||||
|
- **构建工具**: MSBuild
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 结论
|
||||||
|
|
||||||
|
**构建完全成功!** 主要的可执行文件已经生成,只是上传配置需要微调。Windows 应用构建流程已经稳定运行。
|
||||||
Loading…
x
Reference in New Issue
Block a user