pub(crate) fn get_program_build_args(args: &BuildArgs) -> Vec<String> {
    let mut build_args = vec![
        "build".to_string(),
        "--release".to_string(),
        "--target".to_string(),
        BUILD_TARGET.to_string(),
    ];

    if args.ignore_rust_version {
        build_args.push("--ignore-rust-version".to_string());
    }

    build_args.push("-Ztrim-paths".to_string());

    for p in &args.packages {
        build_args.push("-p".to_string());
        build_args.push(p.to_string());
    }

    for b in &args.binaries {
        build_args.push("--bin".to_string());
        build_args.push(b.to_string());
    }

    if !args.features.is_empty() {
        build_args.push("--features".to_string());
        build_args.push(args.features.join(","));
    }

    if args.no_default_features {
        build_args.push("--no-default-features".to_string());
    }

    if args.locked {
        build_args.push("--locked".to_string());
    }

    build_args
}
Get the arguments to build the program with the arguments from the [`BuildArgs`] struct.
crates/build/src/command/utils.rs