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

Function clean

build.py:98–123  ·  view source on GitHub ↗

Cleans all generated files and build artifacts.

()

Source from the content-addressed store, hash-verified

96 print(f"{Colors.RED}❌ Command failed with exit code {e.returncode}.{Colors.RESET}")
97 sys.exit(e.returncode)
98
99def is_stale(target: Path, sources: List[Path]) -> bool:
100 """Checks if the target file is older than any source file."""
101 if not target.exists():
102 return True
103 target_mtime = target.stat().st_mtime
104 for source in sources:
105 if not source.exists():
106 # If a source is missing, something is wrong, but we can't compare.
107 # This might warrant an error or warning depending on the case.
108 continue
109 if source.stat().st_mtime > target_mtime:
110 return True
111 return False
112
113def rustc_toolchain_fingerprint() -> str:
114 """Returns the exact compiler identity that the rustc-private backend uses."""
115 try:
116 return subprocess.check_output(
117 ["rustc", "--version", "--verbose"],
118 cwd=Config.ROOT_DIR,
119 text=True,
120 ).strip()
121 except (FileNotFoundError, subprocess.CalledProcessError) as error:
122 print(f"{Colors.RED}❌ Could not query the active Rust compiler: {error}{Colors.RESET}")
123 sys.exit(1)
124
125def contains_non_runtime_classes(jar_path: Path) -> bool:
126 """Checks whether a runtime JAR contains classes outside its owned package."""

Callers

nothing calls this directly

Calls 1

run_commandFunction · 0.70

Tested by

no test coverage detected