MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / run_command

Function run_command

build.py:61–80  ·  view source on GitHub ↗

Runs a command, prints it, and checks for errors.

(cmd: List[str], cwd: Path = None, check: bool = True)

Source from the content-addressed store, hash-verified

59 DYLIB_SUFFIX = ".dll"
60 elif platform.system() == "Darwin":
61 DYLIB_PREFIX = "lib"
62 DYLIB_SUFFIX = ".dylib"
63 else:
64 DYLIB_PREFIX = "lib"
65 DYLIB_SUFFIX = ".so"
66
67 RUST_BACKEND_DYLIB = ROOT_DIR / "target/release" / f"{DYLIB_PREFIX}rustc_codegen_jvm{DYLIB_SUFFIX}"
68 RUST_BACKEND_TOOLCHAIN = ROOT_DIR / "target/release/.rustc_codegen_jvm-toolchain"
69 JAVA_LINKER_EXE = JAVA_LINKER_DIR / "target/release/java-linker"
70 CARGO_JVM_EXE = CARGO_JVM_DIR / "target/release" / (
71 "cargo-jvm.exe" if platform.system() == "Windows" else "cargo-jvm"
72 )
73
74 RUNTIME_CLASS_PREFIX = "org/rustlang/runtime/"
75
76# --- Helper Functions ---
77
78def run_command(cmd: List[str], cwd: Path = None, check: bool = True):
79 """Runs a command, prints it, and checks for errors."""
80 cwd_str = f" (in {cwd})" if cwd else ""
81 print(f"{Colors.YELLOW}▶️ Running: {' '.join(cmd)}{cwd_str}{Colors.RESET}")
82 try:
83 proc = subprocess.run(

Callers 4

cleanFunction · 0.70
install_rust_componentsFunction · 0.70
build_libraryFunction · 0.70
generate_shim_metadataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected