Skip to content

Commit 3ac4bb6

Browse files
author
DravinceG16
committed
V1.0.5.1,fix,IAR编译失败
1 parent 2df5fde commit 3ac4bb6

4 files changed

Lines changed: 35 additions & 16 deletions

File tree

Embedded_Firmware_Manager.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exe = EXE(
3131
a.zipfiles,
3232
a.datas,
3333
[],
34-
name='Embedded_Firmware_Manager_v1.0.5.0',
34+
name='Embedded_Firmware_Manager_v1.0.5.1',
3535
debug=False,
3636
bootloader_ignore_signals=False,
3737
strip=False,

docs/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ Format based on [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
88
项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)
99
This project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/).
1010

11+
## [1.0.5.1] - 2025-10-10
12+
13+
### 修复 / Fixed
14+
- **[重要]** 修复IAR编译命令缺少`-make`参数导致编译失败的问题 / Fixed IAR compilation failure due to missing `-make` parameter
15+
- **[重要]** 修复IAR编译工作目录设置错误导致无法生成bin/out文件的问题 / Fixed incorrect working directory setting causing failure to generate bin/out files
16+
- 修复IAR编译器初始化时日志输出路径混淆的问题 / Fixed path confusion in logger output during IAR builder initialization
17+
- 修复`clean_project()`方法工作目录设置错误 / Fixed incorrect working directory setting in `clean_project()` method
18+
- 修复权限检查和环境诊断中的路径引用错误 / Fixed path reference errors in permission checks and environment diagnostics
19+
20+
### 技术细节 / Technical Details
21+
- 增量编译命令从 `IarBuild.exe project.ewp Debug` 修正为 `IarBuild.exe project.ewp -make Debug`
22+
- 工作目录从项目根目录修正为.ewp文件所在目录
23+
- 统一使用`self.iar_project_path`代替混淆的`self.project_path`
24+
25+
### 相关文档 / Related Documentation
26+
- 新增 `docs/BUGFIX_IAR_COMPILE.md` 详细说明修复内容
27+
1128
## [1.0.5.0] - 2025-01-14
1229

1330
### 重大更新 / Major Updates

lib_IAR/builder.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, config: dict, configuration: Dict = None):
4848
# 验证路径
4949
logger.info(f"IAR可执行文件: {self.iar_exe_path}")
5050
logger.info(f"IAR工作区文件: {self.workspace_path}")
51-
logger.info(f"IAR项目文件: {self.project_path}")
51+
logger.info(f"IAR项目文件: {self.iar_project_path}")
5252
logger.info(f"输出bin文件: {self.output_bin_path}")
5353
self._validate_paths()
5454
self._check_permissions()
@@ -105,8 +105,8 @@ def _validate_paths(self):
105105
logger.warning(f"IAR工作区文件不存在: {self.workspace_path}")
106106

107107
# 检查项目文件
108-
if self.project_path and not os.path.exists(self.project_path):
109-
logger.warning(f"IAR项目文件不存在: {self.project_path}")
108+
if self.iar_project_path and not os.path.exists(self.iar_project_path):
109+
logger.warning(f"IAR项目文件不存在: {self.iar_project_path}")
110110

111111
def _check_permissions(self):
112112
"""检查权限"""
@@ -117,8 +117,8 @@ def _check_permissions(self):
117117
logger.warning(f"IAR可执行文件没有执行权限: {self.iar_exe_path}")
118118

119119
# 检查项目目录权限
120-
if self.project_path and os.path.exists(self.project_path):
121-
project_dir = os.path.dirname(self.project_path)
120+
if self.iar_project_path and os.path.exists(self.iar_project_path):
121+
project_dir = os.path.dirname(self.iar_project_path)
122122
if not os.access(project_dir, os.W_OK):
123123
logger.warning(f"项目目录没有写权限: {project_dir}")
124124

@@ -159,12 +159,12 @@ def diagnose_environment(self):
159159
logger.info(f"IAR可执行文件大小: {stat.st_size} 字节")
160160
logger.info(f"IAR可执行文件权限: {oct(stat.st_mode)}")
161161

162-
logger.info(f"项目文件路径: {self.project_path}")
163-
logger.info(f"项目文件存在: {os.path.exists(self.project_path)}")
162+
logger.info(f"项目文件路径: {self.iar_project_path}")
163+
logger.info(f"项目文件存在: {os.path.exists(self.iar_project_path)}")
164164

165165
# 检查项目目录权限
166-
if self.project_path and os.path.exists(self.project_path):
167-
project_dir = os.path.dirname(self.project_path)
166+
if self.iar_project_path and os.path.exists(self.iar_project_path):
167+
project_dir = os.path.dirname(self.iar_project_path)
168168
logger.info(f"项目目录: {project_dir}")
169169
logger.info(f"项目目录存在: {os.path.exists(project_dir)}")
170170
logger.info(f"项目目录可写: {os.access(project_dir, os.W_OK)}")
@@ -249,7 +249,7 @@ def clean_project(self) -> bool:
249249
timeout=self.timeout_seconds,
250250
creationflags=subprocess.CREATE_NO_WINDOW if hasattr(subprocess, 'CREATE_NO_WINDOW') else 0,
251251
shell=False, # 明确设置为False,避免shell权限问题
252-
cwd=os.path.dirname(self.project_path) if self.project_path else None # 设置工作目录
252+
cwd=os.path.dirname(self.iar_project_path) if self.iar_project_path else None # 设置工作目录
253253
)
254254

255255
if result.returncode == 0:
@@ -299,7 +299,8 @@ def build_project(self, force_rebuild: bool = False) -> Tuple[bool, str]:
299299
cmd = [
300300
self.iar_exe_path,
301301
self.iar_project_path,
302-
self.build_config # 不指定-build参数,默认为make操作
302+
'-make',
303+
self.build_config
303304
]
304305

305306
logger.info(f"执行命令: {' '.join(cmd)}")
@@ -338,7 +339,7 @@ def build_project(self, force_rebuild: bool = False) -> Tuple[bool, str]:
338339
text=True,
339340
timeout=self.timeout_seconds,
340341
shell=True,
341-
cwd=os.path.dirname(self.project_path) if self.project_path else None
342+
cwd=os.path.dirname(self.iar_project_path) if self.iar_project_path else None
342343
)
343344
else:
344345
logger.info(f"执行命令: {' '.join(cmd)}")
@@ -349,7 +350,7 @@ def build_project(self, force_rebuild: bool = False) -> Tuple[bool, str]:
349350
timeout=self.timeout_seconds,
350351
creationflags=use_creationflags,
351352
shell=False,
352-
cwd=os.path.dirname(self.project_path) if self.project_path else None
353+
cwd=os.path.dirname(self.iar_project_path) if self.iar_project_path else None
353354
)
354355

355356
# 如果成功执行,跳出循环
@@ -520,7 +521,8 @@ def test_iar_builder():
520521

521522
logger.info("IAR编译器测试")
522523
logger.info(f"IAR可执行文件: {builder.iar_exe_path}")
523-
logger.info(f"项目文件: {builder.project_path}")
524+
logger.info(f"IAR项目文件: {builder.iar_project_path}")
525+
logger.info(f"项目根目录: {builder.project_path}")
524526
logger.info(f"输出bin文件: {builder.output_bin_path}")
525527

526528
# 检查bin文件

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# 工具版本号
99
# 格式:四位十进制数,每个位的范围是0-9
1010
# 例如:1.2.3.4 表示版本 1.2.3.4
11-
VERSION = "1.0.5.0"
11+
VERSION = "1.0.5.1"

0 commit comments

Comments
 (0)