Michael B. Gale
01a1d814f4
Do not call `EmitNewerGoVersionNeeded` for v1.21+
2023-10-06 11:57:37 +01:00
Michael B. Gale
c63f6807c4
Go: Run `go version` with `GOTOOLCHAIN=local`
2023-10-06 11:57:26 +01:00
Michael B. Gale
76781e5d75
Go: Add `GoVersionInfo` type
...
Refactors `tryReadGoDirective` to return this instead of a pair.
This will make it easier to return multiple versions.
2023-10-06 11:57:08 +01:00
Michael B. Gale
d7278be064
Go: Update `versionRe` to include patch version
...
This is optional
2023-09-15 16:50:24 +01:00
Michael B. Gale
a1c9deea61
Merge pull request #13867 from github/mbg/go/1.21-support
...
Go: Basic Go 1.21 support
2023-08-18 14:37:11 +01:00
Chris Smowton
3bcfbcdf68
Don't warn when Go version exactly matches go.mod
...
We had only previously tested this with e.g. installed go 1.20.5 >= go.mod request `go 1.20`; now we have go 1.21.0 which shouldn't elicit a warning because 1.21.0 is equal to the go.mod request `go 1.21`.
2023-08-15 16:49:42 +01:00
Michael B. Gale
14731e8fa3
Bump supported Go version to 1.21
2023-08-11 10:57:10 +01:00
Owen Mansel-Chan
5864bdc1af
Modify buildInfo inside function fixGoVendorIssues
2023-06-30 11:02:24 +01:00
Owen Mansel-Chan
6c89c60900
Put DepMode, ModMode and BaseDir into a struct
2023-06-30 11:00:16 +01:00
Owen Mansel-Chan
8269bffbdb
Use filepath.Join more
2023-06-29 16:56:41 +01:00
Owen Mansel-Chan
bbbdc47dd5
Preserve behaviour for nested go.mods when one is in root
2023-06-29 16:56:32 +01:00
Owen Mansel-Chan
ae7adc999c
Rename return variable
2023-06-29 16:56:29 +01:00
Owen Mansel-Chan
964ca33445
Fix cases where we can't yet use go.mod
2023-06-29 16:56:24 +01:00
Owen Mansel-Chan
c766f68b93
Fix bug detecting if go.mod files are nested
2023-06-29 16:56:20 +01:00
Owen Mansel-Chan
1a80ba0821
Name return values of `findGoModFiles`
2023-06-29 16:56:17 +01:00
Owen Mansel-Chan
a852173e22
Fix behaviour for single non-root go.mod
...
Also add telemetry so we can prioritise future work on the autobuilder.
2023-06-29 16:56:11 +01:00
Owen Mansel-Chan
e43fd72fc1
Fix log message about Glide
2023-06-29 16:56:09 +01:00
Owen Mansel-Chan
55fe318f5a
Merge pull request #13397 from owen-mc/go/document-build-environment-recommendations
...
Add Go version table for --identify-environment
2023-06-07 17:06:13 +01:00
Owen Mansel-Chan
69854638b6
Add Go version table for --identify-environment
2023-06-07 15:51:21 +01:00
Michael B. Gale
631ba6584d
Go: Update `identify-environment` JSON format
...
The spec changed after this was implemented and merged
2023-05-26 10:13:40 +01:00
Owen Mansel-Chan
1a9bd9ccde
Merge pull request #13135 from owen-mc/go/fix-unit-test
...
Go: fix unit test
2023-05-16 07:50:50 +01:00
Owen Mansel-Chan
760ba82c7a
Fix unit tests
2023-05-11 16:40:59 +01:00
Owen Mansel-Chan
1beb348d95
Fix outdated message
2023-05-11 14:29:14 +01:00
Owen Mansel-Chan
02a224c28f
--identify-environment should write json to stdout
2023-05-11 14:29:14 +01:00
Owen Mansel-Chan
9334cfb22c
Change logic when go mod version above max supported version
2023-05-10 21:56:56 +01:00
Owen Mansel-Chan
9c5fc9714a
Use "Requesting" instead of "Writing environment file"
2023-05-10 21:53:10 +01:00
Owen Mansel-Chan
97ec7a07eb
Address review comments
2023-05-10 15:53:08 +01:00
Owen Mansel-Chan
375be68492
Fix diagnostics
2023-05-10 11:12:48 +01:00
Owen Mansel-Chan
edebebf603
Refactor for clarity
2023-05-10 11:12:47 +01:00
Owen Mansel-Chan
12f996ff56
Deal better with goModVersion < minGoVersion
2023-05-10 09:45:48 +01:00
Owen Mansel-Chan
32b5df69c3
Add comments explaining version choice logic
2023-05-10 09:26:18 +01:00
Owen Mansel-Chan
d329da673a
Refactor logic for which version to install
...
This does not change the version returned. In the case the the go mod
version is supported and the go env version is below goMinVersion, the
message now talks about go env version being unsupported instead of
it being less than go mod version. This seems more sensible to me.
2023-05-05 15:44:55 +01:00
Owen Mansel-Chan
3f7a230a11
Sometimes install Go version even when one exists
2023-05-05 15:44:54 +01:00
Owen Mansel-Chan
bb3101e649
Merge pull request #13022 from owen-mc/go/identify-environment-fixes
...
Go: `go-autobuilder --identify-environment` fixes
2023-05-04 14:30:31 +01:00
Owen Mansel-Chan
011c9272cf
Remove inconsistent line break in message
2023-05-04 10:33:05 +01:00
Owen Mansel-Chan
c21b1a6e3b
Be clear when no Go version in environment file
2023-05-04 10:32:21 +01:00
Owen Mansel-Chan
5d06adb1e6
Only check if go env version is supported if go mod version is supported
...
This is what I meant to implement in the first place.
2023-05-04 10:24:43 +01:00
Owen Mansel-Chan
62653fbec5
Simplify return statements in tryReadGoDirective
...
This makes it easier to reason about what is returned and would have
avoided the bug with variable shadowing.
2023-05-03 16:55:19 +01:00
Owen Mansel-Chan
d30b736eb2
Move check for EmitNewerGoVersionNeeded diagnostic
...
This should only be done when --identify-environment has not been passed
2023-05-03 16:52:48 +01:00
Owen Mansel-Chan
afb692300a
Fix typo in field name
2023-05-03 16:46:44 +01:00
Owen Mansel-Chan
742a6d9264
Fix accidental variable shadowing
2023-05-03 16:32:53 +01:00
Owen Mansel-Chan
347b5f1b1a
Remove unused code
2023-05-03 16:03:17 +01:00
Owen Mansel-Chan
509dda5af5
Use raw string literals to avoid double-escaping
2023-05-03 16:02:36 +01:00
Owen Mansel-Chan
841db151f6
Improve naming
2023-05-03 13:01:23 +01:00
Owen Mansel-Chan
0f134c6a3c
Wrap long line
2023-05-03 12:52:11 +01:00
Owen Mansel-Chan
f86e540d2a
`msg` is always non-empty
2023-05-03 12:50:58 +01:00
Owen Mansel-Chan
af2a9b21ab
Add function comments
2023-05-03 12:47:28 +01:00
Owen Mansel-Chan
4b88279ccc
Improve usage message formatting
2023-05-03 12:03:11 +01:00
Owen Mansel-Chan
27fb42db76
Env var for path to environment file
2023-05-03 11:11:09 +01:00
Owen Mansel-Chan
0c6efb8c84
Add telemetry-only diagnostics
2023-05-02 17:17:06 +01:00