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.
| Parameter | Type | Description |
|---|---|---|
| opts | object | |
| [opts.path] | string | Workspace-relative directory containing Cargo.toml. Defaults to the calling BUILD.js's own directory. |
| [opts.bin] | string | string[] |
| [opts.release=false] | boolean | Always build with cargo build --release. |
| [opts.toolchain] | object | string |
| [opts.cargoArgs=[]] | string[] | Extra arguments appended to cargo build. |
| [opts.testArgs=[]] | string[] | Extra arguments appended to cargo test. |
| [opts.testTools=[]] | Array | nativeTool() specifications exposed on PATH while running tests (including doc-tests in a real workspace's shared run). |
| [opts.deps=[]] | Array | Extra graph-native input handles the build needs (e.g. a resourcePackage()'s .files). |
| [opts.testDeps=[]] | Array | Extra graph-native input handles the test run needs but the build doesn't. |
| [opts.generatedSrcs=[]] | Array | codegen() results or { artifact, path } entries staged at their declared paths during compilation. |
| [opts.workspaceMember=false] | boolean | This package is a member of a workspace rooted at "." (see module docstring's limitation on non-root workspace roots). |
| [opts.builtin=false] | boolean | Read the package from the installed rules bundle instead of the consumer workspace. |
Returns: object Frozen object with lazy [BUILD]/[TEST]/[LINT]/[FMT]/[PACKAGE] getters.