1
0
mirror of https://github.com/siderolabs/kres.git synced 2026-02-05 09:45:35 +01:00

feat: support buildx debug build

Support build debug builds.

Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
Noel Georgi
2025-12-31 14:59:43 +05:30
parent 26be706c3c
commit 8a4aebfb00
3 changed files with 18 additions and 1 deletions

View File

@@ -139,9 +139,15 @@ func (docker *Docker) CompileMakefile(output *makefile.Output) error {
Variable(makefile.OverridableVariable("PROGRESS", "auto")).
Variable(makefile.OverridableVariable("PUSH", "false")).
Variable(makefile.OverridableVariable("CI_ARGS", "")).
Variable(makefile.OverridableVariable("WITH_BUILD_DEBUG", "")).
Variable(makefile.OverridableVariable("BUILDKIT_MULTI_PLATFORM", "")).
Variable(buildArgs)
output.IfTrueCondition("WITH_BUILD_DEBUG").
Then(
makefile.SimpleVariable("BUILD", "BUILDX_EXPERIMENTAL=1 docker buildx debug --invoke /bin/sh --on error build"),
)
output.Target("target-%").
Description("Builds the specified target defined in the Dockerfile. The build result will only remain in the build cache.").
Script(`@$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) .`)

View File

@@ -108,9 +108,15 @@ func (pkgfile *Build) CompileMakefile(output *makefile.Output) error {
Variable(makefile.OverridableVariable("PROGRESS", "auto")).
Variable(makefile.OverridableVariable("PUSH", "false")).
Variable(makefile.OverridableVariable("CI_ARGS", "")).
Variable(makefile.OverridableVariable("WITH_BUILD_DEBUG", "")).
Variable(buildArgs).
Variable(commonArgs)
output.IfTrueCondition("WITH_BUILD_DEBUG").
Then(
makefile.SimpleVariable("BUILD", "BUILDX_EXPERIMENTAL=1 docker buildx debug --invoke /bin/sh --on error build"),
)
for _, arg := range pkgfile.Makefile.ExtraVariables {
output.VariableGroup(makefile.VariableGroupExtra).
Variable(makefile.OverridableVariable(arg.Name, arg.DefaultValue))