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
)
| 172 | |
| 173 | |
| 174 | def 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 | |
| 198 | def _enter_builder(arch: Arch, channel: str | None = None) -> list[str]: |
nothing calls this directly
no test coverage detected