File tree Expand file tree Collapse file tree 5 files changed +42
-8
lines changed Expand file tree Collapse file tree 5 files changed +42
-8
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,23 @@ jobs:
145
145
# GHA macOS is slow and flaky, so we only test a few YAMLS here.
146
146
# Other yamls are tested on Linux instances of Cirrus.
147
147
148
+ catalina :
149
+ name : " macOS 10.15 (deprecated)"
150
+ # Will be fully unsupported by 12/1/22 https://github.com/actions/runner-images/issues/5583
151
+ runs-on : macos-10.15
152
+ timeout-minutes : 20
153
+ steps :
154
+ - uses : actions/setup-go@v3
155
+ with :
156
+ go-version : 1.19.x
157
+ - uses : actions/checkout@v3
158
+ with :
159
+ fetch-depth : 1
160
+ - name : Make
161
+ run : make
162
+ - name : Install
163
+ run : make install
164
+
148
165
vmnet :
149
166
name : " VMNet test"
150
167
runs-on : macos-11
Original file line number Diff line number Diff line change @@ -13,12 +13,21 @@ bat = .bat
13
13
exe = .exe
14
14
endif
15
15
16
+ GO_BUILDTAGS ?=
17
+ ifeq ($(GOOS ) ,darwin)
18
+ MACOS_VERSION =$(shell sw_vers -productVersion | cut -d . -f 1)
19
+ ifeq ($(shell test $(MACOS_VERSION ) -lt 13; echo $$? ) ,0)
20
+ # The "vz" mode needs macOS 13 or later
21
+ GO_BUILDTAGS += no_vz
22
+ endif
23
+ endif
24
+
16
25
PACKAGE := github.com/lima-vm/lima
17
26
18
27
VERSION =$(shell git describe --match 'v[0-9]* ' --dirty='.m' --always --tags)
19
28
VERSION_TRIMMED := $(VERSION:v%=% )
20
29
21
- GO_BUILD := $(GO ) build -ldflags="-s -w -X $(PACKAGE ) /pkg/version.Version=$(VERSION ) "
30
+ GO_BUILD := $(GO ) build -ldflags="-s -w -X $(PACKAGE ) /pkg/version.Version=$(VERSION ) " -tags " $( GO_BUILDTAGS ) "
22
31
23
32
.NOTPARALLEL :
24
33
Original file line number Diff line number Diff line change
1
+ //go:build darwin && !no_vz
2
+ // +build darwin,!no_vz
3
+
1
4
package vz
2
5
3
6
import (
Original file line number Diff line number Diff line change
1
+ //go:build darwin && !no_vz
2
+ // +build darwin,!no_vz
3
+
1
4
package vz
2
5
3
6
import (
Original file line number Diff line number Diff line change 1
- //go:build !darwin
2
- // +build !darwin
1
+ //go:build !darwin || no_vz
2
+ // +build !darwin no_vz
3
3
4
4
package vz
5
5
6
6
import (
7
7
"context"
8
- "fmt "
8
+ "errors "
9
9
10
10
"github.com/lima-vm/lima/pkg/driver"
11
11
)
12
12
13
+ var ErrUnsupported = errors .New ("vm driver 'vz' needs macOS 13 or later (Hint: try recompiling Lima if you are seeing this error on macOS 13)" )
14
+
13
15
type LimaVzDriver struct {
14
16
* driver.BaseDriver
15
17
}
@@ -21,17 +23,17 @@ func New(driver *driver.BaseDriver) *LimaVzDriver {
21
23
}
22
24
23
25
func (l * LimaVzDriver ) Validate () error {
24
- return fmt . Errorf ( "driver 'vz' is only supported on darwin" )
26
+ return ErrUnsupported
25
27
}
26
28
27
29
func (l * LimaVzDriver ) CreateDisk () error {
28
- return fmt . Errorf ( "driver 'vz' is only supported on darwin" )
30
+ return ErrUnsupported
29
31
}
30
32
31
33
func (l * LimaVzDriver ) Start (ctx context.Context ) (chan error , error ) {
32
- return nil , fmt . Errorf ( "driver 'vz' is only supported on darwin" )
34
+ return nil , ErrUnsupported
33
35
}
34
36
35
37
func (l * LimaVzDriver ) Stop (_ context.Context ) error {
36
- return fmt . Errorf ( "driver 'vz' is only supported on darwin" )
38
+ return ErrUnsupported
37
39
}
You can’t perform that action at this time.
0 commit comments