Skip to content

Commit 605d504

Browse files
committed
limactl: run file manipulation subcommands under Rosetta
This allows to run `completion`, `generate-doc` and `validate` subcommands when running under Rosetta. This is useful when packaging lima for macOS on Apple Silicon for Intel arch. Signed-off-by: Yuriy Taraday <[email protected]>
1 parent 2bd2859 commit 605d504

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/limactl/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ func newApp() *cobra.Command {
7777
logrus.SetLevel(logrus.DebugLevel)
7878
}
7979

80-
if osutil.IsBeingRosettaTranslated() {
80+
if osutil.IsBeingRosettaTranslated() && cmd.Parent().Name() != "completion" && cmd.Name() != "generate-doc" && cmd.Name() != "validate" {
8181
// running under rosetta would provide inappropriate runtime.GOARCH info, see: https://github.com/lima-vm/lima/issues/543
82+
// allow commands that are used for packaging to run under rosetta to allow cross-architecture builds
8283
return errors.New("limactl is running under rosetta, please reinstall lima with native arch")
8384
}
8485

0 commit comments

Comments
 (0)