feat: 修复混淆路径过滤与错误分类误报,并加速打包流程
- 同步 discovery.py 修复:相对 scan_dir 路径过滤,防止 ./build 目录下 Pods/ 第三方库保护失效 - 同步 obfuscate_symbols.py 多进程并行混淆写盘,build_service 启用 PYTHONUNBUFFERED=1 与 python3 -u 实时输出进度 - build_service 移除全新 derived_data 下多余的 xcodebuild clean,macOS APFS 优先使用 cp -c -R 零拷贝克隆源码 - Ad_Hoc 包按「分支 + 版本号」稳定复用 L1/LLVM seed 命中 obj_cache,App_Store 保持每次唯一 - 收紧 _classify_build_error 中 provisioning 关键词并补充协议遵循失败匹配,避免编译错误被误报为描述文件问题 - 更新与补充单元测试(226 passed)
This commit is contained in:
@@ -15,6 +15,33 @@ def should_exclude_path(path: str, exclude_path_fragments) -> bool:
|
||||
return any(fragment in path for fragment in exclude_path_fragments)
|
||||
|
||||
|
||||
def _rel_path_within_scan_dir(path: str, scan_dir: str) -> str:
|
||||
"""将 path 转为相对 scan_dir 的路径,避免上层工作目录名(如 build/)触发误排除。"""
|
||||
try:
|
||||
rel = os.path.relpath(os.path.abspath(path), os.path.abspath(scan_dir))
|
||||
except ValueError:
|
||||
return path
|
||||
if rel == ".":
|
||||
return ""
|
||||
if rel == ".." or rel.startswith(".." + os.sep):
|
||||
return path
|
||||
return rel
|
||||
|
||||
|
||||
def _rel_path_for_filter(path: str, scan_dirs: list) -> str:
|
||||
abs_path = os.path.abspath(path)
|
||||
best_rel = None
|
||||
best_len = -1
|
||||
for scan_dir in scan_dirs:
|
||||
abs_scan = os.path.abspath(scan_dir)
|
||||
prefix = abs_scan.rstrip(os.sep) + os.sep
|
||||
if abs_path == abs_scan or abs_path.startswith(prefix):
|
||||
if len(abs_scan) > best_len:
|
||||
best_len = len(abs_scan)
|
||||
best_rel = _rel_path_within_scan_dir(abs_path, abs_scan)
|
||||
return best_rel if best_rel is not None else path
|
||||
|
||||
|
||||
def _run_command_capture_stdout(args: list) -> str:
|
||||
try:
|
||||
completed = subprocess.run(
|
||||
@@ -40,7 +67,8 @@ def _discover_files_via_os_walk(scan_dirs: list, allowed_exts: tuple, exclude_pa
|
||||
directory for directory in dirs
|
||||
if not any(fragment.strip("/") in directory for fragment in exclude_path_fragments)
|
||||
]
|
||||
if path_matches_dir_names(root, skip_dir_names):
|
||||
rel_root = _rel_path_within_scan_dir(root, scan_dir)
|
||||
if path_matches_dir_names(rel_root, skip_dir_names):
|
||||
continue
|
||||
for filename in filenames:
|
||||
ext = os.path.splitext(filename)[1]
|
||||
@@ -50,9 +78,10 @@ def _discover_files_via_os_walk(scan_dirs: list, allowed_exts: tuple, exclude_pa
|
||||
if basename_prefixes and not any(name_no_ext.startswith(prefix) for prefix in basename_prefixes):
|
||||
continue
|
||||
full_path = os.path.normpath(os.path.join(root, filename))
|
||||
if should_exclude_path(full_path, exclude_path_fragments):
|
||||
rel_file = _rel_path_within_scan_dir(full_path, scan_dir)
|
||||
if should_exclude_path(rel_file, exclude_path_fragments):
|
||||
continue
|
||||
if path_matches_dir_names(full_path, skip_dir_names):
|
||||
if path_matches_dir_names(rel_file, skip_dir_names):
|
||||
continue
|
||||
files.append(full_path)
|
||||
return sorted(set(files))
|
||||
@@ -77,9 +106,12 @@ def _discover_files_via_rg(scan_dirs: list, allowed_exts: tuple, exclude_path_fr
|
||||
files = []
|
||||
for line in output.splitlines():
|
||||
path = os.path.normpath(line.strip())
|
||||
if not path or should_exclude_path(path, exclude_path_fragments):
|
||||
if not path:
|
||||
continue
|
||||
if path_matches_dir_names(path, skip_dir_names):
|
||||
rel_path = _rel_path_for_filter(path, scan_dirs)
|
||||
if should_exclude_path(rel_path, exclude_path_fragments):
|
||||
continue
|
||||
if path_matches_dir_names(rel_path, skip_dir_names):
|
||||
continue
|
||||
if basename_prefixes:
|
||||
name_no_ext = os.path.splitext(os.path.basename(path))[0]
|
||||
|
||||
Reference in New Issue
Block a user