Mold
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
MOLD_TOOL
const MOLD_TOOL
Undocumented.
moldArtifactName()
moldArtifactName(version, plat)
Return the mold release artifact filename for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
moldDownloadUrl()
moldDownloadUrl(version, plat)
Return the mold release download URL for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
moldSupportedPlatforms()
moldSupportedPlatforms()
Return the platforms mold publishes release archives for.
Returns: Array<{ os: string, arch: string }>
moldCacheKey()
moldCacheKey(version, plat)
Return the named-cache key for a mold toolchain version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
MoldToolchain (implementation class)
class MoldToolchain
Implementation class. BUILD files should use moldToolchain().
Undocumented.
moldToolchain()
moldToolchain(version, opts = {})
Declare a mold toolchain version and optionally set it as the default. matching lockfile entry (warns instead of failing).
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| [opts] | object | |
| [opts.default=false] | boolean | |
| [opts.unverified=false] | boolean | Allow downloading without a |
Returns: object Target handle for this mold toolchain.
installMoldToolchain()
installMoldToolchain(version, source)
Install a local mold toolchain directory into the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| source | string | Path to the toolchain root. |
Returns: string|null Local path to the cached toolchain root.
acquireMoldToolchain
const acquireMoldToolchain
Acquire a mold toolchain, downloading and caching it if not already installed in the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string |
Returns: Promise<string> Local path to the toolchain root.
resolveMoldToolchainVersion()
resolveMoldToolchainVersion(version)
Resolve an explicit or default mold toolchain version.
| Parameter | Type | Description |
|---|---|---|
| [version] | string |
Returns: string|null
defaultMoldToolchainVersion()
defaultMoldToolchainVersion()
Return the currently configured default mold toolchain version.
Returns: string|null
defaultMoldToolchain()
defaultMoldToolchain()
Return the currently configured default mold toolchain target handle.
Returns: object|null
OdinMoldLinker
class OdinMoldLinker
Adapter exposing a mold toolchain as Odin's -linker:mold linker role. Registered as the "odin-linker" product for the "mold-toolchain" kind so odinScriptTools() (rules/odin/index.js) can resolve it dynamically via productFor(handle, ODIN_LINKER) instead of a hardcoded default lookup.
RustMoldLinker
class RustMoldLinker
Adapter exposing a mold toolchain as Rust/rustc's backend linker via -fuse-ld=mold, layered on whatever C link driver rustc uses (see RustGccLinkDriver in //rules/c/gcc). Registered as the "rust-linker" product for the "mold-toolchain" kind.