Rust

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

linkerHandlesFor()

linkerHandlesFor(legacyToolchainHandle)

Undocumented.

linkerHandlesForSpec()

linkerHandlesForSpec(specLike)

Undocumented.

linkerToolInputs()

linkerToolInputs(linkerHandles)

Undocumented.

cargoScriptPreamble()

cargoScriptPreamble(scriptPreamble = "")

Undocumented.

cargoRemapFlag()

cargoRemapFlag(kacheActive)

Undocumented.

cargoInvocationScript()

cargoInvocationScript(cargoCommand, opts = {})

Undocumented.

cargoPackageHandles()

cargoPackageHandles()

Undocumented.

cargoPackage()

cargoPackage(opts = {})

Declare a Cargo package target: a self-contained crate, a cargo workspace root (member manifests are globbed via **\/Cargo.toml), or one member of an outer workspace declared elsewhere (see workspaceMember). bin is optional — a lib-only package is a fully valid target for fmt/test, just not for build/package.

ParameterTypeDescription
optsobject
[opts.path]stringWorkspace-relative directory containing Cargo.toml. Defaults to the calling BUILD.js's own directory.
[opts.bin]stringstring[]
[opts.release=false]booleanAlways build with cargo build --release.
[opts.toolchain]objectstring
[opts.cargoArgs=[]]string[]Extra arguments appended to cargo build.
[opts.testArgs=[]]string[]Extra arguments appended to cargo test.
[opts.testTools=[]]ArraynativeTool() specifications exposed on PATH while running tests (including doc-tests in a real workspace's shared run).
[opts.deps=[]]ArrayExtra graph-native input handles the build needs (e.g. a resourcePackage()'s .files).
[opts.testDeps=[]]ArrayExtra graph-native input handles the test run needs but the build doesn't.
[opts.generatedSrcs=[]]Arraycodegen() results or { artifact, path } entries staged at their declared paths during compilation.
[opts.workspaceMember=false]booleanThis package is a member of a workspace rooted at "." (see module docstring's limitation on non-root workspace roots).
[opts.builtin=false]booleanRead the package from the installed rules bundle instead of the consumer workspace.

Returns: object Frozen object with lazy [BUILD]/[TEST]/[LINT]/[FMT]/[PACKAGE] getters.