Commit ef98815
detect_sdk_version: Support 1.21's new VERSION file format (bazel-contrib#3600)
* detect_sdk_version: Support 1.21's new VERSION file format
Go 1.21 changes VERSION to have the Go version on the first line,
then include additional key/value pairs on subsequent lines. Right
now it only has a "time" key, but may contain others in the future.
This changes detect_sdk_version to only take the first line in the
file, rather than the entire file. This is necessary to support
Go 1.21. I tested this by changing WORKSPACE to use "go1.21rc2".
Fixes:
ERROR: .../rules_go/WORKSPACE:8:23: fetching go_download_sdk_rule rule //external:go_sdk: Traceback (most recent call last):
File ".../rules_go/go/private/sdk.bzl", line 120, column 43, in _go_download_sdk_impl
detected_version = _detect_sdk_version(ctx, ".")
File ".../rules_go/go/private/sdk.bzl", line 550, column 17, in _detect_sdk_version
fail("SDK is version %s, but version %s was expected" % (version, ctx.attr.version))
Error in fail: SDK is version 1.21rc2
time 2023-06-21T02:00:01Z
, but version 1.21rc2 was expected
* clarify the string manipulation operation1 parent 0a60f26 commit ef98815
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
549 | 551 | | |
550 | 552 | | |
551 | 553 | | |
| |||
0 commit comments