pub struct Builder {
pub rust_version: String,
pub mode: BuildMode,
pub bin: Option<String>,
pub strip: bool,
pub launcher: Launcher,
pub code_root: PathBuf,
pub project_path: PathBuf,
pub packages: Vec<String>,
pub relabel: Option<Relabel>,
}
Expand description
Options for running the build.
Fields§
§rust_version: String
Rust version to install. Can be anything rustup understands as a valid version, e.g. “stable” or “1.45.2”.
mode: BuildMode
Whether to build for Amazon Linux 2 or AWS Lambda.
bin: Option<String>
Name of the binary target to build. Can be None if the project only has one binary target.
strip: bool
Strip the binary.
launcher: Launcher
Container launcher.
code_root: PathBuf
The root of the code that gets mounted in the container. All the source must live beneath this directory.
project_path: PathBuf
The project path is the path of the crate to build. It must be
somewhere within the code_root
directory (or the same path).
packages: Vec<String>
dev packages to install in container for build
relabel: Option<Relabel>
Relabel files before bind-mounting (z
or Z
volume
option). Warning: this overwrites the current label on files on
the host. Doing this to a system directory like /usr
could
break your system.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn run(&self) -> Result<BuilderOutput, Error>
pub fn run(&self) -> Result<BuilderOutput, Error>
Run the build in a container.
This will produce either a standalone executable (for Amazon Linux 2) or a zip file (for AWS Lambda). The file is given a unique name for convenient uploading to S3, and a short symlink to the file is also created (target/latest-al2 or target/latest-lambda).
The paths of the files are returned.