Skip to content

Commit c84ee39

Browse files
authored
Only build cmd/internal/cov package on go1.20 where it exists (#4489)
**What type of PR is this?** bug fix **What does this PR do? Why is it needed?** build_stdlib wouldn't work on <go1.20 **Which issues(s) does this PR fix?** Fixes # **Other notes for review**
1 parent 4ded826 commit c84ee39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

go/private/actions/stdlib.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ def _build_stdlib(go):
143143
if not go.mode.pure:
144144
args.add("-package", "runtime/cgo")
145145

146-
# For bzltestutil's coverage support.
147-
args.add("-package", "cmd/internal/cov")
148-
args.add("-package", "cmd/internal/bio")
146+
version = parse_version(go.sdk.version)
147+
if version and version[0] >= 1 and version[1] >= 20:
148+
# For bzltestutil's coverage support - `cmd/internal/cov` only introduced in go 1.20
149+
args.add("-package", "cmd/internal/cov")
150+
args.add("-package", "cmd/internal/bio")
149151

150152
link_mode_flag = link_mode_arg(go.mode)
151153
if link_mode_flag:

0 commit comments

Comments
 (0)