MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / tool

Function tool

misc/python/materialize/xcompile.py:174–195  ·  view source on GitHub ↗

Constructs a cross-compiling binutils tool invocation. Args: arch: The CPU architecture to build for. name: The name of the binutils tool to invoke. channel: The Rust toolchain channel to use. Either None/"stable" or "nightly". prefix_name: Whether or not the too

(
    arch: Arch, name: str, channel: str | None = None, prefix_name: bool = True
)

Source from the content-addressed store, hash-verified

172
173
174def tool(
175 arch: Arch, name: str, channel: str | None = None, prefix_name: bool = True
176) -> list[str]:
177 """Constructs a cross-compiling binutils tool invocation.
178
179 Args:
180 arch: The CPU architecture to build for.
181 name: The name of the binutils tool to invoke.
182 channel: The Rust toolchain channel to use. Either None/"stable" or "nightly".
183 prefix_name: Whether or not the tool name should be prefixed with the target
184 architecture.
185
186 Returns:
187 A list of arguments specifying the beginning of the command to invoke.
188 """
189 if sys.platform == "darwin":
190 _bootstrap_darwin(arch)
191 tool_name = f"{target(arch)}-{name}" if prefix_name else name
192 return [
193 *_enter_builder(arch, channel),
194 tool_name,
195 ]
196
197
198def _enter_builder(arch: Arch, channel: str | None = None) -> list[str]:

Callers

nothing calls this directly

Calls 3

_bootstrap_darwinFunction · 0.85
targetFunction · 0.85
_enter_builderFunction · 0.85

Tested by

no test coverage detected