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

Function generate_config_files

build.py:225–243  ·  view source on GitHub ↗

Generates config.toml and jvm-unknown-unknown.json from templates.

()

Source from the content-addressed store, hash-verified

223 recorded_toolchain = (
224 Config.RUST_BACKEND_TOOLCHAIN.read_text()
225 if Config.RUST_BACKEND_TOOLCHAIN.exists()
226 else None
227 )
228 if (
229 not is_stale(Config.RUST_BACKEND_DYLIB, sources)
230 and recorded_toolchain == toolchain
231 ):
232 print(f"{Colors.GREEN}✅ Rust codegen backend is up to date.{Colors.RESET}")
233 return
234
235 print(f"{Colors.CYAN}📦 Building Rust codegen backend...{Colors.RESET}")
236 # Setting RUSTFLAGS as an environment variable is more robust.
237 env = os.environ.copy()
238 env["RUSTFLAGS"] = "-Awarnings"
239 subprocess.run(["cargo", "build", "--release"], cwd=Config.ROOT_DIR, check=True, env=env)
240 Config.RUST_BACKEND_TOOLCHAIN.write_text(toolchain)
241 print(f"{Colors.GREEN} Rust codegen backend built successfully.{Colors.RESET}")
242
243def build_java_linker():
244 """Builds the java-linker subproject."""
245 if not is_stale(Config.JAVA_LINKER_EXE, Config.LINKER_RUST_SOURCES):
246 print(f"{Colors.GREEN}✅ Java linker is up to date.{Colors.RESET}")

Callers 1

all_tasksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected