This commit is contained in:
root
2025-07-11 14:37:14 +08:00
parent cd75bf70ea
commit 6b2083a8bb
7 changed files with 1144 additions and 38 deletions

View File

@@ -54,12 +54,16 @@ def clean_build_directory(python_core_dir):
shutil.rmtree(dir_path)
print(f"Removed {dir_path}")
def build_executable(python_core_dir):
def build_executable(python_core_dir, use_simple=False):
"""构建可执行文件"""
print("🔨 Building executable...")
spec_file = python_core_dir / 'build.spec'
if use_simple:
spec_file = python_core_dir / 'build_simple.spec'
print("Using simplified build for testing...")
else:
spec_file = python_core_dir / 'build.spec'
if not spec_file.exists():
print(f"❌ Spec file not found: {spec_file}")
return False
@@ -228,9 +232,13 @@ def main():
clean_build_directory(python_core_dir)
# 步骤3: 构建可执行文件
if not build_executable(python_core_dir):
print("❌ Failed to build executable")
sys.exit(1)
# 首先尝试简化版本
print("Trying simplified build first...")
if not build_executable(python_core_dir, use_simple=True):
print("❌ Simplified build failed, trying full build...")
if not build_executable(python_core_dir, use_simple=False):
print("❌ Failed to build executable")
sys.exit(1)
# 步骤4: 复制到sidecar目录
if not copy_to_sidecar_directory(project_root, python_core_dir):