diff --git a/docs/md/melange_build.md b/docs/md/melange_build.md index bc119f73e..0c6217d57 100644 --- a/docs/md/melange_build.md +++ b/docs/md/melange_build.md @@ -36,7 +36,7 @@ melange build [flags] --cache-source string directory or bucket used for preloading the cache --cleanup when enabled, the temp dir used for the guest will be cleaned up after completion (default true) --cpu string default CPU resources to use for builds - --cpumodel string default memory resources to use for builds (default "host") + --cpumodel string default memory resources to use for builds --create-build-log creates a package.log file containing a list of packages that were built by the command --debug enables debug logging of build pipelines --debug-runner when enabled, the builder pod will persist after the build succeeds or fails diff --git a/pkg/cli/build.go b/pkg/cli/build.go index d4191133b..e6b0cab58 100644 --- a/pkg/cli/build.go +++ b/pkg/cli/build.go @@ -251,7 +251,7 @@ func buildCmd() *cobra.Command { cmd.Flags().BoolVarP(&interactive, "interactive", "i", false, "when enabled, attaches stdin with a tty to the pod on failure") cmd.Flags().BoolVar(&remove, "rm", true, "clean up intermediate artifacts (e.g. container images, temp dirs)") cmd.Flags().StringVar(&cpu, "cpu", "", "default CPU resources to use for builds") - cmd.Flags().StringVar(&cpumodel, "cpumodel", "host", "default memory resources to use for builds") + cmd.Flags().StringVar(&cpumodel, "cpumodel", "", "default memory resources to use for builds") cmd.Flags().StringVar(&disk, "disk", "", "disk size to use for builds") cmd.Flags().StringVar(&memory, "memory", "", "default memory resources to use for builds") cmd.Flags().DurationVar(&timeout, "timeout", 0, "default timeout for builds") diff --git a/pkg/container/qemu_runner.go b/pkg/container/qemu_runner.go index 5112681be..eb5d84255 100644 --- a/pkg/container/qemu_runner.go +++ b/pkg/container/qemu_runner.go @@ -358,14 +358,14 @@ func createMicroVM(ctx context.Context, cfg *Config) error { } // use kvm on linux, and Hypervisor.framework on macOS - if runtime.GOOS == "linux" { - if cfg.Arch.ToAPK() != apko_types.ParseArchitecture(runtime.GOARCH).ToAPK() { - baseargs = append(baseargs, "-accel", "tcg,thread=multi") - } else if _, err := os.Stat("/dev/kvm"); err == nil { + if cfg.Arch.ToAPK() != apko_types.ParseArchitecture(runtime.GOARCH).ToAPK() { + baseargs = append(baseargs, "-accel", "tcg,thread=multi") + } else { + if runtime.GOOS == "linux" { baseargs = append(baseargs, "-accel", "kvm") + } else if runtime.GOOS == "darwin" { + baseargs = append(baseargs, "-accel", "hvf") } - } else if runtime.GOOS == "darwin" { - baseargs = append(baseargs, "-accel", "hvf") } if cfg.CPUModel != "" {