Skip to content

Commit b521a2a

Browse files
bradfitzcodebien
authored andcommitted
cmd/buildlet, cmd/makemac: stop using legacy buildlet --reverse flag for Macs
Updates golang/go#21260 Change-Id: I4e2c61117cfebffd20ab4acd3ee736172c95d153 Reviewed-on: https://go-review.googlesource.com/c/build/+/205357 Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 62fee1d commit b521a2a

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

cmd/buildlet/buildlet.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,11 +1599,7 @@ func configureMacStadium() {
15991599
log.Fatalf("unsupported sw_vers version %q", version)
16001600
}
16011601
major, minor := m[1], m[2] // "10", "12"
1602-
if m, _ := strconv.Atoi(minor); m >= 13 {
1603-
*reverseType = "host-darwin-10_" + minor
1604-
} else {
1605-
*reverse = "darwin-amd64-" + major + "_" + minor
1606-
}
1602+
*reverseType = fmt.Sprintf("host-darwin-%s_%s", major, minor)
16071603
*coordinator = "farmer.golang.org:443"
16081604

16091605
// guestName is set by cmd/makemac to something like

cmd/makemac/makemac.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,9 @@ func (st *State) CreateMac(ctx context.Context, minor int) (slotName string, err
229229
return "", fmt.Errorf("unsupported makemac minor OS X version %d", minor)
230230
}
231231

232-
builderType := fmt.Sprintf("darwin-amd64-10_%d", minor)
232+
hostType := fmt.Sprintf("host-darwin-10_%d", minor)
233233

234-
// Up to 10.12 we used the deprecated buildlet --reverse mode, instead of --reverse-type.
235-
// Starting with 10.14 (and 10.13 if we ever make a High Sierra image), we're switching
236-
// to the non-deprecated mode.
237-
if minor >= 13 {
238-
builderType = fmt.Sprintf("host-darwin-10_%d", minor)
239-
}
240-
241-
key, err := ioutil.ReadFile(filepath.Join(os.Getenv("HOME"), "keys", builderType))
234+
key, err := ioutil.ReadFile(filepath.Join(os.Getenv("HOME"), "keys", hostType))
242235
if err != nil {
243236
return "", err
244237
}
@@ -281,7 +274,7 @@ func (st *State) CreateMac(ctx context.Context, minor int) (slotName string, err
281274
"-e", "smc.present=TRUE",
282275
"-e", "ich7m.present=TRUE",
283276
"-e", "firmware=efi",
284-
"-e", fmt.Sprintf("guestinfo.key-%s=%s", builderType, strings.TrimSpace(string(key))),
277+
"-e", fmt.Sprintf("guestinfo.key-%s=%s", hostType, strings.TrimSpace(string(key))),
285278
"-e", "guestinfo.name="+name,
286279
"-vm", name,
287280
); err != nil {

0 commit comments

Comments
 (0)