From 1184e4257d95dbafc4efe6db5674ee089d49a1a2 Mon Sep 17 00:00:00 2001 From: Techassi Date: Sun, 23 Nov 2025 13:26:19 +0100 Subject: [PATCH 1/3] chore: Move parse_image_version function --- rust/boil/src/build/cli.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/boil/src/build/cli.rs b/rust/boil/src/build/cli.rs index ce0073594..41475bd0f 100644 --- a/rust/boil/src/build/cli.rs +++ b/rust/boil/src/build/cli.rs @@ -28,7 +28,7 @@ pub struct BuildArguments { /// The image version being built. #[arg( short, long, - value_parser = parse_image_version, + value_parser = BuildArguments::parse_image_version, default_value_t = Self::default_image_version(), help_heading = "Image Options" )] @@ -121,6 +121,13 @@ pub struct BuildArguments { } impl BuildArguments { + fn parse_image_version(input: &str) -> Result { + let version = Version::from_str(input).context(ParseVersionSnafu)?; + ensure!(version.build.is_empty(), ContainsBuildMetadataSnafu); + + Ok(version) + } + fn default_image_version() -> Version { "0.0.0-dev".parse().expect("must be a valid SemVer") } @@ -151,13 +158,6 @@ pub enum ParseImageVersionError { ContainsBuildMetadata, } -pub fn parse_image_version(input: &str) -> Result { - let version = Version::from_str(input).context(ParseVersionSnafu)?; - ensure!(version.build.is_empty(), ContainsBuildMetadataSnafu); - - Ok(version) -} - #[derive(Debug, PartialEq, Snafu, EnumDiscriminants)] pub enum ParseHostPortError { #[snafu(display("unexpected empty input"))] From b6f82fb83a1d513b2e927eb71598bb22201f5ce0 Mon Sep 17 00:00:00 2001 From: Techassi Date: Sun, 23 Nov 2025 13:30:38 +0100 Subject: [PATCH 2/3] feat: Forward args to docker command --- rust/boil/src/build/cli.rs | 9 +++++++++ rust/boil/src/build/mod.rs | 4 +++- rust/boil/src/cli.rs | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rust/boil/src/build/cli.rs b/rust/boil/src/build/cli.rs index 41475bd0f..39110d10c 100644 --- a/rust/boil/src/build/cli.rs +++ b/rust/boil/src/build/cli.rs @@ -113,11 +113,20 @@ pub struct BuildArguments { /// Loads the image into the local image store. #[arg(long, help_heading = "Build Options")] + #[deprecated(since = "0.1.7", note = "Use -- --load instead")] pub load: bool, /// Dry run. This does not build the image(s) but instead prints out the bakefile. #[arg(short, long, alias = "dry")] pub dry_run: bool, + + /// Arguments passed after '--' which are directly passed to the Docker command. + /// + /// Care needs to be taken, because these arguments can override/modify the behaviour defined + /// via the generated Bakefile. A few save arguments include but are not limited to: --load, + /// --no-cache, --progress. + #[arg(raw = true)] + pub rest: Vec, } impl BuildArguments { diff --git a/rust/boil/src/build/mod.rs b/rust/boil/src/build/mod.rs index c7e3a41f6..ea070b6f0 100644 --- a/rust/boil/src/build/mod.rs +++ b/rust/boil/src/build/mod.rs @@ -48,7 +48,7 @@ pub enum Error { } /// This is the `boil build` command handler function. -pub fn run_command(args: BuildArguments, config: Config) -> Result<(), Error> { +pub fn run_command(args: Box, config: Config) -> Result<(), Error> { // TODO (@Techassi): Parse Dockerfile instead to build the target graph // Validation ensure!( @@ -77,10 +77,12 @@ pub fn run_command(args: BuildArguments, config: Config) -> Result<(), Error> { // or by building the image ourself. // Finally invoke the docker buildx bake command + #[allow(deprecated)] let mut child = Command::new("docker") .arg("buildx") .arg("bake") .arg_if(args.load, "--load") + .args(args.rest) .arg("--file") .arg("-") .stdin(Stdio::piped()) diff --git a/rust/boil/src/cli.rs b/rust/boil/src/cli.rs index 85323f289..7142b0210 100644 --- a/rust/boil/src/cli.rs +++ b/rust/boil/src/cli.rs @@ -27,7 +27,7 @@ pub enum Command { /// /// Requires docker with the buildx extension. #[command(alias = "some-chicken")] - Build(BuildArguments), + Build(Box), /// Display various structured outputs in JSON format. Show(ShowArguments), From d94600a2d13904d5236a84f9cd7979ac4517d7e6 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 24 Nov 2025 10:37:31 +0100 Subject: [PATCH 3/3] chore: Add deprecation note to help text --- rust/boil/src/build/cli.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/boil/src/build/cli.rs b/rust/boil/src/build/cli.rs index 39110d10c..4f33a841a 100644 --- a/rust/boil/src/build/cli.rs +++ b/rust/boil/src/build/cli.rs @@ -112,6 +112,8 @@ pub struct BuildArguments { pub strip_architecture: bool, /// Loads the image into the local image store. + /// + /// DEPRECATED: Use -- --load instead. #[arg(long, help_heading = "Build Options")] #[deprecated(since = "0.1.7", note = "Use -- --load instead")] pub load: bool,