(src_path: Path, install_root: Path)
| 877 | |
| 878 | |
| 879 | def copy_cpp_algo_binary(src_path: Path, install_root: Path) -> None: |
| 880 | agent_dir = install_root / "agent" |
| 881 | agent_dir.mkdir(parents=True, exist_ok=True) |
| 882 | |
| 883 | target_path = agent_dir / CPP_ALGO_DIST_NAME |
| 884 | _replace_file_with_retry(src_path, target_path) |
| 885 | print(Console.ok(t("inf_updated_file", name=target_path.name))) |
| 886 | |
| 887 | if OS_KEYWORD != "win": |
| 888 | target_path.chmod(target_path.stat().st_mode | 0o111) |
| 889 | |
| 890 | pdb_src = src_path.with_suffix(".pdb") |
| 891 | if pdb_src.exists(): |
| 892 | pdb_target = agent_dir / f"{Path(CPP_ALGO_DIST_NAME).stem}.pdb" |
| 893 | _replace_file_with_retry(pdb_src, pdb_target) |
| 894 | print(Console.ok(t("inf_updated_file", name=pdb_target.name))) |
| 895 | |
| 896 | for companion_name in CPP_ALGO_COMPANION_FILES: |
| 897 | companion_src = src_path.parent / companion_name |
| 898 | if not companion_src.exists(): |
| 899 | print(Console.warn(t("wrn_cpp_algo_companion_missing", name=companion_name))) |
| 900 | continue |
| 901 | companion_target = agent_dir / companion_name |
| 902 | _replace_file_with_retry(companion_src, companion_target) |
| 903 | print(Console.ok(t("inf_updated_file", name=companion_target.name))) |
| 904 | |
| 905 | |
| 906 | def _github_auth_headers() -> dict[str, str] | None: |
no test coverage detected