rules/imp/lockfile/index.js

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

lockfileAddressToPath()

lockfileAddressToPath(address)

Convert a lockfile address (//a/b.lock) to a workspace-relative path (a/b.lock) — where gen-lockfiles writes it.

ParameterTypeDescription
addressstring

Returns: string

lockfileFor()

lockfileFor(toolchainClass, version, fallbackAddress)

Lockfile address a toolchain version resolves to: the address the declared instance carries in its attrs (the instance that declared this exact version, else the default instance), falling back to the rule library's shipped address. toolchainClass is passed in so this module stays free of a Toolchain import.

ParameterTypeDescription
toolchainClass{ instanceForVersion(version: string): { attrs: { lockfile?: string } }undefined }
versionstring
fallbackAddressstringShipped lockfile address for this toolchain.

Returns: string

shaToolName()

shaToolName(plat)

Name of the SHA-256 checking native tool for a platform — sha256sum everywhere it's stock (linux; windows via Git-for-Windows sh, the same environment the curl/tar scripts already assume), shasum on macos.

ParameterTypeDescription
plat{ os: string }

Returns: string

lockedDownloadTools()

lockedDownloadTools(plat)

Native-tool names the lockedDownloadArgv script needs — the sandbox is fully hermetic, so even bare coreutils must be declared tools. Bare sh only auto-resolves on unix, so it is declared on windows only (same convention as the toolchain coreToolNames lists).

ParameterTypeDescription
plat{ os: string }

Returns: string[]