feat(tools): add persistent bash and str-replace editor
This commit is contained in:
@@ -13,6 +13,7 @@ _PLATFORMS = {
|
||||
"linux-arm64": ("manylinux_2_28_aarch64", "dsh-jsonrpc-agent-pkg-linux-arm64"),
|
||||
"macos-arm64": ("macosx_11_0_arm64", "dsh-jsonrpc-agent-pkg-macos-arm64"),
|
||||
}
|
||||
_SPAWN_HELPER_SUFFIX = "-spawn-helper"
|
||||
|
||||
|
||||
def _host_platform_tag() -> str:
|
||||
@@ -46,14 +47,23 @@ class RuntimeBuildHook(BuildHookInterface):
|
||||
)
|
||||
expected_executable = matches[0][1]
|
||||
runtime_dir = Path(self.root) / "src" / "deepseek_harness_runtime" / "runtime"
|
||||
executables = sorted(runtime_dir.glob("dsh-jsonrpc-agent-pkg-*") if runtime_dir.is_dir() else [])
|
||||
runtime_files = sorted(runtime_dir.glob("dsh-jsonrpc-agent-pkg-*") if runtime_dir.is_dir() else [])
|
||||
executables = [path for path in runtime_files if not path.name.endswith(_SPAWN_HELPER_SUFFIX)]
|
||||
helpers = [path for path in runtime_files if path.name.endswith(_SPAWN_HELPER_SUFFIX)]
|
||||
if [path.name for path in executables] != [expected_executable]:
|
||||
found = ", ".join(path.name for path in executables) or "none"
|
||||
raise RuntimeError(
|
||||
f"runtime wheel {platform_tag} must contain only {expected_executable}; found {found}"
|
||||
)
|
||||
if executables[0].stat().st_mode & stat.S_IXUSR == 0:
|
||||
raise RuntimeError(f"runtime executable is not executable: {executables[0]}")
|
||||
expected_helper = f"{expected_executable}{_SPAWN_HELPER_SUFFIX}"
|
||||
if [path.name for path in helpers] != [expected_helper]:
|
||||
found = ", ".join(path.name for path in helpers) or "none"
|
||||
raise RuntimeError(
|
||||
f"runtime wheel {platform_tag} must contain only {expected_helper}; found {found}"
|
||||
)
|
||||
for executable in [executables[0], helpers[0]]:
|
||||
if executable.stat().st_mode & stat.S_IXUSR == 0:
|
||||
raise RuntimeError(f"runtime executable is not executable: {executable}")
|
||||
|
||||
build_data["pure_python"] = False
|
||||
build_data["infer_tag"] = False
|
||||
|
||||
Reference in New Issue
Block a user