rules/oci/toolchain/index.js

Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.

CRANE_TOOL

const CRANE_TOOL

Undocumented.

craneArtifactName()

craneArtifactName(version, plat)

Return the crane release artifact filename for a version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

craneDownloadUrl()

craneDownloadUrl(version, plat)

Return the crane release download URL for a version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

craneSupportedPlatforms()

craneSupportedPlatforms()

Return the platforms crane publishes release archives for.

Returns: Array<{ os: string, arch: string }>

craneCacheKey()

craneCacheKey(version, plat)

Return the named-cache key for a crane toolchain version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

CraneToolchain (implementation class)

class CraneToolchain

Implementation class. BUILD files should use craneToolchain().

Undocumented.

craneToolchain()

craneToolchain(version, opts = {})

Declare a crane toolchain version and optionally set it as the default. matching lockfile entry (warns instead of failing).

ParameterTypeDescription
versionstring
[opts]object
[opts.default=false]boolean
[opts.unverified=false]booleanAllow downloading without a

Returns: object Target handle for this crane toolchain.

installCraneToolchain()

installCraneToolchain(version, source)

Install a local crane toolchain directory into the named cache.

ParameterTypeDescription
versionstring
sourcestringPath to the toolchain root.

Returns: string|null Local path to the cached toolchain root.

acquireCraneToolchain

const acquireCraneToolchain

Acquire a crane toolchain, downloading and caching it if not already installed in the named cache.

ParameterTypeDescription
versionstring

Returns: Promise<string> Local path to the toolchain root.

resolveCraneToolchainVersion()

resolveCraneToolchainVersion(version)

Resolve an explicit or default crane toolchain version.

ParameterTypeDescription
[version]string

Returns: string|null

defaultCraneToolchainVersion()

defaultCraneToolchainVersion()

Return the currently configured default crane toolchain version.

Returns: string|null

defaultCraneToolchain()

defaultCraneToolchain()

Return the currently configured default crane toolchain target handle.

Returns: object|null